|
Size: 1455
Comment:
|
Size: 1526
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 44: | Line 44: |
| # in the container cat /etc/os-release # NAME="Alpine Linux" exit |
moto
A python library that allows you to easily mock out tests based on AWS infrastructure.
Install AWS CLI
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 docker compose exec motoserver sh
3 # in the container
4 cat /etc/os-release
5 # NAME="Alpine Linux"
6 exit
7
8 aws s3 ls
9 aws s3api create-bucket --bucket my-bucket
10 # https://docs.aws.amazon.com/cli/latest/reference/s3api/
11 echo "test" > test.txt
12 aws s3api put-object --bucket my-bucket --key dir-1/test.txt --body test.txt
13 aws s3api get-object --bucket my-bucket --key dir-1/test.txt test2.txt
14 cat test2.txt
15 aws s3 ls
