Data Source: oci_core_network_security_groups
This data source provides the list of Network Security Groups in Oracle Cloud Infrastructure Core service.
Lists either the network security groups in the specified compartment, or those associated with the specified VLAN.
You must specify either a vlanId
or a compartmentId
, but not both. If you specify a vlanId
, all other parameters are ignored.
Example Usage
data "oci_core_network_security_groups" "test_network_security_groups" {
#Optional
compartment_id = var.compartment_id
display_name = var.network_security_group_display_name
state = var.network_security_group_state
vcn_id = oci_core_vcn.test_vcn.id
vlan_id = oci_core_vlan.test_vlan.id
}
Argument Reference
The following arguments are supported:
compartment_id
- (Optional) The OCID of the compartment.display_name
- (Optional) A filter to return only resources that match the given display name exactly.state
- (Optional) A filter to return only resources that match the specified lifecycle state. The value is case insensitive.vcn_id
- (Optional) The OCID of the VCN.vlan_id
- (Optional) The OCID of the VLAN.
Attributes Reference
The following attributes are exported:
network_security_groups
- The list of network_security_groups.
NetworkSecurityGroup Reference
The following attributes are exported:
compartment_id
- The OCID of the compartment the network security group is in.defined_tags
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:{"Operations.CostCenter": "42"}
display_name
- A user-friendly name. Does not have to be unique, and it’s changeable. Avoid entering confidential information.freeform_tags
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:{"Department": "Finance"}
id
- The OCID of the network security group.state
- The network security group’s current state.time_created
- The date and time the network security group was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
vcn_id
- The OCID of the network security group’s VCN.