All Projects → kung-foo → Multiregion Terraform

kung-foo / Multiregion Terraform

Licence: mit
Example multi-region AWS Terraform application

Projects that are alternatives of or similar to Multiregion Terraform

Terraform Aws Elasticsearch
Terraform module to provision an Elasticsearch cluster with built-in integrations with Kibana and Logstash.
Stars: ✭ 137 (-8.05%)
Mutual labels:  aws, terraform, hcl
Example Pragmatic Terraform On Aws
技術書典6で頒布した『Pragmatic Terraform on AWS 』のサンプルコードを公開しています
Stars: ✭ 140 (-6.04%)
Mutual labels:  aws, terraform, hcl
Terraform Aws Ecr
Terraform Module to manage Docker Container Registries on AWS ECR
Stars: ✭ 110 (-26.17%)
Mutual labels:  aws, terraform, hcl
Aws Ecs Airflow
Run Airflow in AWS ECS(Elastic Container Service) using Fargate tasks
Stars: ✭ 107 (-28.19%)
Mutual labels:  aws, terraform, hcl
Kubify
Terraform Template to Setup a Kubernetes Cluster on OpenStack/AWS/Azure
Stars: ✭ 142 (-4.7%)
Mutual labels:  aws, terraform, hcl
Terraform Aws Config
Enables AWS Config and adds managed config rules with good defaults.
Stars: ✭ 107 (-28.19%)
Mutual labels:  aws, terraform, hcl
Terraform Aws Vpc
Terraform Module that defines a VPC with public/private subnets across multiple AZs with Internet Gateways
Stars: ✭ 130 (-12.75%)
Mutual labels:  aws, terraform, hcl
Aws Minikube
Single node Kubernetes instance implemented using Terraform and kubeadm
Stars: ✭ 101 (-32.21%)
Mutual labels:  aws, terraform, hcl
Hybrid multicloud overlay
MutiCloud_Overlay demonstrates a use case of overlay over one or more clouds such as AWS, Azure, GCP, OCI, Alibaba and a vSphere private infrastructure in Hub and spoke topology, point to point topology and in a Single cloud. Overlay protocols IPv6 and IPv4 are independent of underlying infrastructure. This solution can be integrated with encryption and additional security features.
Stars: ✭ 127 (-14.77%)
Mutual labels:  aws, terraform, hcl
Terraform Aws Key Pair
Terraform Module to Automatically Generate SSH Key Pairs (Public/Private Keys)
Stars: ✭ 121 (-18.79%)
Mutual labels:  aws, terraform, hcl
Terraform Aws Labs
Terraform template for AWS provider ☁️
Stars: ✭ 146 (-2.01%)
Mutual labels:  aws, terraform, hcl
Vishwakarma
Terraform modules to create a self-hosting Kubernetes cluster on opinionated Cloud Platform.
Stars: ✭ 127 (-14.77%)
Mutual labels:  aws, terraform, hcl
Terraform Aws Dynamic Subnets
Terraform module for public and private subnets provisioning in existing VPC
Stars: ✭ 106 (-28.86%)
Mutual labels:  aws, terraform, hcl
Multi Env Deploy
Complete example of deploying complex web apps to AWS using Terraform, Ansible, and Packer
Stars: ✭ 132 (-11.41%)
Mutual labels:  aws, terraform, hcl
Typhoon
Minimal and free Kubernetes distribution with Terraform
Stars: ✭ 1,397 (+837.58%)
Mutual labels:  aws, terraform, hcl
Terraform Aws Kubernetes
Install a Kubernetes cluster the CoreOS Tectonic Way: HA, self-hosted, RBAC, etcd Operator, and more
Stars: ✭ 118 (-20.81%)
Mutual labels:  aws, terraform, hcl
Ecs Pipeline
☁️ 🐳 ⚡️ 🚀 Create environment and deployment pipelines to ECS Fargate with CodePipeline, CodeBuild and Github using Terraform
Stars: ✭ 85 (-42.95%)
Mutual labels:  aws, terraform, hcl
Terraform Aws Rabbitmq
Terraform configuration for creating RabbitMQ cluster on AWS.
Stars: ✭ 86 (-42.28%)
Mutual labels:  aws, terraform, hcl
Terraform
Terraform automation for Cloud
Stars: ✭ 121 (-18.79%)
Mutual labels:  aws, terraform, hcl
Reference Architectures
[WIP] Get up and running quickly with one of our reference architecture using our fully automated cold-start process.
Stars: ✭ 127 (-14.77%)
Mutual labels:  aws, terraform, hcl

multiregion-terraform

Example multi-region AWS Terraform application

TL;DR: launch ~56 EC2 instances in 18 regions with a single terraform command

Amazon has 18 data centers with ~56 availability zones spread around the world. This Terraform application launches EC2 instances in every possible zone, and ties them together into a single domain name that routes pings to the closest instance.

Features

  • Single main.tf with a module instance for each Amazon's 14 regions
  • Creates an EC2 instance in every region and availability zone
  • Creates two Route 53 records (A and AAAA) with latency based routing to all EC2 instances
  • All instances allow ICMP Echo Request (ping) from 0.0.0.0/0
  • Supports IPv4 and IPv6

Latency Map

Note the lower latency when the ping source is near to one of Amazon's datacenters: latency map

Terraform Dependency Graph

graph

How-to

Notes:

  • IMPORTANT: edit cdn/variables.tf and set r53_zone_id and r53_domain_name
  • requires Terraform >= v0.12
  • override the Amazon credential profile settings by setting AWS_PROFILE=blah
  • optionaly update blacklisted_az with any availibility zones that might not support the instances types you want
  • comment out regions in main.tf to test a smaller deployment
  • Terraform types used: aws_ami, aws_vpc, aws_internet_gateway, aws_subnet, aws_route_table, aws_route_table_association, aws_security_group, aws_instance, and aws_route53_record
$ terraform init
...

# replace 'personal' with the name of your AWS profile in ~/.aws/crendentials or leave blank for 'default'
$ AWS_PROFILE=personal terraform plan
module.cdn-us-east-1.data.aws_ami.default: Refreshing state...
module.cdn-us-west-1.data.aws_ami.default: Refreshing state...
...
Plan: 32 to add, 0 to change, 0 to destroy.

$ AWS_PROFILE=personal terraform apply
module.cdn-us-west-1.data.aws_ami.default: Refreshing state...
module.cdn-us-east-1.data.aws_ami.default: Refreshing state...
...
Apply complete! Resources: 32 added, 0 changed, 0 destroyed.

$ dig +short @8.8.8.8 cdn.jonathan.camp
52.207.230.71
52.90.73.117
52.91.127.142
54.198.56.163

$ dig +short @8.8.8.8 cdn.jonathan.camp AAAA
2a05:d01c:f93:2701:c9ab:9b4d:c81:9f05
2a05:d01c:f93:2700:604a:53ae:33b8:24c0

# print all servers using jq (https://stedolan.github.io/jq/)
$ jq -r '[.resources[].instances[] | select(.attributes.public_ip != null) | .attributes.public_ip] | .[]' terraform.tfstate
18.230.154.45
54.233.83.81
18.231.187.164
15.206.28.49
15.206.88.49
3.7.58.137
...
]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].