dgibbs64 / terraform-linode-cloudflare

Using Terraform, this configuration will allow you to spin up multiple Linode instances, create Cloudflare A records for the Linode instances and apply rDNS to the Linode instances.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terraform Linode Cloudflare

terraform-linode-cloudflare

Description

Using Terraform, this configuration will allow you to spin up multiple Linode instances, create Cloudflare A records for the Linode instances and apply rDNS to the Linode instances.

Requirements

Authentication

Multiple tokens will be required to authenticate terraform with Linode and Cloudflare.

note: This example uses SSH keys only. To use root password uncomment in main.tf, variables.tf and terraform.tvars.

Single Linode Instance

This example terraform.tfvars will deploy a single Linode instance.

server_name = "ubuntu20.04"
#root_pass = ""
authorized_keys = "ecdsa-sha2-nistp256 AAAAE2...rTucc= dgibbs@home"
linode_token = "--- Linode API Token ---"
linode_image = "linode/ubuntu20.04"
linode_region = "eu-west"
linode_type = "g6-nanode-1"
linode_tags = [ "Tag 1", "Tag 2" ]
cloudflare_token = "--- Cloudflare API Token ---"
cloudflare_zone_id = "--- Cloudflare Zone ID ---"

Multiple Linode Instance

This example terraform.tfvars will deploy multiple Linode instances.

This example will create 5 Linode instances using difference distro images. It does this by using arrays and will loop though eachserver_name. It is also possible using the same arrays to specify different regions and types by adding [count.index] in main.tf.

server_name = [ "ubuntu20.04", "ubuntu18.04", "debian11", "almalinux8", "centos7" ]
#root_pass = ""
authorized_keys = "ecdsa-sha2-nistp256 AAAAE2...rTucc= dgibbs@home"
linode_token = "--- Linode API Token ---"
linode_image = [ "linode/ubuntu20.04", "linode/ubuntu18.04", "linode/debian11", "linode/almalinux8", "linode/centos7" ]
linode_region = "eu-west"
linode_type = "g6-nanode-1"
linode_tags = [ "Tag 1", "Tag 2" ]
cloudflare_token = "--- Cloudflare API Token ---"
cloudflare_zone_id = "--- Cloudflare Zone ID ---"

About

Using Terraform, this configuration will allow you to spin up multiple Linode instances, create Cloudflare A records for the Linode instances and apply rDNS to the Linode instances.


Languages

Language:HCL 100.0%