Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amrutprabhu/spring-boot-with-aws-s3
Spring Boot with AWS S3 communication with Spring Cloud AWS
https://github.com/amrutprabhu/spring-boot-with-aws-s3
aws aws-s3 dockercompose localstack spring spring-boot springcloud-aws
Last synced: about 1 month ago
JSON representation
Spring Boot with AWS S3 communication with Spring Cloud AWS
- Host: GitHub
- URL: https://github.com/amrutprabhu/spring-boot-with-aws-s3
- Owner: amrutprabhu
- Created: 2023-05-02T21:52:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-28T17:01:20.000Z (about 1 year ago)
- Last Synced: 2024-09-28T21:04:51.818Z (about 2 months ago)
- Topics: aws, aws-s3, dockercompose, localstack, spring, spring-boot, springcloud-aws
- Language: Java
- Homepage: https://refactorfirst.com/spring-cloud-aws-s3-localstack
- Size: 28.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring Boot with AWS S3
Here I explore how we can communicate with AWS S3 bucket using Spring Cloud AWS.
For running the application locally we will use LocalStack. We will run LocalStack using docker compose.
Also we look into writing integration test to make sure the whole setup works all fine.
### AWS commands to communicate with LocalStack
Create S3 bucket in localstack
```shell
aws s3api create-bucket \
--bucket mybucket \
--endpoint-url http://localhost:4566 \
--create-bucket-configuration LocationConstraint=eu-central-1 \
--profile ltest
```
Copy file to s3 bucket on localstack
```shell
aws s3 cp \
samplefile.txt \
s3://mybucket \
--endpoint-url http://localhost:4566 \
--profile ltest
``````shell
aws s3 ls s3://mybucket \
--endpoint-url http://localhost:4566 \
--profile ltest \
--region eu-central-1
```