Oracle Cloud Infrastructure
getNetworkSecurityGroups
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
using Pulumi;
using Oci = Pulumi.Oci;
class MyStack : Stack
{
public MyStack()
{
var testNetworkSecurityGroups = Output.Create(Oci.Core.GetNetworkSecurityGroups.InvokeAsync(new Oci.Core.GetNetworkSecurityGroupsArgs
{
CompartmentId = @var.Compartment_id,
DisplayName = @var.Network_security_group_display_name,
State = @var.Network_security_group_state,
VcnId = oci_core_vcn.Test_vcn.Id,
VlanId = oci_core_vlan.Test_vlan.Id,
}));
}
}
package main
import (
"github.com/pulumi/pulumi-oci/sdk/go/oci/Core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Core.GetNetworkSecurityGroups(ctx, &core.GetNetworkSecurityGroupsArgs{
CompartmentId: pulumi.StringRef(_var.Compartment_id),
DisplayName: pulumi.StringRef(_var.Network_security_group_display_name),
State: pulumi.StringRef(_var.Network_security_group_state),
VcnId: pulumi.StringRef(oci_core_vcn.Test_vcn.Id),
VlanId: pulumi.StringRef(oci_core_vlan.Test_vlan.Id),
}, nil)
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_oci as oci
test_network_security_groups = oci.Core.get_network_security_groups(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"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testNetworkSecurityGroups = oci.Core.getNetworkSecurityGroups({
compartmentId: _var.compartment_id,
displayName: _var.network_security_group_display_name,
state: _var.network_security_group_state,
vcnId: oci_core_vcn.test_vcn.id,
vlanId: oci_core_vlan.test_vlan.id,
});
Coming soon!
Using getNetworkSecurityGroups
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getNetworkSecurityGroups(args: GetNetworkSecurityGroupsArgs, opts?: InvokeOptions): Promise<GetNetworkSecurityGroupsResult>
function getNetworkSecurityGroupsOutput(args: GetNetworkSecurityGroupsOutputArgs, opts?: InvokeOptions): Output<GetNetworkSecurityGroupsResult>
def get_network_security_groups(compartment_id: Optional[str] = None,
display_name: Optional[str] = None,
filters: Optional[Sequence[_core.GetNetworkSecurityGroupsFilter]] = None,
state: Optional[str] = None,
vcn_id: Optional[str] = None,
vlan_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNetworkSecurityGroupsResult
def get_network_security_groups_output(compartment_id: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
filters: Optional[pulumi.Input[Sequence[pulumi.Input[_core.GetNetworkSecurityGroupsFilterArgs]]]] = None,
state: Optional[pulumi.Input[str]] = None,
vcn_id: Optional[pulumi.Input[str]] = None,
vlan_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNetworkSecurityGroupsResult]
func GetNetworkSecurityGroups(ctx *Context, args *GetNetworkSecurityGroupsArgs, opts ...InvokeOption) (*GetNetworkSecurityGroupsResult, error)
func GetNetworkSecurityGroupsOutput(ctx *Context, args *GetNetworkSecurityGroupsOutputArgs, opts ...InvokeOption) GetNetworkSecurityGroupsResultOutput
> Note: This function is named GetNetworkSecurityGroups
in the Go SDK.
public static class GetNetworkSecurityGroups
{
public static Task<GetNetworkSecurityGroupsResult> InvokeAsync(GetNetworkSecurityGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetNetworkSecurityGroupsResult> Invoke(GetNetworkSecurityGroupsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNetworkSecurityGroupsResult> getNetworkSecurityGroups(GetNetworkSecurityGroupsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: oci:Core/getNetworkSecurityGroups:getNetworkSecurityGroups
Arguments:
# Arguments dictionary
The following arguments are supported:
- Compartment
Id string The OCID of the compartment.
- Display
Name string A filter to return only resources that match the given display name exactly.
- Filters
List<Get
Network Security Groups Filter> - State string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- Vcn
Id string The OCID of the VCN.
- Vlan
Id string The OCID of the VLAN.
- Compartment
Id string The OCID of the compartment.
- Display
Name string A filter to return only resources that match the given display name exactly.
- Filters
[]Get
Network Security Groups Filter - State string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- Vcn
Id string The OCID of the VCN.
- Vlan
Id string The OCID of the VLAN.
- compartment
Id String The OCID of the compartment.
- display
Name String A filter to return only resources that match the given display name exactly.
- filters
List<Get
Network Security Groups Filter> - state String
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- vcn
Id String The OCID of the VCN.
- vlan
Id String The OCID of the VLAN.
- compartment
Id string The OCID of the compartment.
- display
Name string A filter to return only resources that match the given display name exactly.
- filters
Get
Network Security Groups Filter[] - state string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- vcn
Id string The OCID of the VCN.
- vlan
Id string The OCID of the VLAN.
- compartment_
id str The OCID of the compartment.
- display_
name str A filter to return only resources that match the given display name exactly.
- filters
Get
Network Security Groups Filter] - state str
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- vcn_
id str The OCID of the VCN.
- vlan_
id str The OCID of the VLAN.
- compartment
Id String The OCID of the compartment.
- display
Name String A filter to return only resources that match the given display name exactly.
- filters List<Property Map>
- state String
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- vcn
Id String The OCID of the VCN.
- vlan
Id String The OCID of the VLAN.
getNetworkSecurityGroups Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Network
Security List<GetGroups Network Security Groups Network Security Group> The list of network_security_groups.
- Compartment
Id string The OCID of the compartment the network security group is in.
- Display
Name string A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Filters
List<Get
Network Security Groups Filter> - State string
The network security group's current state.
- Vcn
Id string The OCID of the network security group's VCN.
- Vlan
Id string
- Id string
The provider-assigned unique ID for this managed resource.
- Network
Security []GetGroups Network Security Groups Network Security Group The list of network_security_groups.
- Compartment
Id string The OCID of the compartment the network security group is in.
- Display
Name string A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Filters
[]Get
Network Security Groups Filter - State string
The network security group's current state.
- Vcn
Id string The OCID of the network security group's VCN.
- Vlan
Id string
- id String
The provider-assigned unique ID for this managed resource.
- network
Security List<GetGroups Network Security Groups Network Security Group> The list of network_security_groups.
- compartment
Id String The OCID of the compartment the network security group is in.
- display
Name String A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
List<Get
Network Security Groups Filter> - state String
The network security group's current state.
- vcn
Id String The OCID of the network security group's VCN.
- vlan
Id String
- id string
The provider-assigned unique ID for this managed resource.
- network
Security GetGroups Network Security Groups Network Security Group[] The list of network_security_groups.
- compartment
Id string The OCID of the compartment the network security group is in.
- display
Name string A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
Get
Network Security Groups Filter[] - state string
The network security group's current state.
- vcn
Id string The OCID of the network security group's VCN.
- vlan
Id string
- id str
The provider-assigned unique ID for this managed resource.
- network_
security_ Getgroups Network Security Groups Network Security Group] The list of network_security_groups.
- compartment_
id str The OCID of the compartment the network security group is in.
- display_
name str A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
Get
Network Security Groups Filter] - state str
The network security group's current state.
- vcn_
id str The OCID of the network security group's VCN.
- vlan_
id str
- id String
The provider-assigned unique ID for this managed resource.
- network
Security List<Property Map>Groups The list of network_security_groups.
- compartment
Id String The OCID of the compartment the network security group is in.
- display
Name String A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters List<Property Map>
- state String
The network security group's current state.
- vcn
Id String The OCID of the network security group's VCN.
- vlan
Id String
Supporting Types
GetNetworkSecurityGroupsFilter
GetNetworkSecurityGroupsNetworkSecurityGroup
- Compartment
Id string The OCID of the compartment.
- Dictionary<string, object>
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 string A filter to return only resources that match the given display name exactly.
- Dictionary<string, object>
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 string
The OCID of the network security group.
- State string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- Time
Created string 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 string The OCID of the VCN.
- Compartment
Id string The OCID of the compartment.
- map[string]interface{}
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 string A filter to return only resources that match the given display name exactly.
- map[string]interface{}
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 string
The OCID of the network security group.
- State string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- Time
Created string 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 string The OCID of the VCN.
- compartment
Id String The OCID of the compartment.
- Map<String,Object>
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 String A filter to return only resources that match the given display name exactly.
- Map<String,Object>
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 String
The OCID of the network security group.
- state String
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- time
Created String 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 String The OCID of the VCN.
- compartment
Id string The OCID of the compartment.
- {[key: string]: any}
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 string A filter to return only resources that match the given display name exactly.
- {[key: string]: any}
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 string
The OCID of the network security group.
- state string
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- time
Created string 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 string The OCID of the VCN.
- compartment_
id str The OCID of the compartment.
- Mapping[str, Any]
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 str A filter to return only resources that match the given display name exactly.
- Mapping[str, Any]
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 str
The OCID of the network security group.
- state str
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- time_
created str 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 str The OCID of the VCN.
- compartment
Id String The OCID of the compartment.
- Map<Any>
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 String A filter to return only resources that match the given display name exactly.
- Map<Any>
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 String
The OCID of the network security group.
- state String
A filter to return only resources that match the specified lifecycle state. The value is case insensitive.
- time
Created String 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 String The OCID of the VCN.
Package Details
- Repository
- https://github.com/pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
oci
Terraform Provider.