1. Packages
  2. Packages
  3. Ibm Provider
  4. API Docs
  5. getContainerVniAttachments
Viewing docs for ibm 2.4.0
published on Wednesday, Jul 1, 2026 by ibm-cloud
Viewing docs for ibm 2.4.0
published on Wednesday, Jul 1, 2026 by ibm-cloud

    Retrieve a list of Virtual Network Interface (VNI) attachments for a cluster or a specific worker node in a Red Hat OpenShift on IBM Cloud cluster. This feature is currently supported for OpenShift clusters only.

    Example Usage

    List all VNI attachments for a cluster

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const clusterAttachments = ibm.getContainerVniAttachments({
        cluster: "mycluster",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    cluster_attachments = ibm.get_container_vni_attachments(cluster="mycluster")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/v2/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.GetContainerVniAttachments(ctx, &ibm.GetContainerVniAttachmentsArgs{
    			Cluster: pulumi.StringRef("mycluster"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var clusterAttachments = Ibm.GetContainerVniAttachments.Invoke(new()
        {
            Cluster = "mycluster",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetContainerVniAttachmentsArgs;
    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 clusterAttachments = IbmFunctions.getContainerVniAttachments(GetContainerVniAttachmentsArgs.builder()
                .cluster("mycluster")
                .build());
    
        }
    }
    
    variables:
      clusterAttachments:
        fn::invoke:
          function: ibm:getContainerVniAttachments
          arguments:
            cluster: mycluster
    
    Example coming soon!
    

    List all VNI attachments for a specific worker

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const workerAttachments = ibm.getContainerVniAttachments({
        worker: "kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    worker_attachments = ibm.get_container_vni_attachments(worker="kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/v2/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.GetContainerVniAttachments(ctx, &ibm.GetContainerVniAttachmentsArgs{
    			Worker: pulumi.StringRef("kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var workerAttachments = Ibm.GetContainerVniAttachments.Invoke(new()
        {
            Worker = "kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetContainerVniAttachmentsArgs;
    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 workerAttachments = IbmFunctions.getContainerVniAttachments(GetContainerVniAttachmentsArgs.builder()
                .worker("kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001")
                .build());
    
        }
    }
    
    variables:
      workerAttachments:
        fn::invoke:
          function: ibm:getContainerVniAttachments
          arguments:
            worker: kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001
    
    Example coming soon!
    

    Using getContainerVniAttachments

    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 getContainerVniAttachments(args: GetContainerVniAttachmentsArgs, opts?: InvokeOptions): Promise<GetContainerVniAttachmentsResult>
    function getContainerVniAttachmentsOutput(args: GetContainerVniAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetContainerVniAttachmentsResult>
    def get_container_vni_attachments(cluster: Optional[str] = None,
                                      id: Optional[str] = None,
                                      resource_group_id: Optional[str] = None,
                                      worker: Optional[str] = None,
                                      opts: Optional[InvokeOptions] = None) -> GetContainerVniAttachmentsResult
    def get_container_vni_attachments_output(cluster: pulumi.Input[Optional[str]] = None,
                                      id: pulumi.Input[Optional[str]] = None,
                                      resource_group_id: pulumi.Input[Optional[str]] = None,
                                      worker: pulumi.Input[Optional[str]] = None,
                                      opts: Optional[InvokeOptions] = None) -> Output[GetContainerVniAttachmentsResult]
    func GetContainerVniAttachments(ctx *Context, args *GetContainerVniAttachmentsArgs, opts ...InvokeOption) (*GetContainerVniAttachmentsResult, error)
    func GetContainerVniAttachmentsOutput(ctx *Context, args *GetContainerVniAttachmentsOutputArgs, opts ...InvokeOption) GetContainerVniAttachmentsResultOutput

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

    public static class GetContainerVniAttachments 
    {
        public static Task<GetContainerVniAttachmentsResult> InvokeAsync(GetContainerVniAttachmentsArgs args, InvokeOptions? opts = null)
        public static Output<GetContainerVniAttachmentsResult> Invoke(GetContainerVniAttachmentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetContainerVniAttachmentsResult> getContainerVniAttachments(GetContainerVniAttachmentsArgs args, InvokeOptions options)
    public static Output<GetContainerVniAttachmentsResult> getContainerVniAttachments(GetContainerVniAttachmentsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getContainerVniAttachments:getContainerVniAttachments
      arguments:
        # arguments dictionary
    data "ibm_getcontainervniattachments" "name" {
        # arguments
    }

    The following arguments are supported:

    Cluster string
    The cluster ID or name to list all VNI attachments. Exactly one of cluster or worker must be specified.
    Id string
    (String) The unique identifier of the data source (cluster or worker ID).
    ResourceGroupId string
    The ID of the resource group where the cluster is provisioned. To find the resource group, run ibmcloud resource groups or use the ibm.ResourceGroup data source.
    Worker string
    The worker ID to list VNI attachments for a specific worker. Exactly one of cluster or worker must be specified. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    Cluster string
    The cluster ID or name to list all VNI attachments. Exactly one of cluster or worker must be specified.
    Id string
    (String) The unique identifier of the data source (cluster or worker ID).
    ResourceGroupId string
    The ID of the resource group where the cluster is provisioned. To find the resource group, run ibmcloud resource groups or use the ibm.ResourceGroup data source.
    Worker string
    The worker ID to list VNI attachments for a specific worker. Exactly one of cluster or worker must be specified. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    cluster string
    The cluster ID or name to list all VNI attachments. Exactly one of cluster or worker must be specified.
    id string
    (String) The unique identifier of the data source (cluster or worker ID).
    resource_group_id string
    The ID of the resource group where the cluster is provisioned. To find the resource group, run ibmcloud resource groups or use the ibm.ResourceGroup data source.
    worker string
    The worker ID to list VNI attachments for a specific worker. Exactly one of cluster or worker must be specified. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    cluster String
    The cluster ID or name to list all VNI attachments. Exactly one of cluster or worker must be specified.
    id String
    (String) The unique identifier of the data source (cluster or worker ID).
    resourceGroupId String
    The ID of the resource group where the cluster is provisioned. To find the resource group, run ibmcloud resource groups or use the ibm.ResourceGroup data source.
    worker String
    The worker ID to list VNI attachments for a specific worker. Exactly one of cluster or worker must be specified. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    cluster string
    The cluster ID or name to list all VNI attachments. Exactly one of cluster or worker must be specified.
    id string
    (String) The unique identifier of the data source (cluster or worker ID).
    resourceGroupId string
    The ID of the resource group where the cluster is provisioned. To find the resource group, run ibmcloud resource groups or use the ibm.ResourceGroup data source.
    worker string
    The worker ID to list VNI attachments for a specific worker. Exactly one of cluster or worker must be specified. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    cluster str
    The cluster ID or name to list all VNI attachments. Exactly one of cluster or worker must be specified.
    id str
    (String) The unique identifier of the data source (cluster or worker ID).
    resource_group_id str
    The ID of the resource group where the cluster is provisioned. To find the resource group, run ibmcloud resource groups or use the ibm.ResourceGroup data source.
    worker str
    The worker ID to list VNI attachments for a specific worker. Exactly one of cluster or worker must be specified. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    cluster String
    The cluster ID or name to list all VNI attachments. Exactly one of cluster or worker must be specified.
    id String
    (String) The unique identifier of the data source (cluster or worker ID).
    resourceGroupId String
    The ID of the resource group where the cluster is provisioned. To find the resource group, run ibmcloud resource groups or use the ibm.ResourceGroup data source.
    worker String
    The worker ID to list VNI attachments for a specific worker. Exactly one of cluster or worker must be specified. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.

    getContainerVniAttachments Result

    The following output properties are available:

    Attachments List<GetContainerVniAttachmentsAttachment>
    (List) A list of VNI attachments.
    Id string
    (String) The unique identifier of the data source (cluster or worker ID).
    Cluster string
    ResourceGroupId string
    Worker string
    Attachments []GetContainerVniAttachmentsAttachment
    (List) A list of VNI attachments.
    Id string
    (String) The unique identifier of the data source (cluster or worker ID).
    Cluster string
    ResourceGroupId string
    Worker string
    attachments list(object)
    (List) A list of VNI attachments.
    id string
    (String) The unique identifier of the data source (cluster or worker ID).
    cluster string
    resource_group_id string
    worker string
    attachments List<GetContainerVniAttachmentsAttachment>
    (List) A list of VNI attachments.
    id String
    (String) The unique identifier of the data source (cluster or worker ID).
    cluster String
    resourceGroupId String
    worker String
    attachments GetContainerVniAttachmentsAttachment[]
    (List) A list of VNI attachments.
    id string
    (String) The unique identifier of the data source (cluster or worker ID).
    cluster string
    resourceGroupId string
    worker string
    attachments Sequence[GetContainerVniAttachmentsAttachment]
    (List) A list of VNI attachments.
    id str
    (String) The unique identifier of the data source (cluster or worker ID).
    cluster str
    resource_group_id str
    worker str
    attachments List<Property Map>
    (List) A list of VNI attachments.
    id String
    (String) The unique identifier of the data source (cluster or worker ID).
    cluster String
    resourceGroupId String
    worker String

    Supporting Types

    GetContainerVniAttachmentsAttachment

    AutoDelete bool
    (Bool) Whether the VNI will be deleted when detached.
    ClusterId string
    (String) The cluster ID (only present when querying by cluster).
    CreatedAt string
    (String) The timestamp when the attachment was created.
    MacAddress string
    (String) The MAC address of the VNI.
    PrimaryIpAddress string
    (String) The primary IP address of the VNI.
    Status string
    (String) The status of the attachment.
    VlanId double
    (Integer) The VLAN ID for the bare metal worker.
    VniId string
    (String) The ID of the VNI.
    VniName string
    (String) The name of the VNI.
    WorkerId string
    (String) The worker ID where the VNI is attached.
    AutoDelete bool
    (Bool) Whether the VNI will be deleted when detached.
    ClusterId string
    (String) The cluster ID (only present when querying by cluster).
    CreatedAt string
    (String) The timestamp when the attachment was created.
    MacAddress string
    (String) The MAC address of the VNI.
    PrimaryIpAddress string
    (String) The primary IP address of the VNI.
    Status string
    (String) The status of the attachment.
    VlanId float64
    (Integer) The VLAN ID for the bare metal worker.
    VniId string
    (String) The ID of the VNI.
    VniName string
    (String) The name of the VNI.
    WorkerId string
    (String) The worker ID where the VNI is attached.
    auto_delete bool
    (Bool) Whether the VNI will be deleted when detached.
    cluster_id string
    (String) The cluster ID (only present when querying by cluster).
    created_at string
    (String) The timestamp when the attachment was created.
    mac_address string
    (String) The MAC address of the VNI.
    primary_ip_address string
    (String) The primary IP address of the VNI.
    status string
    (String) The status of the attachment.
    vlan_id number
    (Integer) The VLAN ID for the bare metal worker.
    vni_id string
    (String) The ID of the VNI.
    vni_name string
    (String) The name of the VNI.
    worker_id string
    (String) The worker ID where the VNI is attached.
    autoDelete Boolean
    (Bool) Whether the VNI will be deleted when detached.
    clusterId String
    (String) The cluster ID (only present when querying by cluster).
    createdAt String
    (String) The timestamp when the attachment was created.
    macAddress String
    (String) The MAC address of the VNI.
    primaryIpAddress String
    (String) The primary IP address of the VNI.
    status String
    (String) The status of the attachment.
    vlanId Double
    (Integer) The VLAN ID for the bare metal worker.
    vniId String
    (String) The ID of the VNI.
    vniName String
    (String) The name of the VNI.
    workerId String
    (String) The worker ID where the VNI is attached.
    autoDelete boolean
    (Bool) Whether the VNI will be deleted when detached.
    clusterId string
    (String) The cluster ID (only present when querying by cluster).
    createdAt string
    (String) The timestamp when the attachment was created.
    macAddress string
    (String) The MAC address of the VNI.
    primaryIpAddress string
    (String) The primary IP address of the VNI.
    status string
    (String) The status of the attachment.
    vlanId number
    (Integer) The VLAN ID for the bare metal worker.
    vniId string
    (String) The ID of the VNI.
    vniName string
    (String) The name of the VNI.
    workerId string
    (String) The worker ID where the VNI is attached.
    auto_delete bool
    (Bool) Whether the VNI will be deleted when detached.
    cluster_id str
    (String) The cluster ID (only present when querying by cluster).
    created_at str
    (String) The timestamp when the attachment was created.
    mac_address str
    (String) The MAC address of the VNI.
    primary_ip_address str
    (String) The primary IP address of the VNI.
    status str
    (String) The status of the attachment.
    vlan_id float
    (Integer) The VLAN ID for the bare metal worker.
    vni_id str
    (String) The ID of the VNI.
    vni_name str
    (String) The name of the VNI.
    worker_id str
    (String) The worker ID where the VNI is attached.
    autoDelete Boolean
    (Bool) Whether the VNI will be deleted when detached.
    clusterId String
    (String) The cluster ID (only present when querying by cluster).
    createdAt String
    (String) The timestamp when the attachment was created.
    macAddress String
    (String) The MAC address of the VNI.
    primaryIpAddress String
    (String) The primary IP address of the VNI.
    status String
    (String) The status of the attachment.
    vlanId Number
    (Integer) The VLAN ID for the bare metal worker.
    vniId String
    (String) The ID of the VNI.
    vniName String
    (String) The name of the VNI.
    workerId String
    (String) The worker ID where the VNI is attached.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    Viewing docs for ibm 2.4.0
    published on Wednesday, Jul 1, 2026 by ibm-cloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial