oci_core_security_list

This resource provides the Security List resource in Oracle Cloud Infrastructure Core service.

Creates a new security list for the specified VCN. For more information about security lists, see Security Lists. For information on the number of rules you can have in a security list, see Service Limits.

For the purposes of access control, you must provide the OCID of the compartment where you want the security list to reside. Notice that the security list doesn’t have to be in the same compartment as the VCN, subnets, or other Networking Service components. If you’re not sure which compartment to use, put the security list in the same compartment as the VCN. For more information about compartments and access control, see Overview of the IAM Service. For information about OCIDs, see Resource Identifiers.

You may optionally specify a display name for the security list, otherwise a default is provided. It does not have to be unique, and you can change it. Avoid entering confidential information.

For more information on configuring a VCN’s default security list, see Managing Default VCN Resources

Example Usage

resource "oci_core_security_list" "test_security_list" {
	#Required
	compartment_id = var.compartment_id
	vcn_id = oci_core_vcn.test_vcn.id

	#Optional
	defined_tags = {"Operations.CostCenter"= "42"}
	display_name = var.security_list_display_name
	egress_security_rules {
		#Required
		destination = var.security_list_egress_security_rules_destination
		protocol = var.security_list_egress_security_rules_protocol

		#Optional
		description = var.security_list_egress_security_rules_description
		destination_type = var.security_list_egress_security_rules_destination_type
		icmp_options {
			#Required
			type = var.security_list_egress_security_rules_icmp_options_type

			#Optional
			code = var.security_list_egress_security_rules_icmp_options_code
		}
		stateless = var.security_list_egress_security_rules_stateless
		tcp_options {

			#Optional
			max = var.security_list_egress_security_rules_tcp_options_destination_port_range_max
			min = var.security_list_egress_security_rules_tcp_options_destination_port_range_min
			source_port_range {
				#Required
				max = var.security_list_egress_security_rules_tcp_options_source_port_range_max
				min = var.security_list_egress_security_rules_tcp_options_source_port_range_min
			}
		}
		udp_options {

			#Optional
			max = var.security_list_egress_security_rules_udp_options_destination_port_range_max
			min = var.security_list_egress_security_rules_udp_options_destination_port_range_min
			source_port_range {
				#Required
				max = var.security_list_egress_security_rules_udp_options_source_port_range_max
				min = var.security_list_egress_security_rules_udp_options_source_port_range_min
			}
		}
	}
	freeform_tags = {"Department"= "Finance"}
	ingress_security_rules {
		#Required
		protocol = var.security_list_ingress_security_rules_protocol
		source = var.security_list_ingress_security_rules_source

		#Optional
		description = var.security_list_ingress_security_rules_description
		icmp_options {
			#Required
			type = var.security_list_ingress_security_rules_icmp_options_type

			#Optional
			code = var.security_list_ingress_security_rules_icmp_options_code
		}
		source_type = var.security_list_ingress_security_rules_source_type
		stateless = var.security_list_ingress_security_rules_stateless
		tcp_options {

			#Optional
			max = var.security_list_ingress_security_rules_tcp_options_destination_port_range_max
			min = var.security_list_ingress_security_rules_tcp_options_destination_port_range_min
			source_port_range {
				#Required
				max = var.security_list_ingress_security_rules_tcp_options_source_port_range_max
				min = var.security_list_ingress_security_rules_tcp_options_source_port_range_min
			}
		}
		udp_options {

			#Optional
			max = var.security_list_ingress_security_rules_udp_options_destination_port_range_max
			min = var.security_list_ingress_security_rules_udp_options_destination_port_range_min
			source_port_range {
				#Required
				max = var.security_list_ingress_security_rules_udp_options_source_port_range_max
				min = var.security_list_ingress_security_rules_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 Security List * update - (Defaults to 20 minutes), when updating the Security List * delete - (Defaults to 20 minutes), when destroying the Security List

Import

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

$ terraform import oci_core_security_list.test_security_list "id"