
Пример конфигурации Terraform, который создает 2 VPC в разных регионах (EU и US) и создает между ними связность.
variables.tf
//////////////// FIRST VPC /////////////////
variable "VPC_1_REGION" {
default = "us-east-1"
}
variable "VPC_1_NAME" {
default = "artem-terraform-US"
}
variable "VPC_1_KEY_INSTANCE" {
default = "artem.gatchenko"
}
variable "VPC_1_SUBNET" {
default = "192.168.1.0/24"
}
//////////////// SECOND VPC /////////////////
variable "VPC_2_REGION" {
default = "eu-west-2"
}
variable "VPC_2_NAME" {
default = "artem-terraform-EU"
}
variable "VPC_2_KEY_INSTANCE" {
default = "artem.gatchenko"
}
variable "VPC_2_SUBNET" {
default = "192.168.2.0/24"
}
///////////////// OTHER //////////////////////
variable "INSTANCE_TYPE" {
default = "t2.micro"
}
variable "AMI" {
type = "map"
default = {
eu-west-1 = "ami-f90a4880"
eu-west-2 = "ami-f976839e"
eu-west-3 = "ami-0e55e373"
us-east-1 = "ami-0ff8a91507f77f867"
us-west-1 = "ami-0bdb828fd58c52235"
eu-west-1 = "ami-047bb4163c506cd98"
ap-northeast-1 = "ami-06cd52961ce9f0d85"
ap-southeast-1 = "ami-08569b978cc4dfa10"
}
}

