Oracle Cloud Infrastructure

Pulumi Official
Package maintained by Pulumi
v0.1.1 published on Tuesday, May 3, 2022 by Pulumi

getNetworkSecurityGroup

This data source provides details about a specific Network Security Group resource in Oracle Cloud Infrastructure Core service.

Gets the specified network security group’s information.

To list the VNICs in an NSG, see ListNetworkSecurityGroupVnics.

To list the security rules in an NSG, see ListNetworkSecurityGroupSecurityRules.

Example Usage

using Pulumi;
using Oci = Pulumi.Oci;

class MyStack : Stack
{
    public MyStack()
    {
        var testNetworkSecurityGroup = Output.Create(Oci.Core.GetNetworkSecurityGroup.InvokeAsync(new Oci.Core.GetNetworkSecurityGroupArgs
        {
            NetworkSecurityGroupId = oci_core_network_security_group.Test_network_security_group.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.GetNetworkSecurityGroup(ctx, &core.GetNetworkSecurityGroupArgs{
			NetworkSecurityGroupId: oci_core_network_security_group.Test_network_security_group.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_oci as oci

test_network_security_group = oci.Core.get_network_security_group(network_security_group_id=oci_core_network_security_group["test_network_security_group"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testNetworkSecurityGroup = oci.Core.getNetworkSecurityGroup({
    networkSecurityGroupId: oci_core_network_security_group.test_network_security_group.id,
});

Coming soon!

Using getNetworkSecurityGroup

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 getNetworkSecurityGroup(args: GetNetworkSecurityGroupArgs, opts?: InvokeOptions): Promise<GetNetworkSecurityGroupResult>
function getNetworkSecurityGroupOutput(args: GetNetworkSecurityGroupOutputArgs, opts?: InvokeOptions): Output<GetNetworkSecurityGroupResult>
def get_network_security_group(network_security_group_id: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetNetworkSecurityGroupResult
def get_network_security_group_output(network_security_group_id: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetNetworkSecurityGroupResult]
func GetNetworkSecurityGroup(ctx *Context, args *GetNetworkSecurityGroupArgs, opts ...InvokeOption) (*GetNetworkSecurityGroupResult, error)
func GetNetworkSecurityGroupOutput(ctx *Context, args *GetNetworkSecurityGroupOutputArgs, opts ...InvokeOption) GetNetworkSecurityGroupResultOutput

> Note: This function is named GetNetworkSecurityGroup in the Go SDK.

public static class GetNetworkSecurityGroup 
{
    public static Task<GetNetworkSecurityGroupResult> InvokeAsync(GetNetworkSecurityGroupArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkSecurityGroupResult> Invoke(GetNetworkSecurityGroupInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNetworkSecurityGroupResult> getNetworkSecurityGroup(GetNetworkSecurityGroupArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: oci:Core/getNetworkSecurityGroup:getNetworkSecurityGroup
  Arguments:
    # Arguments dictionary

The following arguments are supported:

NetworkSecurityGroupId string

The OCID of the network security group.

NetworkSecurityGroupId string

The OCID of the network security group.

networkSecurityGroupId String

The OCID of the network security group.

networkSecurityGroupId string

The OCID of the network security group.

network_security_group_id str

The OCID of the network security group.

networkSecurityGroupId String

The OCID of the network security group.

getNetworkSecurityGroup Result

The following output properties are available:

CompartmentId string

The OCID of the compartment the network security group is in.

DefinedTags 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"}

DisplayName string

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

FreeformTags 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.

NetworkSecurityGroupId string
State string

The network security group's current state.

TimeCreated string

The date and time the network security group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

VcnId string

The OCID of the network security group's VCN.

CompartmentId string

The OCID of the compartment the network security group is in.

DefinedTags 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"}

DisplayName string

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

FreeformTags 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.

NetworkSecurityGroupId string
State string

The network security group's current state.

TimeCreated string

The date and time the network security group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

VcnId string

The OCID of the network security group's VCN.

compartmentId String

The OCID of the compartment the network security group is in.

definedTags 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"}

displayName String

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

freeformTags 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.

networkSecurityGroupId String
state String

The network security group's current state.

timeCreated String

The date and time the network security group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

vcnId String

The OCID of the network security group's VCN.

compartmentId string

The OCID of the compartment the network security group is in.

definedTags {[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"}

displayName string

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

freeformTags {[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.

networkSecurityGroupId string
state string

The network security group's current state.

timeCreated string

The date and time the network security group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

vcnId string

The OCID of the network security group's VCN.

compartment_id str

The OCID of the compartment the network security group is in.

defined_tags 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 user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

freeform_tags 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.

network_security_group_id str
state str

The network security group's current state.

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 network security group's VCN.

compartmentId String

The OCID of the compartment the network security group is in.

definedTags 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"}

displayName String

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

freeformTags 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.

networkSecurityGroupId String
state String

The network security group's current state.

timeCreated String

The date and time the network security group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

vcnId String

The OCID of the network security group's 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.