oci_core_network_security_group_security_rule

This resource provides the Network Security Group Security Rule resource in Oracle Cloud Infrastructure Core service.

Adds up to 25 security rules to the specified network security group. Adding more than 25 rules requires multiple operations.

Example Usage

resource "oci_core_network_security_group_security_rule" "test_network_security_group_security_rule" {
	#Required
	network_security_group_id = oci_core_network_security_group.test_network_security_group.id
    direction = var.network_security_group_security_rule_direction
    protocol = var.network_security_group_security_rule_protocol

    #Optional
    description = var.network_security_group_security_rule_description
    destination = var.network_security_group_security_rule_destination
    destination_type = var.network_security_group_security_rule_destination_type
    icmp_options {
        #Required
        type = var.network_security_group_security_rule_icmp_options_type

        #Optional
        code = var.network_security_group_security_rule_icmp_options_code
    }
    source = var.network_security_group_security_rule_source
    source_type = var.network_security_group_security_rule_source_type
    stateless = var.network_security_group_security_rule_stateless
    tcp_options {

        #Optional
        destination_port_range {
            #Required
            max = var.network_security_group_security_rule_tcp_options_destination_port_range_max
            min = var.network_security_group_security_rule_tcp_options_destination_port_range_min
        }
        source_port_range {
            #Required
            max = var.network_security_group_security_rule_tcp_options_source_port_range_max
            min = var.network_security_group_security_rule_tcp_options_source_port_range_min
        }
    }
    udp_options {

        #Optional
        destination_port_range {
            #Required
            max = var.network_security_group_security_rule_udp_options_destination_port_range_max
            min = var.network_security_group_security_rule_udp_options_destination_port_range_min
        }
        source_port_range {
            #Required
            max = var.network_security_group_security_rule_udp_options_source_port_range_max
            min = var.network_security_group_security_rule_udp_options_source_port_range_min
        }
    }
}

Argument Reference

The following arguments are supported:

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Network Security Group Security Rule * update - (Defaults to 20 minutes), when updating the Network Security Group Security Rule * delete - (Defaults to 20 minutes), when destroying the Network Security Group Security Rule

Import

NetworkSecurityGroupSecurityRule can be imported using the id, e.g.

$ terraform import oci_core_network_security_group_security_rule.test_network_security_group_security_rule "networkSecurityGroups/{networkSecurityGroupId}/securityRules/{securityRuleId}"