Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.Core.getNetworkSecurityGroupVnics
Explore with Pulumi AI
This data source provides the list of Network Security Group Vnics in Oracle Cloud Infrastructure Core service.
Lists the VNICs in the specified network security group.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testNetworkSecurityGroupVnics = oci.Core.getNetworkSecurityGroupVnics({
    networkSecurityGroupId: testNetworkSecurityGroup.id,
});
import pulumi
import pulumi_oci as oci
test_network_security_group_vnics = oci.Core.get_network_security_group_vnics(network_security_group_id=test_network_security_group["id"])
package main
import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := core.GetNetworkSecurityGroupVnics(ctx, &core.GetNetworkSecurityGroupVnicsArgs{
			NetworkSecurityGroupId: testNetworkSecurityGroup.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() => 
{
    var testNetworkSecurityGroupVnics = Oci.Core.GetNetworkSecurityGroupVnics.Invoke(new()
    {
        NetworkSecurityGroupId = testNetworkSecurityGroup.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.CoreFunctions;
import com.pulumi.oci.Core.inputs.GetNetworkSecurityGroupVnicsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var testNetworkSecurityGroupVnics = CoreFunctions.getNetworkSecurityGroupVnics(GetNetworkSecurityGroupVnicsArgs.builder()
            .networkSecurityGroupId(testNetworkSecurityGroup.id())
            .build());
    }
}
variables:
  testNetworkSecurityGroupVnics:
    fn::invoke:
      function: oci:Core:getNetworkSecurityGroupVnics
      arguments:
        networkSecurityGroupId: ${testNetworkSecurityGroup.id}
Using getNetworkSecurityGroupVnics
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 getNetworkSecurityGroupVnics(args: GetNetworkSecurityGroupVnicsArgs, opts?: InvokeOptions): Promise<GetNetworkSecurityGroupVnicsResult>
function getNetworkSecurityGroupVnicsOutput(args: GetNetworkSecurityGroupVnicsOutputArgs, opts?: InvokeOptions): Output<GetNetworkSecurityGroupVnicsResult>def get_network_security_group_vnics(filters: Optional[Sequence[GetNetworkSecurityGroupVnicsFilter]] = None,
                                     network_security_group_id: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetNetworkSecurityGroupVnicsResult
def get_network_security_group_vnics_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetNetworkSecurityGroupVnicsFilterArgs]]]] = None,
                                     network_security_group_id: Optional[pulumi.Input[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetNetworkSecurityGroupVnicsResult]func GetNetworkSecurityGroupVnics(ctx *Context, args *GetNetworkSecurityGroupVnicsArgs, opts ...InvokeOption) (*GetNetworkSecurityGroupVnicsResult, error)
func GetNetworkSecurityGroupVnicsOutput(ctx *Context, args *GetNetworkSecurityGroupVnicsOutputArgs, opts ...InvokeOption) GetNetworkSecurityGroupVnicsResultOutput> Note: This function is named GetNetworkSecurityGroupVnics in the Go SDK.
public static class GetNetworkSecurityGroupVnics 
{
    public static Task<GetNetworkSecurityGroupVnicsResult> InvokeAsync(GetNetworkSecurityGroupVnicsArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkSecurityGroupVnicsResult> Invoke(GetNetworkSecurityGroupVnicsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetNetworkSecurityGroupVnicsResult> getNetworkSecurityGroupVnics(GetNetworkSecurityGroupVnicsArgs args, InvokeOptions options)
public static Output<GetNetworkSecurityGroupVnicsResult> getNetworkSecurityGroupVnics(GetNetworkSecurityGroupVnicsArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Core/getNetworkSecurityGroupVnics:getNetworkSecurityGroupVnics
  arguments:
    # arguments dictionaryThe following arguments are supported:
- NetworkSecurity stringGroup Id 
- The OCID of the network security group.
- Filters
List<GetNetwork Security Group Vnics Filter> 
- NetworkSecurity stringGroup Id 
- The OCID of the network security group.
- Filters
[]GetNetwork Security Group Vnics Filter 
- networkSecurity StringGroup Id 
- The OCID of the network security group.
- filters
List<GetNetwork Security Group Vnics Filter> 
- networkSecurity stringGroup Id 
- The OCID of the network security group.
- filters
GetNetwork Security Group Vnics Filter[] 
- network_security_ strgroup_ id 
- The OCID of the network security group.
- filters
Sequence[GetNetwork Security Group Vnics Filter] 
- networkSecurity StringGroup Id 
- The OCID of the network security group.
- filters List<Property Map>
getNetworkSecurityGroupVnics Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- NetworkSecurity stringGroup Id 
- NetworkSecurity List<GetGroup Vnics Network Security Group Vnics Network Security Group Vnic> 
- The list of network_security_group_vnics.
- Filters
List<GetNetwork Security Group Vnics Filter> 
- Id string
- The provider-assigned unique ID for this managed resource.
- NetworkSecurity stringGroup Id 
- NetworkSecurity []GetGroup Vnics Network Security Group Vnics Network Security Group Vnic 
- The list of network_security_group_vnics.
- Filters
[]GetNetwork Security Group Vnics Filter 
- id String
- The provider-assigned unique ID for this managed resource.
- networkSecurity StringGroup Id 
- networkSecurity List<GetGroup Vnics Network Security Group Vnics Network Security Group Vnic> 
- The list of network_security_group_vnics.
- filters
List<GetNetwork Security Group Vnics Filter> 
- id string
- The provider-assigned unique ID for this managed resource.
- networkSecurity stringGroup Id 
- networkSecurity GetGroup Vnics Network Security Group Vnics Network Security Group Vnic[] 
- The list of network_security_group_vnics.
- filters
GetNetwork Security Group Vnics Filter[] 
- id str
- The provider-assigned unique ID for this managed resource.
- network_security_ strgroup_ id 
- network_security_ Sequence[Getgroup_ vnics Network Security Group Vnics Network Security Group Vnic] 
- The list of network_security_group_vnics.
- filters
Sequence[GetNetwork Security Group Vnics Filter] 
- id String
- The provider-assigned unique ID for this managed resource.
- networkSecurity StringGroup Id 
- networkSecurity List<Property Map>Group Vnics 
- The list of network_security_group_vnics.
- filters List<Property Map>
Supporting Types
GetNetworkSecurityGroupVnicsFilter     
GetNetworkSecurityGroupVnicsNetworkSecurityGroupVnic        
- ResourceId string
- The OCID of the parent resource that the VNIC is attached to (for example, a Compute instance).
- TimeAssociated string
- The date and time the VNIC was added to the network security group, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- VnicId string
- The OCID of the VNIC.
- ResourceId string
- The OCID of the parent resource that the VNIC is attached to (for example, a Compute instance).
- TimeAssociated string
- The date and time the VNIC was added to the network security group, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- VnicId string
- The OCID of the VNIC.
- resourceId String
- The OCID of the parent resource that the VNIC is attached to (for example, a Compute instance).
- timeAssociated String
- The date and time the VNIC was added to the network security group, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vnicId String
- The OCID of the VNIC.
- resourceId string
- The OCID of the parent resource that the VNIC is attached to (for example, a Compute instance).
- timeAssociated string
- The date and time the VNIC was added to the network security group, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vnicId string
- The OCID of the VNIC.
- resource_id str
- The OCID of the parent resource that the VNIC is attached to (for example, a Compute instance).
- time_associated str
- The date and time the VNIC was added to the network security group, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vnic_id str
- The OCID of the VNIC.
- resourceId String
- The OCID of the parent resource that the VNIC is attached to (for example, a Compute instance).
- timeAssociated String
- The date and time the VNIC was added to the network security group, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
- vnicId String
- The OCID of the VNIC.
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the ociTerraform Provider.