1. Packages
  2. Ibm Provider
  3. API Docs
  4. getContainerBindService
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getContainerBindService

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Retrieve information of a service attached to IBM Cloud cluster. For more information, about service binding, see Adding services by using IBM Cloud service binding.

    Example Usage

    The following example retrieves service information attached to a cluster.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const bindService = ibm.getContainerBindService({
        clusterNameId: "cluster_name",
        namespaceId: "default",
        serviceInstanceName: "service_name",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    bind_service = ibm.get_container_bind_service(cluster_name_id="cluster_name",
        namespace_id="default",
        service_instance_name="service_name")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.LookupContainerBindService(ctx, &ibm.LookupContainerBindServiceArgs{
    			ClusterNameId:       "cluster_name",
    			NamespaceId:         "default",
    			ServiceInstanceName: pulumi.StringRef("service_name"),
    		}, 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 bindService = Ibm.GetContainerBindService.Invoke(new()
        {
            ClusterNameId = "cluster_name",
            NamespaceId = "default",
            ServiceInstanceName = "service_name",
        });
    
    });
    
    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.GetContainerBindServiceArgs;
    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 bindService = IbmFunctions.getContainerBindService(GetContainerBindServiceArgs.builder()
                .clusterNameId("cluster_name")
                .namespaceId("default")
                .serviceInstanceName("service_name")
                .build());
    
        }
    }
    
    variables:
      bindService:
        fn::invoke:
          function: ibm:getContainerBindService
          arguments:
            clusterNameId: cluster_name
            namespaceId: default
            serviceInstanceName: service_name
    

    Using getContainerBindService

    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 getContainerBindService(args: GetContainerBindServiceArgs, opts?: InvokeOptions): Promise<GetContainerBindServiceResult>
    function getContainerBindServiceOutput(args: GetContainerBindServiceOutputArgs, opts?: InvokeOptions): Output<GetContainerBindServiceResult>
    def get_container_bind_service(cluster_name_id: Optional[str] = None,
                                   id: Optional[str] = None,
                                   namespace_id: Optional[str] = None,
                                   service_instance_id: Optional[str] = None,
                                   service_instance_name: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetContainerBindServiceResult
    def get_container_bind_service_output(cluster_name_id: Optional[pulumi.Input[str]] = None,
                                   id: Optional[pulumi.Input[str]] = None,
                                   namespace_id: Optional[pulumi.Input[str]] = None,
                                   service_instance_id: Optional[pulumi.Input[str]] = None,
                                   service_instance_name: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetContainerBindServiceResult]
    func LookupContainerBindService(ctx *Context, args *LookupContainerBindServiceArgs, opts ...InvokeOption) (*LookupContainerBindServiceResult, error)
    func LookupContainerBindServiceOutput(ctx *Context, args *LookupContainerBindServiceOutputArgs, opts ...InvokeOption) LookupContainerBindServiceResultOutput

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

    public static class GetContainerBindService 
    {
        public static Task<GetContainerBindServiceResult> InvokeAsync(GetContainerBindServiceArgs args, InvokeOptions? opts = null)
        public static Output<GetContainerBindServiceResult> Invoke(GetContainerBindServiceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetContainerBindServiceResult> getContainerBindService(GetContainerBindServiceArgs args, InvokeOptions options)
    public static Output<GetContainerBindServiceResult> getContainerBindService(GetContainerBindServiceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getContainerBindService:getContainerBindService
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterNameId string
    The name or ID of the cluster.
    NamespaceId string
    The Kubernetes namespace.
    Id string
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    ServiceInstanceId string
    The ID of the service that is attached to the cluster. This conflicts with the service_instance_name parameter.
    ServiceInstanceName string
    The name of the service that is attached to the cluster. This conflicts with the service_instance_id parameter.
    ClusterNameId string
    The name or ID of the cluster.
    NamespaceId string
    The Kubernetes namespace.
    Id string
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    ServiceInstanceId string
    The ID of the service that is attached to the cluster. This conflicts with the service_instance_name parameter.
    ServiceInstanceName string
    The name of the service that is attached to the cluster. This conflicts with the service_instance_id parameter.
    clusterNameId String
    The name or ID of the cluster.
    namespaceId String
    The Kubernetes namespace.
    id String
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    serviceInstanceId String
    The ID of the service that is attached to the cluster. This conflicts with the service_instance_name parameter.
    serviceInstanceName String
    The name of the service that is attached to the cluster. This conflicts with the service_instance_id parameter.
    clusterNameId string
    The name or ID of the cluster.
    namespaceId string
    The Kubernetes namespace.
    id string
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    serviceInstanceId string
    The ID of the service that is attached to the cluster. This conflicts with the service_instance_name parameter.
    serviceInstanceName string
    The name of the service that is attached to the cluster. This conflicts with the service_instance_id parameter.
    cluster_name_id str
    The name or ID of the cluster.
    namespace_id str
    The Kubernetes namespace.
    id str
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    service_instance_id str
    The ID of the service that is attached to the cluster. This conflicts with the service_instance_name parameter.
    service_instance_name str
    The name of the service that is attached to the cluster. This conflicts with the service_instance_id parameter.
    clusterNameId String
    The name or ID of the cluster.
    namespaceId String
    The Kubernetes namespace.
    id String
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    serviceInstanceId String
    The ID of the service that is attached to the cluster. This conflicts with the service_instance_name parameter.
    serviceInstanceName String
    The name of the service that is attached to the cluster. This conflicts with the service_instance_id parameter.

    getContainerBindService Result

    The following output properties are available:

    ClusterNameId string
    Id string
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    NamespaceId string
    ServiceInstanceId string
    ServiceInstanceName string
    ServiceKeyName string
    (String) The service key name.
    ClusterNameId string
    Id string
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    NamespaceId string
    ServiceInstanceId string
    ServiceInstanceName string
    ServiceKeyName string
    (String) The service key name.
    clusterNameId String
    id String
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    namespaceId String
    serviceInstanceId String
    serviceInstanceName String
    serviceKeyName String
    (String) The service key name.
    clusterNameId string
    id string
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    namespaceId string
    serviceInstanceId string
    serviceInstanceName string
    serviceKeyName string
    (String) The service key name.
    cluster_name_id str
    id str
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    namespace_id str
    service_instance_id str
    service_instance_name str
    service_key_name str
    (String) The service key name.
    clusterNameId String
    id String
    (String) The unique Id of the bind service resource. The ID is composed of <cluster_name_id>/<service_instance_name or service_instance_id>/<namespace_id/>.
    namespaceId String
    serviceInstanceId String
    serviceInstanceName String
    serviceKeyName String
    (String) The service key name.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud