Automation tool code to build and deploy AWS resources used in the post-notification microbenchmark.
Configure the AWS profile settings:
aws configure
Initialize the working directory:
terraform init
Provide the configuration values in config/config.json
.
For simplicity, define the necessary variables in terraform.tfvars
, mainly:
credentials_path
writer
reader
If the initial and persistent resources are not deployed yet, you are in the right section.
Otherwise, provide the existing configuration details in config/vpc_{region}.json
for existing regions (eu-central-1, us-east-1, ap-southeast-1) and skip this.
terraform apply -var="type=init"
Or simply do apply with terraform apply
and provide arguments later.
IMPORTANT NOTES:
The following resources are deployed in every necessary region:
- IAM Role/Policies: global to any region
- VPC, including subnets, routing tables, security groups, internet gateways
- SNS: eu-central-1 only
- SQS: us-east-1 and ap-southeast-1 only
- S3 used only for lambdas buckets
- AMQ Peering: from eu-central-1 to us-east-1 and ap-southeast-1
The remaining resources are only deployed specifically in the writer
and reader
regions specified above. It is recommended to delete the resource in the reader side along with the replication, when changing the reader to a different region. This requires manually creating the resource in the reader region.
- DynamoDB: tables and replication in reader region
- S3: buckets for posts with replication rule from writer to reader
Deploy resources and specify the post_storage
(dynamo, s3, cache, mysql) and notification_storage
(sns, mq).
terraform apply -var="type=deploy" -var="post_storage=mysql" -var="notification_storage=sns"
Or simply do apply with terraform apply
and provide arguments later.
REMINDER: don't forget to destroy all resources at the end!
terraform destroy