Skip to content

Commit f35e292

Browse files
committed
Renaming some modules
1 parent e0631fa commit f35e292

File tree

50 files changed

+1158
-1626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1158
-1626
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ README.md
1515

1616
settings-spring.xml
1717

18-
spring-native-aws-lambda-infra
18+
spring-native-aws-service-infra
1919
docker-compose.yml

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ jobs:
5858
ENV: ${{ env.ENV }}
5959
COST_CENTRE: ${{ env.COST_CENTRE }}
6060
run: |
61-
./mvnw -ntp clean verify -DskipTests -pl spring-native-aws-lambda-infra
62-
./mvnw -ntp clean -Pnative -DskipTests native:compile package -pl spring-native-aws-lambda-function
61+
./mvnw -ntp clean verify -DskipTests -pl spring-native-aws-service-infra
62+
./mvnw -ntp clean -Pnative -DskipTests native:compile package -pl spring-native-aws-service
6363
- name: cdk diff
6464
uses: muhamadto/aws-cdk-github-actions@v5
6565
with:

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Apache [spring-native-aws-lambda-function]
1+
Apache [spring-native-aws-function]
22
Copyright 2021 Muhammad Hamadto
33

44
This product includes software developed by:

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# spring-native-aws-lambda
1+
# spring-native-aws-function
22

