Skip to content

terraform-opentelekomcloud-modules/terraform-opentelekomcloud-vpc

Repository files navigation

OpenTelekomCloud VPC Terraform module

Terraform module which creates VPC resources on OpenTelekomCloud.

These types of resources are supported:

Terraform versions

Terraform 0.12 and newer.

Usage

module "vpc" {
  source = "terraform-opentelekomcloud-modules/vpc/opentelekomcloud"

  prefix = "infra"
  cidr = "10.0.0.0/16"

  availability_zone = "eu-de-01"

  vpc_cidr          = "10.0.0.0/24"
  subnet_cidr       = "10.0.0.0/24"
  gateway_ip        = "10.0.0.1"
  ntp_addresses     = ["10.100.0.33", "10.100.0.34"]

  dhcp_enable = true
  snat_enable = true

  tags = {
    infra = "vpc"
    muh = "dev"
  }
}

Examples

Requirements

Name Version
terraform >= 0.12.21
opentelekomcloud >= 1.23.9

Modules

No modules.

Resources

Name Type
opentelekomcloud_vpc_v1.this resource
opentelekomcloud_vpc_subnet_v1.this resource

Inputs

Name Description Type Default Required
prefix Prefix for basic network infra. string "default" no
tags The key/value pairs to associate with the VPC and Subnet map(string) {} no
snat_enable SNAT should be used or not bool false no
vpc_cidr IP range for the VPC string null yes
subnet_cidr IP range for the subnet string null yes
gateway_ip The gateway of the subnet string null yes
dns_nameservers An array of DNS name servers used by hosts in the subnet list(string)
[
"100.125.4.25",
"8.8.8.8"
]
no
ntp_addresses An array of NTP server addresses configured for the subnet list(string)
[
"10.100.0.33",
"10.100.0.34"
]
no
availability_zone The availability zone (AZ) to which the subnet belongs string "eu-de-01" no
dhcp_enable DHCP function is enabled for the subnet bool null no

Outputs

Name Description
vpc_id The ID of the VPC
vpc_name The Name of the VPC
vpc_cidr_block The CIDR block of the VPC
vpc_enable_snat The SNAT function is enabled in the VPC
subnet_id The ID of the Subnet
network_id The ID of the Network
subnet_name The Name of the Subnet
subnet_cidr_block The CIDR block of the Subnet
subnet_dns The DNS name servers of the Subnet

Authors

Module managed by Rodion Gyrbu.

License

Apache 2 Licensed. See LICENSE for full details.