Skip to content
This repository was archived by the owner on Mar 30, 2021. It is now read-only.

Commit d40c9c2

Browse files
author
Kazufumi Fukushima
committed
add content
1 parent 492eb67 commit d40c9c2

File tree

18 files changed

+916
-5
lines changed

18 files changed

+916
-5
lines changed

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
## My Project
1+
# Java Samples for Rapid Prototyping
22

3-
TODO: Fill this README out!
3+
This is a project to experience application development on AWS with the actual minimal implementations!
44

5-
Be sure to:
5+
It contains:
6+
* Basic 3-tiers serverlss WEB application which depends on:
7+
* Amazon API Gateway
8+
* AWS Lambda
9+
* Amazon DynamoDB
610

7-
* Change the title in this README
8-
* Edit your repository description on GitHub
11+
## Prerequisite
12+
* Java 8 or Later
13+
* Maven 3.6.1 or Later
14+
* CDK 1.31.0
15+
16+
## deploy
17+
1. `cd lambda`
18+
2. `mvn install` package lambda source files into jar and install to maven local repository
19+
3. `cd ../cdk`
20+
4. `mvn compile` compile cdk source files
21+
5. `cdk deploy` deploy resources via cdk
922

1023
## License
1124

cdk/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.classpath.txt
2+
target
3+
.classpath
4+
.project
5+
.idea
6+
.settings
7+
.vscode
8+
*.iml
9+
10+
# CDK asset staging directory
11+
.cdk.staging
12+
cdk.out

cdk/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Welcome to your CDK Java project!
2+
3+
This is a blank project for Java development with CDK.
4+
5+
The `cdk.json` file tells the CDK Toolkit how to execute your app.
6+
7+
It is a [Maven](https://maven.apache.org/) based project, so you can open this project with any Maven compatible Java IDE to build and run tests.
8+
9+
## Useful commands
10+
11+
* `mvn package` compile and run tests
12+
* `cdk ls` list all stacks in the app
13+
* `cdk synth` emits the synthesized CloudFormation template
14+
* `cdk deploy` deploy this stack to your default AWS account/region
15+
* `cdk diff` compare deployed stack with current state
16+
* `cdk docs` open CDK documentation
17+
18+
Enjoy!

cdk/cdk.context.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"@aws-cdk/core:enableStackNameDuplicates": "true",
3+
"aws-cdk:enableDiffNoFail": "true"
4+
}

cdk/cdk.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"app": "mvn -e -q exec:java"
3+
}

cdk/pom.xml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4+
xmlns="http://maven.apache.org/POM/4.0.0"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
6+
<modelVersion>4.0.0</modelVersion>
7+
8+
<groupId>com.amazon.aws.prototyping</groupId>
9+
<artifactId>cdk</artifactId>
10+
<version>0.1</version>
11+
12+
<properties>
13+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14+
<aws.cdk.version>1.31.0</aws.cdk.version>
15+
</properties>
16+
17+
<build>
18+
<plugins>
19+
<plugin>
20+
<groupId>org.apache.maven.plugins</groupId>
21+
<artifactId>maven-compiler-plugin</artifactId>
22+
<version>3.8.1</version>
23+
<configuration>
24+
<source>1.8</source>
25+
<target>1.8</target>
26+
</configuration>
27+
</plugin>
28+
<plugin>
29+
<groupId>org.apache.maven.plugins</groupId>
30+
<artifactId>maven-dependency-plugin</artifactId>
31+
<executions>
32+
<execution>
33+
<id>copy assets</id>
34+
<phase>compile</phase>
35+
<goals>
36+
<goal>copy-dependencies</goal>
37+
</goals>
38+
<configuration>
39+
<includeGroupIds>com.amazon.aws.prototyping</includeGroupIds>
40+
<outputDirectory>${project.build.directory}/assets</outputDirectory>
41+
</configuration>
42+
</execution>
43+
</executions>
44+
</plugin>
45+
<plugin>
46+
<groupId>org.codehaus.mojo</groupId>
47+
<artifactId>exec-maven-plugin</artifactId>
48+
<version>1.6.0</version>
49+
<configuration>
50+
<mainClass>com.amazon.aws.prototyping.CdkApp</mainClass>
51+
</configuration>
52+
</plugin>
53+
</plugins>
54+
</build>
55+
56+
<dependencies>
57+
<!-- AWS Cloud Development Kit -->
58+
<dependency>
59+
<groupId>software.amazon.awscdk</groupId>
60+
<artifactId>core</artifactId>
61+
<version>${aws.cdk.version}</version>
62+
</dependency>
63+
<dependency>
64+
<groupId>software.amazon.awscdk</groupId>
65+
<artifactId>apigateway</artifactId>
66+
<version>${aws.cdk.version}</version>
67+
</dependency>
68+
<dependency>
69+
<groupId>software.amazon.awscdk</groupId>
70+
<artifactId>lambda</artifactId>
71+
<version>${aws.cdk.version}</version>
72+
</dependency>
73+
<dependency>
74+
<groupId>software.amazon.awscdk</groupId>
75+
<artifactId>s3</artifactId>
76+
<version>${aws.cdk.version}</version>
77+
</dependency>
78+
<dependency>
79+
<groupId>software.amazon.awscdk</groupId>
80+
<artifactId>dynamodb</artifactId>
81+
<version>${aws.cdk.version}</version>
82+
</dependency>
83+
<dependency>
84+
<groupId>software.amazon.awscdk</groupId>
85+
<artifactId>ec2</artifactId>
86+
<version>${aws.cdk.version}</version>
87+
</dependency>
88+
<dependency>
89+
<groupId>software.amazon.awscdk</groupId>
90+
<artifactId>rds</artifactId>
91+
<version>${aws.cdk.version}</version>
92+
</dependency>
93+
<dependency>
94+
<groupId>software.amazon.awscdk</groupId>
95+
<artifactId>secretsmanager</artifactId>
96+
<version>${aws.cdk.version}</version>
97+
</dependency>
98+
99+
<!-- https://mvnrepository.com/artifact/junit/junit -->
100+
<dependency>
101+
<groupId>junit</groupId>
102+
<artifactId>junit</artifactId>
103+
<version>4.12</version>
104+
<scope>test</scope>
105+
</dependency>
106+
107+
<dependency>
108+
<groupId>com.amazon.aws.prototyping</groupId>
109+
<artifactId>rapid-samples</artifactId>
110+
<version>1.0</version>
111+
</dependency>
112+
</dependencies>
113+
</project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.amazon.aws.prototyping;
2+
3+
import software.amazon.awscdk.core.App;
4+
5+
public class CdkApp {
6+
public static void main(final String[] args) {
7+
App app = new App();
8+
9+
new CdkStack(app, "JavaSamplesCdkStack");
10+
11+
app.synth();
12+
}
13+
}

0 commit comments

Comments
 (0)