1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. gkehub
  5. getMembership
Google Cloud v8.34.0 published on Wednesday, Jun 11, 2025 by Pulumi

gcp.gkehub.getMembership

Explore with Pulumi AI

gcp logo
Google Cloud v8.34.0 published on Wednesday, Jun 11, 2025 by Pulumi

    Retrieves the details of a specific GKE Hub Membership. Use this data source to retrieve the membership’s configuration and state.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const example = gcp.gkehub.getMembership({
        project: "my-project-id",
        location: "global",
        membershipId: "my-membership-id",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    example = gcp.gkehub.get_membership(project="my-project-id",
        location="global",
        membership_id="my-membership-id")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/gkehub"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := gkehub.LookupMembership(ctx, &gkehub.LookupMembershipArgs{
    			Project:      pulumi.StringRef("my-project-id"),
    			Location:     "global",
    			MembershipId: "my-membership-id",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Gcp.GkeHub.GetMembership.Invoke(new()
        {
            Project = "my-project-id",
            Location = "global",
            MembershipId = "my-membership-id",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.gkehub.GkehubFunctions;
    import com.pulumi.gcp.gkehub.inputs.GetMembershipArgs;
    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 example = GkehubFunctions.getMembership(GetMembershipArgs.builder()
                .project("my-project-id")
                .location("global")
                .membershipId("my-membership-id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: gcp:gkehub:getMembership
          arguments:
            project: my-project-id
            location: global
            membershipId: my-membership-id
    

    Using getMembership

    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 getMembership(args: GetMembershipArgs, opts?: InvokeOptions): Promise<GetMembershipResult>
    function getMembershipOutput(args: GetMembershipOutputArgs, opts?: InvokeOptions): Output<GetMembershipResult>
    def get_membership(location: Optional[str] = None,
                       membership_id: Optional[str] = None,
                       project: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetMembershipResult
    def get_membership_output(location: Optional[pulumi.Input[str]] = None,
                       membership_id: Optional[pulumi.Input[str]] = None,
                       project: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetMembershipResult]
    func LookupMembership(ctx *Context, args *LookupMembershipArgs, opts ...InvokeOption) (*LookupMembershipResult, error)
    func LookupMembershipOutput(ctx *Context, args *LookupMembershipOutputArgs, opts ...InvokeOption) LookupMembershipResultOutput

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

    public static class GetMembership 
    {
        public static Task<GetMembershipResult> InvokeAsync(GetMembershipArgs args, InvokeOptions? opts = null)
        public static Output<GetMembershipResult> Invoke(GetMembershipInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMembershipResult> getMembership(GetMembershipArgs args, InvokeOptions options)
    public static Output<GetMembershipResult> getMembership(GetMembershipArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcp:gkehub/getMembership:getMembership
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Location string
    The location for the GKE Hub Membership. Currently only global is supported.
    MembershipId string
    The GKE Hub Membership id or GKE Cluster's name.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Location string
    The location for the GKE Hub Membership. Currently only global is supported.
    MembershipId string
    The GKE Hub Membership id or GKE Cluster's name.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location for the GKE Hub Membership. Currently only global is supported.
    membershipId String
    The GKE Hub Membership id or GKE Cluster's name.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location string
    The location for the GKE Hub Membership. Currently only global is supported.
    membershipId string
    The GKE Hub Membership id or GKE Cluster's name.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location str
    The location for the GKE Hub Membership. Currently only global is supported.
    membership_id str
    The GKE Hub Membership id or GKE Cluster's name.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location for the GKE Hub Membership. Currently only global is supported.
    membershipId String
    The GKE Hub Membership id or GKE Cluster's name.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    getMembership Result

    The following output properties are available:

    Authorities List<GetMembershipAuthority>
    Description string
    EffectiveLabels Dictionary<string, string>
    Endpoints List<GetMembershipEndpoint>
    Id string
    The provider-assigned unique ID for this managed resource.
    Labels Dictionary<string, string>
    Location string
    MembershipId string
    Name string
    PulumiLabels Dictionary<string, string>
    Project string
    Authorities []GetMembershipAuthority
    Description string
    EffectiveLabels map[string]string
    Endpoints []GetMembershipEndpoint
    Id string
    The provider-assigned unique ID for this managed resource.
    Labels map[string]string
    Location string
    MembershipId string
    Name string
    PulumiLabels map[string]string
    Project string
    authorities List<GetMembershipAuthority>
    description String
    effectiveLabels Map<String,String>
    endpoints List<GetMembershipEndpoint>
    id String
    The provider-assigned unique ID for this managed resource.
    labels Map<String,String>
    location String
    membershipId String
    name String
    pulumiLabels Map<String,String>
    project String
    authorities GetMembershipAuthority[]
    description string
    effectiveLabels {[key: string]: string}
    endpoints GetMembershipEndpoint[]
    id string
    The provider-assigned unique ID for this managed resource.
    labels {[key: string]: string}
    location string
    membershipId string
    name string
    pulumiLabels {[key: string]: string}
    project string
    authorities Sequence[GetMembershipAuthority]
    description str
    effective_labels Mapping[str, str]
    endpoints Sequence[GetMembershipEndpoint]
    id str
    The provider-assigned unique ID for this managed resource.
    labels Mapping[str, str]
    location str
    membership_id str
    name str
    pulumi_labels Mapping[str, str]
    project str
    authorities List<Property Map>
    description String
    effectiveLabels Map<String>
    endpoints List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    labels Map<String>
    location String
    membershipId String
    name String
    pulumiLabels Map<String>
    project String

    Supporting Types

    GetMembershipAuthority

    Issuer string
    Issuer string
    issuer String
    issuer string
    issuer str
    issuer String

    GetMembershipEndpoint

    GkeClusters List<GetMembershipEndpointGkeCluster>
    If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.
    GkeClusters []GetMembershipEndpointGkeCluster
    If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.
    gkeClusters List<GetMembershipEndpointGkeCluster>
    If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.
    gkeClusters GetMembershipEndpointGkeCluster[]
    If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.
    gke_clusters Sequence[GetMembershipEndpointGkeCluster]
    If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.
    gkeClusters List<Property Map>
    If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.

    GetMembershipEndpointGkeCluster

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud v8.34.0 published on Wednesday, Jun 11, 2025 by Pulumi