Created
September 15, 2020 11:24
-
-
Save arnaudmorin/236ee5c1794d5cca5179334483daa916 to your computer and use it in GitHub Desktop.
terraform multiple regions at once
This file contains hidden or 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
# Configure the OpenStack Provider | |
# It will read info from env OS_xxx | |
provider "openstack" { | |
} | |
# | |
# BACKENDS | |
# | |
# Create one server per region | |
resource "openstack_compute_instance_v2" "servers" { | |
name = "${format("server-%s", element(var.regions, count.index))}" | |
count = "${length(var.regions)}" | |
region = "${element(var.regions, count.index)}" | |
image_name = "Debian 10" | |
flavor_name = "c2-7" | |
network { name = "Ext-Net" } | |
} |
This file contains hidden or 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
variable "regions" { | |
default = [ | |
"UK1", | |
"SGP1" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment