Skip to content

cloud-labs-infra/terraform-huaweicloud-security-group

Repository files navigation

Huawei Cloud Security Group

Requirements

Name Version
terraform ~> 1.7
huaweicloud ~> 1.63

Providers

Name Version
huaweicloud ~> 1.63

Modules

No modules.

Resources

Name Type
huaweicloud_networking_secgroup.main resource
huaweicloud_networking_secgroup_rule.allow_self_inbound resource
huaweicloud_networking_secgroup_rule.allow_self_outbound resource
huaweicloud_networking_secgroup_rule.default_deny_inbound resource
huaweicloud_networking_secgroup_rule.default_deny_outbound resource
huaweicloud_networking_secgroup_rule.rules resource

Inputs

Name Description Type Default Required
allow_self_connection Add self connection rule bool true no
default_deny_inbound Add Rule to deny ingress from 0.0.0.0/0 by default with lowest priority bool true no
default_deny_outbound Add Rule to deny egress to 0.0.0.0/0 by default with lowest priority bool false no
delete_default_rules Specifies whether or not to delete the default security rules bool true no
description Specifies the description for the security group string null no
name Specifies the name of the Networking Security Group string n/a yes
name_postfix Name Postfix for Networking Security Group string null no
region Specifies the region in which to create the resource, if omitted, the provider-level region will be used string null no
rules Networking Security Group rules:

* 'direction' specifies the direction of the rule, valid values are ingress or egress;
* 'ethertype' specifies the layer 3 protocol type, valid values are IPv4 or IPv6;
* 'protocol' valid values are tcp, udp, icmp and icmpv6;
* 'ports' specifies the allowed port value range, which supports single port (80), continuous port (1-30) and discontinous port (22, 3389, 80);
* 'action' specifies the effective policy, the valid values are allow and deny;
* 'priority' Specifies the priority number, the valid value is range from 1 to 100.

* 'remote_ip_prefix' specifies the remote CIDR;
OR
* 'remote_group_id' specifies the remote address Security Group ID;
OR
* 'remote_address_group_id' specifies the remote Address Group ID;
map(object({
direction = string
ethertype = optional(string, "IPv4")
protocol = optional(string, null)
ports = optional(string, null)
action = optional(string, "allow")
priority = optional(number, null)
remote_ip_prefix = optional(string, null)
remote_group_id = optional(string, null)
remote_address_group_id = optional(string, null)
}))
n/a yes

Outputs

Name Description
id The resource ID in UUID format
rules The array of security group rules associating with the security group