alen-z / relay-monkey-terraform

Quick Terraform deployment of instances in all regions and zones of multiple clouds

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repository is part of Relay Monkey project.

About

Terraform templates for provisioning instances in multiple cloud providers, covering majority of regions and zones with minimal configuration.

Usage

Important: Edit variables.demo.tf file for this to work. Provision instances:

terraform init
terraform apply -parallelism=8

After the run is over, export to Jinja accessible directory. Jinja repository for converting output to Ansible inventory is available as part of my profile.

terraform output -json > ../jinja2/public_ips.json

Remove all resources:

terraform destroy -parallelism=8

Supported clouds

  • Alibaba Cloud
  • Amazon Web Services (AWS)
  • DigitalOcean
  • Google Cloud Platform (GCP)
  • Hetzner
  • Linode
  • Microsoft Azure

Kudos / Proper respect

  • DigitalOcean for ease of use.
  • Hetzner for ease of use and fast Terraform run speed.
  • Alibaba fast Terraform run speed when APIs are working as expected.
  • GCP offers one view for all regions. Large benefit in comparison to AWS.

Terraform Provider issues

  • Alibaba SDK is sometimes slow and sometimes breaks, e.g. fetching available VM images.
  • Alibaba needs your drivers licence or passport to register with their cloud.
  • Google requests changing default CPU quota: Error waiting for instance to create: Quota 'CPUS_ALL_REGIONS' exceeded. Limit: 32.0 globally..
  • Google API sometimes breaks while creating 60+ instances: Error: Error loading zone 'europe-west4-b': Get https://www.googleapis.com/compute/v1/projects/global-latency/zones/europe-west4-b?alt=json&prettyPrint=false: dial tcp 172.217.19.106:443: connect: no route to host or not enough resources Error: Error waiting for instance to create: The zone 'projects/global-latency/zones/australia-southeast1-c' does not have enough resources available to fulfill the request. Try a different zone, or try again later.. As a result, only part of Terraform run is successful and it exits with error.
  • Terraform needs to run twice to produce output after GCP provisioning fails with Error waiting for instance to create: The zone 'projects/global-latency/zones/asia-south1-c' does not have enough resources available to fulfill the request. Try a different zone, or try again later.. Raise an issue on GitHub?
  • Linode should start accepting multi-line access SSH keys.
  • Azure is making difficult to deploy to all regions listed with az account list-locations -o table.
  • Some Chinese regions are throttling github.com heavily.

References

About

Quick Terraform deployment of instances in all regions and zones of multiple clouds

License:GNU General Public License v3.0


Languages

Language:HCL 100.0%