Skip to content

Instantly share code, notes, and snippets.

@kojiisd
Last active August 14, 2017 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kojiisd/4354680214ff75cb680598c885de2866 to your computer and use it in GitHub Desktop.
Save kojiisd/4354680214ff75cb680598c885de2866 to your computer and use it in GitHub Desktop.
AtlassianのLocalStackを使ってみてなんとなく理解するまでのお話 ref: http://qiita.com/kojiisd/items/8d7b98fb7f3c8f871f96
$ docker run -it -p 4567-4578:4567-4578 -p 8080:8080 atlassianlabs/localstack
2017-04-23 08:50:15,876 INFO supervisord started with pid 1
2017-04-23 08:50:16,879 INFO spawned: 'dashboard' with pid 7
2017-04-23 08:50:16,885 INFO spawned: 'infra' with pid 8
(. .venv/bin/activate; bin/localstack web --port=8080)
. .venv/bin/activate; exec localstack/mock/infra.py
Starting local dev environment. CTRL-C to quit.
* Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
* Restarting with stat
Starting local Elasticsearch (port 4571)...
Starting mock ES service (port 4578)...
Starting mock S3 server (port 4572)...
Starting mock SNS server (port 4575)...
Starting mock SQS server (port 4576)...
Starting mock API Gateway (port 4567)...
Starting mock DynamoDB (port 4569)...
Starting mock DynamoDB Streams (port 4570)...
Starting mock Firehose (port 4573)...
Starting mock Lambda (port 4574)...
Starting mock Kinesis (port 4568)...
Starting mock Redshift server (port 4577)...
* Debugger is active!
2017-04-23 08:50:18,537 INFO success: dashboard entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2017-04-23 08:50:18,538 INFO success: infra entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
* Debugger PIN: 844-652-544
Ready.
healthy: dynamodb.us-east-1.amazonaws.com
$ aws --endpoint-url=http://localhost:4569 dynamodb list-tables
{
"TableNames": []
}
$ aws --endpoint-url=http://localhost:4569 dynamodb create-table --table-name test --attribute-definitions AttributeName=testId,AttributeType=S --key-schema AttributeName=testId,KeyType=HASH --provisioned-throughput ReadCapacityUnits=1,WriteCapacityUnits=1
{
"TableDescription": {
"TableArn": "arn:aws:dynamodb:us-east-1:000000000000:table/test",
"AttributeDefinitions": [
{
"AttributeName": "testId",
"AttributeType": "S"
}
],
"ProvisionedThroughput": {
"NumberOfDecreasesToday": 0,
"WriteCapacityUnits": 1,
"ReadCapacityUnits": 1
},
"TableSizeBytes": 0,
"TableName": "test",
"TableStatus": "CREATING",
"KeySchema": [
{
"KeyType": "HASH",
"AttributeName": "testId"
}
],
"ItemCount": 0,
"CreationDateTime": 1492937089.534
}
}
$ aws --endpoint-url=http://localhost:4569 dynamodb list-tables
{
"TableNames": [
"test"
]
}
$ aws --endpoint-url=http://localhost:4572 s3 ls
(何も表示されず)
$ aws --endpoint-url=http://localhost:4572 s3 mb s3://kojiisd-test/
make_bucket: s3://kojiisd-test/
$ aws --endpoint-url=http://localhost:4572 s3 ls
2006-02-04 01:45:09 kojiisd-test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment