-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
25 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
FROM amazon/aws-cli | ||
|
||
RUN echo '{"Version": "2012-10-17", "Statement":[{"Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::*"}]}' >> policy.json | ||
COPY ./init.sh . | ||
|
||
RUN aws dynamodb create-table \ | ||
--table-name order \ | ||
--attribute-definitions AttributeName=id,AttributeType=S \ | ||
--key-schema AttributeName=id,KeyType=HASH \ | ||
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \ | ||
--table-class STANDARD \ | ||
--endpoint-url ${NO_SQL_CONNECTION_STRING} \ | ||
--region ${AWS_REGION} || true | ||
|
||
RUN aws s3api create-bucket \ | ||
--bucket ${AWS_S3_BUCKET_NAME} \ | ||
--endpoint-url ${AWS_S3_SERVICE_URL} || true | ||
|
||
RUN aws s3api put-bucket-policy \ | ||
--bucket ${AWS_S3_BUCKET_NAME} \ | ||
--endpoint-url ${AWS_S3_SERVICE_URL} \ | ||
--policy file://policy.json || true | ||
ENTRYPOINT ["/bin/sh", "init.sh"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
echo '{"Version": "2012-10-17", "Statement":[{"Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::*"}]}' >> policy.json | ||
|
||
aws dynamodb create-table \ | ||
--table-name order \ | ||
--attribute-definitions AttributeName=id,AttributeType=S \ | ||
--key-schema AttributeName=id,KeyType=HASH \ | ||
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \ | ||
--table-class STANDARD \ | ||
--endpoint-url ${NO_SQL_CONNECTION_STRING} || true | ||
|
||
aws s3api create-bucket \ | ||
--bucket ${AWS_S3_BUCKET_NAME} \ | ||
--endpoint-url ${AWS_S3_SERVICE_URL} || true | ||
|
||
aws s3api put-bucket-policy \ | ||
--bucket ${AWS_S3_BUCKET_NAME} \ | ||
--endpoint-url ${AWS_S3_SERVICE_URL} \ | ||
--policy file://policy.json || true |
This file contains 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