33
[![CodeQL](https://github.com/muhamadto/spring-native-aws-lambda/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/muhamadto/spring-native-aws-lambda/actions/workflows/codeql-analysis.yml)
44
[![Build](https://github.com/muhamadto/spring-native-aws-lambda/actions/workflows/build.yml/badge.svg)](https://github.com/muhamadto/spring-native-aws-lambda/actions/workflows/build.yml)
@@ -56,8 +56,8 @@ $ ./mvnw -ntp clean verify -U
5656
1. Run the following commands
5757
```shell
5858
$ export SPRING_PROFILES_ACTIVE=local
59-
$ ./mvnw -ntp clean -Pnative -DskipTests native:compile package -pl spring-native-aws-lambda-function
60-
$ ./spring-native-aws-lambda-function/target/spring-native-aws-lambda-function
59+
$ ./mvnw -ntp clean -DskipTests -Pnative native:compile package -pl spring-native-aws-service
60+
$ ./spring-native-aws-service/target/spring-native-aws-service
6161
```
6262
The service starts in less than 100 ms
6363
```shell
@@ -134,7 +134,7 @@ and the following trust relationship
134134
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
135135
},
136136
"StringLike": {
137-
"token.actions.githubusercontent.com:sub": "repo:{github-account-or-org}/spring-native-aws-lambda:*"
137+
"token.actions.githubusercontent.com:sub": "repo:{github-account-or-org}/spring-native-aws-service:*"
138138
}
139139
}
140140
}
@@ -259,7 +259,7 @@ and the following trust relationship
259259
"SNS:UntagResource"
260260
],
261261
"Resource": [
262-
"arn:aws:sns:{aws-region}:{aws-account-number}:spring-native-aws-lambda-function-dead-letter-topic"
262+
"arn:aws:sns:{aws-region}:{aws-account-number}:spring-native-aws-function-dead-letter-topic"
263263
]
264264
},
265265
{
@@ -281,8 +281,8 @@ and the following trust relationship
281281
"lambda:UpdateFunctionConfiguration"
282282
],
283283
"Resource": [
284-
"arn:aws:lambda:{aws-region}:{aws-account-number}:function:spring-native-aws-lambda-function",
285-
"arn:aws:lambda:{aws-region}:{aws-account-number}:function:spring-native-aws-lambda-function:$LATEST"
284+
"arn:aws:lambda:{aws-region}:{aws-account-number}:function:spring-native-aws-function",
285+
"arn:aws:lambda:{aws-region}:{aws-account-number}:function:spring-native-aws-function:$LATEST"
286286
]
287287
},
288288
{
@@ -310,9 +310,9 @@ and the following trust relationship
310310
"iam:DetachRolePolicy"
311311
],
312312
"Resource": [
313-
"arn:aws:iam::{aws-account-number}:role/spring-native-aws-lambda-springnativeawslambdafun-*",
314-
"arn:aws:iam::{aws-account-number}:role/spring-native-aws-lambda-springnativeawslambdares-4FVJBBHF9EL2",
315-
"arn:aws:iam::{aws-account-number}:role/spring-native-aws-lambda-function-rest-api/CloudWatchRole"
313+
"arn:aws:iam::{aws-account-number}:role/spring-native-aws-service-springnativeawslambdafun-*",
314+
"arn:aws:iam::{aws-account-number}:role/spring-native-aws-service-springnativeawslambdares-4FVJBBHF9EL2",
315+
"arn:aws:iam::{aws-account-number}:role/spring-native-aws-function-rest-api/CloudWatchRole"
316316
]
317317
},
318318
{
@@ -346,7 +346,7 @@ in step 4
346346
Now that the setup is done you can deploy to AWS.
347347

348348
1. Create a new release in
349-
Github [releases page](https://github.com/muhamadto/spring-native-aws-lambda/releases),
349+
Github [releases page](https://github.com/muhamadto/spring-native-aws-service/releases),
350350
the [github action](.github/workflows/release.yml) will start and a deployment to AWS
351351
environment.
352352
2. Test via curl

cdk.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"app": "./mvnw exec:java -pl spring-native-aws-lambda-infra -Dexec.mainClass=com.coffeebeans.springnativeawslambda.infra.Application"
2+
"app": "./mvnw exec:java -pl spring-native-aws-service-infra -Dexec.mainClass=com.coffeebeans.springnativeawslambda.infra.Application"
33
}

docker-compose.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
version: "3.9"
1717
services:
18-
spring-native-aws-lambda-function-infra:
19-
image: muhamadto/spring-native-amazonlinux2-builder:21-amazonlinux2-awscliv2
18+
spring-native-aws-function-infra:
19+
image: ghcr.io/muhamadto/spring-native-amazonlinux2-builder:21-amazonlinux2-awscliv2
2020
volumes:
2121
- ./:/app
2222
- ${M2_REPO}:/home/worker/.m2
@@ -29,7 +29,9 @@ services:
2929
AWS_SECRET_ACCESS_KEY: local
3030
AWS_ENDPOINT_URL: http://localstack:4566
3131
BUILD_ARTIFACT: 'true'
32-
FUNCTION_NAME: spring-native-aws-lambda-function
32+
FUNCTION_NAME: spring-native-aws-service
33+
SPRING_MAIN_WEBAPPLICATIONTYPE: servlet
34+
SPRING_CLOULD_AWS_DYNAMODB_ENDPOINT: http://localstack:4566
3335
STAGE: compose
3436
MAVEN_OPTS: |
3537
-DskipTests=true
@@ -45,7 +47,7 @@ services:
4547
- -c
4648
command: |
4749
'
48-
function package_spring_native_lambda() {
50+
function package_spring_native_function() {
4951
if [ "$$BUILD_ARTIFACT" = "true" ]; then
5052
./mvnw -ntp clean -Pnative -DskipTests native:compile package -pl "$$FUNCTION_NAME"
5153
else
@@ -61,7 +63,7 @@ services:
6163
6264
print_info_message "divider" "Package GraalVM function" &&
6365
64-
package_spring_native_lambda &&
66+
package_spring_native_function &&
6567
6668
print_info_message "divider" "Creating LAMBDA function" &&
6769
lambda_create_function "$$FUNCTION_NAME" provided.al2023 512 ./"$$FUNCTION_NAME"/target/"$$FUNCTION_NAME"-native-zip.zip "$$FUNCTION_NAME" &&

pom.xml

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@
2626
<groupId>org.springframework.boot</groupId>
2727
<artifactId>spring-boot-starter-parent</artifactId>
2828
<version>3.2.1</version>
29-
<relativePath />
29+
<relativePath/>
3030
</parent>
3131

3232
<groupId>com.coffeebeans</groupId>
3333
<artifactId>spring-native-aws-lambda</artifactId>
3434
<name>${project.artifactId}</name>
3535
<version>${revision}</version>
3636
<packaging>pom</packaging>
37-
<description>Demo project for Spring cloud function with graalvm native image deployed with cdk
38-
</description>
37+
<description>Demo project for Spring cloud function with graalvm native image deployed with cdk</description>
3938

4039
<developers>
4140
<developer>
@@ -79,26 +78,47 @@
7978
</properties>
8079

8180
<modules>
82-
<module>spring-native-aws-lambda-function</module>
83-
<module>spring-native-aws-lambda-infra</module>
81+
<module>spring-native-aws-service</module>
82+
<module>spring-native-aws-service-infra</module>
8483
</modules>
8584

8685
<dependencyManagement>
8786
<dependencies>
87+
88+
<dependency>
89+
<groupId>io.awspring.cloud</groupId>
90+
<artifactId>spring-cloud-aws-dependencies</artifactId>
91+
<version>3.1.1</version>
92+
<type>pom</type>
93+
<scope>import</scope>
94+
</dependency>
95+
8896
<!-- SPRING-NATIVE-AWS-LAMBDA -->
8997
<dependency>
9098
<groupId>com.coffeebeans</groupId>
91-
<artifactId>spring-native-aws-lambda-function</artifactId>
99+
<artifactId>spring-native-aws-service</artifactId>
92100
<version>${project.version}</version>
93101
</dependency>
94102
<dependency>
95103
<groupId>com.coffeebeans</groupId>
96-
<artifactId>spring-native-aws-lambda-infra</artifactId>
104+
<artifactId>spring-native-aws-service-infra</artifactId>
97105
<version>${project.version}</version>
98106
</dependency>
99107

100108
<!-- SPRING-NATIVE-AWS-LAMBDA ENDS -->
101109

110+
<dependency>
111+
<groupId>com.coffeebeans</groupId>
112+
<artifactId>coffeebeans-cdk-core</artifactId>
113+
<version>1.0-SNAPSHOT</version>
114+
</dependency>
115+
116+
<dependency>
117+
<groupId>com.coffeebeans</groupId>
118+
<artifactId>coffeebeans-cdk-assertions</artifactId>
119+
<version>1.0-SNAPSHOT</version>
120+
</dependency>
121+
102122
<!-- AWS -->
103123
<dependency>
104124
<groupId>com.amazonaws</groupId>
@@ -187,7 +207,7 @@
187207
<dependency>
188208
<groupId>software.amazon.awscdk</groupId>
189209
<artifactId>aws-cdk-lib</artifactId>
190-
<version>2.116.1</version>
210+
<version>2.128.0</version>
191211
</dependency>
192212
<!-- AWS CDK ENDS -->
193213

@@ -213,6 +233,13 @@
213233
<scope>test</scope>
214234
</dependency>
215235

236+
<dependency>
237+
<groupId>org.junit.jupiter</groupId>
238+
<artifactId>junit-jupiter-params</artifactId>
239+
<version>${junit-jupiter.version}</version>
240+
<scope>test</scope>
241+
</dependency>
242+
216243
<dependency>
217244
<groupId>org.mockito</groupId>
218245
<artifactId>mockito-core</artifactId>
@@ -271,6 +298,16 @@
271298
</plugins>
272299
</build>
273300

301+
<repositories>
302+
<repository>
303+
<id>github</id>
304+
<url>https://public:&#48;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@maven.pkg.github.com/muhamadto/*</url>
305+
<snapshots>
306+
<enabled>true</enabled>
307+
</snapshots>
308+
</repository>
309+
</repositories>
310+
274311
<licenses>
275312
<license>
276313
<name>Apache License, Version 2.0</name>

spring-native-aws-lambda-function/src/test/java/com/coffeebeans/springnativeawslambda/function/ExampleFunctionTest.java

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)