Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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 6 hours ago
JSON representation

Spring Boot with AWS S3 communication with Spring Cloud AWS

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
```