-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ranjani-spring-security-jwt
- Loading branch information
Showing
113 changed files
with
7,382 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
HELP.md | ||
target/ | ||
!.mvn/wrapper/maven-wrapper.jar | ||
!**/src/main/**/target/ | ||
!**/src/test/**/target/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
aws/spring-cloud-aws-s3/.mvn/wrapper/maven-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM maven:3.9-amazoncorretto-21 as backend | ||
WORKDIR /backend | ||
COPY pom.xml . | ||
COPY lombok.config . | ||
RUN mvn dependency:go-offline -B | ||
COPY src ./src | ||
RUN mvn clean install -DskipITs | ||
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar) | ||
|
||
FROM openjdk:21 | ||
ARG DEPENDENCY=/backend/target/dependency | ||
COPY --from=backend ${DEPENDENCY}/BOOT-INF/lib /app/lib | ||
COPY --from=backend ${DEPENDENCY}/META-INF /app/META-INF | ||
COPY --from=backend ${DEPENDENCY}/BOOT-INF/classes /app | ||
ENTRYPOINT ["java", "-cp", "app:app/lib/*", "io.reflectoring.Application"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Interacting with Amazon S3 Bucket using Spring Cloud AWS | ||
|
||
Codebase demonstrating connection and interaction with provisioned Amazon S3 bucket using [Spring Cloud AWS](https://spring.io/projects/spring-cloud-aws). | ||
|
||
Contains integration tests to validate interaction between the application and Amazon S3 using [LocalStack](https://github.com/localstack/localstack) and [Testcontainers](https://github.com/testcontainers/testcontainers-java). Test cases can be executed with the command `./mvnw integration-test verify`. | ||
|
||
To run the application locally without provisioning actual AWS Resources, execute the below commands: | ||
|
||
```bash | ||
chmod +x localstack/init-s3-bucket.sh | ||
``` | ||
|
||
```bash | ||
sudo docker-compose build | ||
``` | ||
|
||
```bash | ||
sudo docker-compose up -d | ||
``` | ||
|
||
## Blog posts | ||
|
||
Blog posts about this topic: | ||
|
||
* [Using Amazon S3 with Spring Cloud AWS](https://reflectoring.io/spring-cloud-aws-s3/) | ||
* [Using AWS S3 Presigned URLs in Spring Boot](https://reflectoring.io/aws-s3-presigned-url-spring-boot/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
version: '3.7' | ||
|
||
services: | ||
localstack: | ||
container_name: localstack | ||
image: localstack/localstack:3.3 | ||
ports: | ||
- 4566:4566 | ||
environment: | ||
- SERVICES=s3 | ||
volumes: | ||
- ./localstack/init-s3-bucket.sh:/etc/localstack/init/ready.d/init-s3-bucket.sh | ||
networks: | ||
- reflectoring | ||
|
||
backend: | ||
container_name: backend-application | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
ports: | ||
- 8080:8080 | ||
depends_on: | ||
- localstack | ||
environment: | ||
spring.cloud.aws.s3.endpoint: 'http://localstack:4566' | ||
spring.cloud.aws.s3.path-style-access-enabled: true | ||
spring.cloud.aws.credentials.access-key: test | ||
spring.cloud.aws.credentials.secret-key: test | ||
spring.cloud.aws.s3.region: 'us-east-1' | ||
io.reflectoring.aws.s3.bucket-name: 'reflectoring-bucket' | ||
io.reflectoring.aws.s3.presigned-url.validity: 120 | ||
networks: | ||
- reflectoring | ||
|
||
networks: | ||
reflectoring: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
bucket_name="reflectoring-bucket" | ||
|
||
awslocal s3api create-bucket --bucket $bucket_name | ||
|
||
echo "S3 bucket '$bucket_name' created successfully" | ||
echo "Executed init-s3-bucket.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lombok.nonNull.exceptionType=IllegalArgumentException |
Oops, something went wrong.