1. Packages
  2. Packages
  3. Ibm Provider
  4. API Docs
  5. getContainerVniAttachment
Viewing docs for ibm 2.5.0-beta0
published on Thursday, Jul 23, 2026 by ibm-cloud
Viewing docs for ibm 2.5.0-beta0
published on Thursday, Jul 23, 2026 by ibm-cloud

    Retrieve information about a Virtual Network Interface (VNI) attachment to a bare metal worker node in a Red Hat OpenShift on IBM Cloud cluster. This feature is currently supported for OpenShift clusters only.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const attachment = ibm.getContainerVniAttachment({
        cluster: "mycluster",
        worker: "kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001",
        vniId: "r006-1234abcd-5678-90ef-1234-567890abcdef",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    attachment = ibm.get_container_vni_attachment(cluster="mycluster",
        worker="kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001",
        vni_id="r006-1234abcd-5678-90ef-1234-567890abcdef")
    
    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.GetContainerVniAttachment(ctx, &ibm.GetContainerVniAttachmentArgs{
    			Cluster: "mycluster",
    			Worker:  "kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001",
    			VniId:   "r006-1234abcd-5678-90ef-1234-567890abcdef",
    		}, 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 attachment = Ibm.GetContainerVniAttachment.Invoke(new()
        {
            Cluster = "mycluster",
            Worker = "kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001",
            VniId = "r006-1234abcd-5678-90ef-1234-567890abcdef",
        });
    
    });
    
    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.GetContainerVniAttachmentArgs;
    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 attachment = IbmFunctions.getContainerVniAttachment(GetContainerVniAttachmentArgs.builder()
                .cluster("mycluster")
                .worker("kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001")
                .vniId("r006-1234abcd-5678-90ef-1234-567890abcdef")
                .build());
    
        }
    }
    
    variables:
      attachment:
        fn::invoke:
          function: ibm:getContainerVniAttachment
          arguments:
            cluster: mycluster
            worker: kube-c4u8l44d0hf4s8k25u90-mycluster-bm-000001
            vniId: r006-1234abcd-5678-90ef-1234-567890abcdef
    
    Example coming soon!
    

    Using getContainerVniAttachment

    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 getContainerVniAttachment(args: GetContainerVniAttachmentArgs, opts?: InvokeOptions): Promise<GetContainerVniAttachmentResult>
    function getContainerVniAttachmentOutput(args: GetContainerVniAttachmentOutputArgs, opts?: InvokeOptions): Output<GetContainerVniAttachmentResult>
    def get_container_vni_attachment(cluster: Optional[str] = None,
                                     id: Optional[str] = None,
                                     resource_group_id: Optional[str] = None,
                                     vni_id: Optional[str] = None,
                                     worker: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetContainerVniAttachmentResult
    def get_container_vni_attachment_output(cluster: pulumi.Input[Optional[str]] = None,
                                     id: pulumi.Input[Optional[str]] = None,
                                     resource_group_id: pulumi.Input[Optional[str]] = None,
                                     vni_id: pulumi.Input[Optional[str]] = None,
                                     worker: pulumi.Input[Optional[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetContainerVniAttachmentResult]
    func GetContainerVniAttachment(ctx *Context, args *GetContainerVniAttachmentArgs, opts ...InvokeOption) (*GetContainerVniAttachmentResult, error)
    func GetContainerVniAttachmentOutput(ctx *Context, args *GetContainerVniAttachmentOutputArgs, opts ...InvokeOption) GetContainerVniAttachmentResultOutput

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

    public static class GetContainerVniAttachment 
    {
        public static Task<GetContainerVniAttachmentResult> InvokeAsync(GetContainerVniAttachmentArgs args, InvokeOptions? opts = null)
        public static Output<GetContainerVniAttachmentResult> Invoke(GetContainerVniAttachmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetContainerVniAttachmentResult> getContainerVniAttachment(GetContainerVniAttachmentArgs args, InvokeOptions options)
    public static Output<GetContainerVniAttachmentResult> getContainerVniAttachment(GetContainerVniAttachmentArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getContainerVniAttachment:getContainerVniAttachment
      arguments:
        # arguments dictionary
    data "ibm_get_container_vni_attachment" "name" {
        # arguments
    }

    The following arguments are supported:

    Cluster string
    The cluster ID or name where the worker is located.
    VniId string
    The ID of the VNI to retrieve information about.
    Worker string
    The worker ID where the VNI is attached. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    Id string
    (String) The unique identifier of the VNI attachment (same as vni_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.
    Cluster string
    The cluster ID or name where the worker is located.
    VniId string
    The ID of the VNI to retrieve information about.
    Worker string
    The worker ID where the VNI is attached. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    Id string
    (String) The unique identifier of the VNI attachment (same as vni_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.
    cluster string
    The cluster ID or name where the worker is located.
    vni_id string
    The ID of the VNI to retrieve information about.
    worker string
    The worker ID where the VNI is attached. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    id string
    (String) The unique identifier of the VNI attachment (same as vni_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.
    cluster String
    The cluster ID or name where the worker is located.
    vniId String
    The ID of the VNI to retrieve information about.
    worker String
    The worker ID where the VNI is attached. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    id String
    (String) The unique identifier of the VNI attachment (same as vni_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.
    cluster string
    The cluster ID or name where the worker is located.
    vniId string
    The ID of the VNI to retrieve information about.
    worker string
    The worker ID where the VNI is attached. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    id string
    (String) The unique identifier of the VNI attachment (same as vni_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.
    cluster str
    The cluster ID or name where the worker is located.
    vni_id str
    The ID of the VNI to retrieve information about.
    worker str
    The worker ID where the VNI is attached. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    id str
    (String) The unique identifier of the VNI attachment (same as vni_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.
    cluster String
    The cluster ID or name where the worker is located.
    vniId String
    The ID of the VNI to retrieve information about.
    worker String
    The worker ID where the VNI is attached. To find the worker ID, run ibmcloud ks worker ls --cluster <cluster_name_or_ID>.
    id String
    (String) The unique identifier of the VNI attachment (same as vni_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.

    getContainerVniAttachment Result

    The following output properties are available:

    AutoDelete bool
    (Bool) Whether the VNI will be deleted when the attachment is destroyed.
    Cluster string
    CreatedAt string
    (String) The timestamp when the attachment was created.
    Id string
    (String) The unique identifier of the VNI attachment (same as vni_id).
    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
    VniName string
    (String) The name of the VNI.
    Worker string
    ResourceGroupId string
    AutoDelete bool
    (Bool) Whether the VNI will be deleted when the attachment is destroyed.
    Cluster string
    CreatedAt string
    (String) The timestamp when the attachment was created.
    Id string
    (String) The unique identifier of the VNI attachment (same as vni_id).
    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
    VniName string
    (String) The name of the VNI.
    Worker string
    ResourceGroupId string
    auto_delete bool
    (Bool) Whether the VNI will be deleted when the attachment is destroyed.
    cluster string
    created_at string
    (String) The timestamp when the attachment was created.
    id string
    (String) The unique identifier of the VNI attachment (same as vni_id).
    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
    vni_name string
    (String) The name of the VNI.
    worker string
    resource_group_id string
    autoDelete Boolean
    (Bool) Whether the VNI will be deleted when the attachment is destroyed.
    cluster String
    createdAt String
    (String) The timestamp when the attachment was created.
    id String
    (String) The unique identifier of the VNI attachment (same as vni_id).
    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
    vniName String
    (String) The name of the VNI.
    worker String
    resourceGroupId String
    autoDelete boolean
    (Bool) Whether the VNI will be deleted when the attachment is destroyed.
    cluster string
    createdAt string
    (String) The timestamp when the attachment was created.
    id string
    (String) The unique identifier of the VNI attachment (same as vni_id).
    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
    vniName string
    (String) The name of the VNI.
    worker string
    resourceGroupId string
    auto_delete bool
    (Bool) Whether the VNI will be deleted when the attachment is destroyed.
    cluster str
    created_at str
    (String) The timestamp when the attachment was created.
    id str
    (String) The unique identifier of the VNI attachment (same as vni_id).
    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
    vni_name str
    (String) The name of the VNI.
    worker str
    resource_group_id str
    autoDelete Boolean
    (Bool) Whether the VNI will be deleted when the attachment is destroyed.
    cluster String
    createdAt String
    (String) The timestamp when the attachment was created.
    id String
    (String) The unique identifier of the VNI attachment (same as vni_id).
    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
    vniName String
    (String) The name of the VNI.
    worker String
    resourceGroupId String

    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.5.0-beta0
    published on Thursday, Jul 23, 2026 by ibm-cloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial