-
-
Save lijie2000/94e52bf0b7890ee528f9ecdf6c6f7378 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################################################ | |
################## ############################# | |
################## ############################# | |
This Gist collection contains all localstack related examples | |
################## ############################# | |
################## ############################# | |
############################################################################################################ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2.1' | |
services: | |
localstack: | |
container_name: "localstack" # Container name in your docker | |
image: localstack/localstack:latest # Will download latest version of localstack | |
ports: | |
- "4566:4566" # Default port forward | |
- "4571:4571" # Elasticsearch port forward | |
environment: | |
- SERVICES=es, s3, ec2, dynamodb, elasticcache, sqs #AWS Services that you want in your localstack | |
- DEBUG=1 #Debug level 1 if you want to logs, 0 if you want to disable | |
- START_WEB=0 | |
- LAMBDA_REMOTE_DOCKER=0 | |
- DATA_DIR=/tmp/localstack/data | |
- DEFAULT_REGION=us-east-1 | |
volumes: | |
- './.localstack:/tmp/localstack' | |
- '/var/run/docker.sock:/var/run/docker.sock' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Create s3 bucket - | |
# aws --endpoint-url=http://localhost:4566 s3 mb s3://my-test-bucket | |
2) List s3 buckets - | |
# aws --endpoint-url="http://localhost:4566" s3 ls | |
3) Upload file on s3 bucket - | |
# aws --endpoint-url="http://localhost:4566" s3 sync "myfiles" s3://my-test-bucket | |
4) List files from AWS CLI - | |
# aws --endpoint-url="http://localhost:4566" s3 ls s3://my-test-bucket | |
6) Access file via URL(File name was download.jpg) - | |
# http://localhost:4566/my-test-bucket/download.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment