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
for i in {1..10} | |
do http POST https://globe.adhorn.me/create "item_id"="boo$i" | |
done |
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
STATUS: 200 |
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
from __future__ import unicode_literals | |
import sys | |
import logging | |
import boto3 | |
import os | |
log = logging.getLogger() | |
log.setLevel(logging.DEBUG) | |
sys.path.insert(0, './vendored') |
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
# create VPC in region us-east-1 | |
aws ec2 create-vpc --cidr-block 10.0.0.0/16 --region us-east-1 | |
{ | |
"Vpc": { | |
"CidrBlock": "10.0.0.0/16", | |
"DhcpOptionsId": "dopt-f14eca94", | |
"State": "pending", | |
"VpcId": "vpc-xxxxxx", | |
"InstanceTenancy": "default", | |
"Ipv6CidrBlockAssociationSet": [], |
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
# create VPC in region us-east-1 | |
aws ec2 create-vpc --cidr-block 10.0.0.0/16 --region us-east-1 | |
{ | |
"Vpc": { | |
"CidrBlock": "10.0.0.0/16", | |
"DhcpOptionsId": "dopt-f14eca94", | |
"State": "pending", | |
"VpcId": "vpc-xxxxxx", |
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
# Create subnet associated with the VPC | |
aws ec2 create-subnet --vpc-id vpc-xxxxxx --cidr-block 10.0.1.0/24 --region us-east-1 | |
{ | |
"Subnet": { | |
"AvailabilityZone": "us-east-1b", | |
"AvailableIpAddressCount": 251, | |
"CidrBlock": "10.0.1.0/24", | |
"DefaultForAz": false, | |
"MapPublicIpOnLaunch": false, | |
"State": "pending", |
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
# Get the routing info from the VPC. | |
aws ec2 describe-route-tables --filters "Name=vpc-id,Values=vpc-xxxxxxx" --region us-east-1 | |
{ | |
"RouteTables": [ | |
{ | |
"Associations": [ | |
{ | |
"Main": true, | |
"RouteTableAssociationId": "rtbassoc-4112743e", | |
"RouteTableId": "rtb-xxxxxx" |
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
#create the initial table with stream enabled in us-east-1 | |
aws dynamodb create-table \ | |
--table-name MyGlobalTable \ | |
--attribute-definitions \ | |
AttributeName=item_id,AttributeType=S \ | |
--key-schema \ | |
AttributeName=item_id,KeyType=HASH \ | |
--provisioned-throughput \ | |
ReadCapacityUnits=5,WriteCapacityUnits=5 \ | |
--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES \ |
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
# Create DynamoDB endpoint in VPC | |
aws ec2 create-vpc-endpoint --vpc-id vpc-xxxxxx --service-name com.amazonaws.us-east-1.dynamodb --region us-east-1 | |
{ | |
"VpcEndpoint": { | |
"VpcEndpointId": "vpce-xxxxxx", | |
"VpcEndpointType": "Gateway", | |
"VpcId": "vpc-xxxxxxx", | |
"ServiceName": "com.amazonaws.us-east-1.dynamodb", | |
"State": "available", |
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
# Finally adding the routing information for the endpoint | |
aws ec2 modify-vpc-endpoint --vpc-endpoint-id vpce-xxxxxx --add-route-table-ids rtb-xxxxxx --region us-east-1 | |
{ | |
"Return": true | |
} |