|
Size: 1368
Comment:
|
Size: 1455
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 6: | Line 6: |
== Install AWS CLI == {{{#!highlight shell # Install aws cli cd ~/Downloads curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install aws --version }}} |
|
| Line 33: | Line 43: |
| # Install aws cli cd ~/Downloads curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install aws --version |
docker compose exec motoserver sh |
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
4 aws s3 ls
5 aws s3api create-bucket --bucket my-bucket
6 # https://docs.aws.amazon.com/cli/latest/reference/s3api/
7 echo "test" > test.txt
8 aws s3api put-object --bucket my-bucket --key dir-1/test.txt --body test.txt
9 aws s3api get-object --bucket my-bucket --key dir-1/test.txt test2.txt
10 cat test2.txt
11 aws s3 ls
