|
Size: 1358
Comment:
|
Size: 1358
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 14: | Line 14: |
| export AWS_ENDPOINT_URL="http://localhost:4000" | |
| Line 38: | Line 39: |
| export AWS_ENDPOINT_URL="http://localhost:4000" |
moto
A python library that allows you to easily mock out tests based on AWS infrastructure.
Create S3 bucket
1 export AWS_ACCESS_KEY_ID='testing'
2 export AWS_SECRET_ACCESS_KEY='testing'
3 export AWS_SECURITY_TOKEN='testing'
4 export AWS_SESSION_TOKEN='testing'
5 export AWS_DEFAULT_REGION='us-east-1'
6 export AWS_ENDPOINT_URL="http://localhost:4000"
7
8 docker run --rm -p 4000:4000 --name moto motoserver/moto:latest
compose.yaml
1 docker compose up
2 # Install aws cli
3 cd ~/Downloads
4 curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
5 unzip awscliv2.zip
6 sudo ./aws/install
7 aws --version
8
9 aws s3 ls
10 aws s3api create-bucket --bucket my-bucket
11 # https://docs.aws.amazon.com/cli/latest/reference/s3api/
12 echo "test" > test.txt
13 aws s3api put-object --bucket my-bucket --key dir-1/test.txt --body test.txt
14 aws s3api get-object --bucket my-bucket --key dir-1/test.txt test2.txt
15 cat test2.txt
