Skip to content

cloud-labs-infra/terraform-huaweicloud-vpc

Repository files navigation

Huawei Cloud VPC

Requirements

Name Version
terraform ~> 1.7
huaweicloud ~>1.63

Providers

Name Version
huaweicloud ~>1.63

Modules

No modules.

Resources

Name Type
huaweicloud_nat_gateway.main resource
huaweicloud_nat_snat_rule.private resource
huaweicloud_nat_snat_rule.public resource
huaweicloud_network_acl.private resource
huaweicloud_network_acl.public resource
huaweicloud_network_acl_rule.private_inbound resource
huaweicloud_network_acl_rule.private_inbound_default resource
huaweicloud_network_acl_rule.private_outbound resource
huaweicloud_network_acl_rule.private_outbound_default resource
huaweicloud_network_acl_rule.public_inbound resource
huaweicloud_network_acl_rule.public_outbound resource
huaweicloud_vpc.main resource
huaweicloud_vpc_subnet.private resource
huaweicloud_vpc_subnet.public resource
huaweicloud_availability_zones.zones data source

Inputs

Name Description Type Default Required
allow_internal_traffic Allow all traffic from public to private subnets bool true no
availability_zones Specify the Availability Zone in the Region in in which to create the subnets, if omitted, AZ calculates automatically list(string) [] no
cidr Specifies the range of available subnets in the VPC string n/a yes
description Specifies supplementary information about the VPC string null no
dhcp_enable Specifies whether the DHCP function is enabled for the subnets bool true no
dns_list Specifies the DNS server address list of the subnets, it is required if you need to use more than two DNS servers list(string) null no
ipv6_enable Specifies whether the IPv6 function is enabled for the subnet bool false no
name Specifies the name of the VPC string n/a yes
nat_snat_floating_ip_ids Specifies the IDs of floating IPs connected by SNAT rule list(string) n/a yes
nat_spec Specifies the specification of the NAT gateway string "1" no
network_acl_rule_private n/a
map(object({
type = string # inbound or outbound
enabled = optional(bool, true) # Enabled status for the network ACL rule
protocol = optional(string, "any") # Valid values are: tcp, udp, icmp and any.
action = string # Currently, the value can be allow or deny.
ip_version = optional(number, 4) # Specifies the IP version - 4 or 6
source_ip_address = string # Specifies the source IP address that the traffic is allowed from
source_port = string # Specifies the destination port number or port number range
destination_ip_address = string # Specifies the destination IP address to which the traffic is allowed
destination_port = string # Specifies the destination port number or port number range.
}))
{} no
network_acl_rule_public n/a
map(object({
type = string # inbound or outbound
enabled = optional(bool, true) # Enabled status for the network ACL rule
protocol = optional(string, "any") # Valid values are: tcp, udp, icmp and any.
action = string # Currently, the value can be allow or deny.
ip_version = optional(number, 4) # Specifies the IP version - 4 or 6
source_ip_address = string # Specifies the source IP address that the traffic is allowed from
source_port = string # Specifies the destination port number or port number range
destination_ip_address = string # Specifies the destination IP address to which the traffic is allowed
destination_port = string # Specifies the destination port number or port number range.
}))
{
"allow_all_in": {
"action": "allow",
"destination_ip_address": "0.0.0.0/0",
"destination_port": null,
"enabled": true,
"ip_version": 4,
"protocol": "any",
"source_ip_address": "0.0.0.0/0",
"source_port": null,
"type": "inbound"
},
"allow_all_out": {
"action": "allow",
"destination_ip_address": "0.0.0.0/0",
"destination_port": null,
"enabled": true,
"ip_version": 4,
"protocol": "any",
"source_ip_address": "0.0.0.0/0",
"source_port": null,
"type": "outbound"
}
}
no
primary_dns Specifies the IP address of DNS server 1 on the subnets string null no
private_to_internet Enable access to the Internet from private subnets bool false no
region Specifies the region in which to create the resource, if omitted, the provider-level region will be used string null no
secondary_cidr Specifies the secondary CIDR block of the VPC string null no
secondary_dns Specifies the IP address of DNS server 2 on the subnets string null no
subnets n/a
object({
private = list(string)
public = list(string)
})
n/a yes
tags Specifies the key/value pairs to associate with the VPC map(string) {} no

Outputs

Name Description
private_subnets_cidrs List of CIDRs of Private Subnets
private_subnets_ids List of IDs of Private Subnets in UUID format
private_subnets_subnet_ids List of IDs of the IPv4 subnet (Native OpenStack API)
public_subnets_cidrs List of CIDRs of Public Subnets
public_subnets_ids List of IDs of Public Subnets in UUID format
public_subnets_subnet_ids List of IDs of the IPv4 subnet (Native OpenStack API)
vpc_cidr The CIDR of the VPC
vpc_id The VPC ID in UUID format
vpc_status The current status of the VPC