1.8 KiB
1.8 KiB
Working with LocalStack
- Start docker-compose
- Working with AWS CLI
- create bucket
aws s3 mb s3://portal-user-profile-images --endpoint-url http://localhost:4566- or
aws s3api create-bucket --bucket portal-user-profile-images --endpoint-url http://localhost:4566 --create-bucket-configuration '{\"LocationConstraint\":\"eu-north-1\"}'- will respond
-
{ "Location": "http://portal-user-profile-images.s3.localhost.localstack.cloud:4566/" }
- list buckets
aws s3 ls --endpoint-url http://localhost:4566aws s3api list-buckets --endpoint-url http://localhost:4566
- list objects in a bucket
aws s3 ls s3://portal-user-profile-images --endpoint-url http://localhost:4566- only one level (like dir)aws s3api list-objects --bucket portal-user-profile-images --endpoint-url http://localhost:4566- view all object info
- create bucket
- Working with
awslocalcli inside running docker container- run
bashinside containerdocker ps- view container idc60d2c36c5f9docker exec -it c60 bash
- create bucket
awslocal s3 mb s3://portal-user-profile-imagesawslocal s3api create-bucket --bucket portal-user-profile-images --create-bucket-configuration '{"LocationConstraint":"eu-north-1"}'
- list buckets
awslocal s3 lsawslocal s3api list-buckets
- list objects in a bucket
awslocal s3 ls s3://portal-user-profile-images- only one level (like dir)awslocal s3api list-objects --bucket portal-user-profile-images- view all object info
- run
- Working with
awslocalcli installed locally- install localstack cli
pip install localstacklocalstack --version
- install localstack cli