Google Cloud v8.34.0 published on Wednesday, Jun 11, 2025 by Pulumi
gcp.gkehub.getMembership
Explore with Pulumi AI
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. - Membership
Id 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. - Membership
Id 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. - membership
Id 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. - membership
Id 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. - membership
Id 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:
- List<Get
Membership Authority> - Description string
- Effective
Labels Dictionary<string, string> - Endpoints
List<Get
Membership Endpoint> - Id string
- The provider-assigned unique ID for this managed resource.
- Labels Dictionary<string, string>
- Location string
- Membership
Id string - Name string
- Pulumi
Labels Dictionary<string, string> - Project string
- []Get
Membership Authority - Description string
- Effective
Labels map[string]string - Endpoints
[]Get
Membership Endpoint - Id string
- The provider-assigned unique ID for this managed resource.
- Labels map[string]string
- Location string
- Membership
Id string - Name string
- Pulumi
Labels map[string]string - Project string
- List<Get
Membership Authority> - description String
- effective
Labels Map<String,String> - endpoints
List<Get
Membership Endpoint> - id String
- The provider-assigned unique ID for this managed resource.
- labels Map<String,String>
- location String
- membership
Id String - name String
- pulumi
Labels Map<String,String> - project String
- Get
Membership Authority[] - description string
- effective
Labels {[key: string]: string} - endpoints
Get
Membership Endpoint[] - id string
- The provider-assigned unique ID for this managed resource.
- labels {[key: string]: string}
- location string
- membership
Id string - name string
- pulumi
Labels {[key: string]: string} - project string
- Sequence[Get
Membership Authority] - description str
- effective_
labels Mapping[str, str] - endpoints
Sequence[Get
Membership Endpoint] - 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
- List<Property Map>
- description String
- effective
Labels Map<String> - endpoints List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- labels Map<String>
- location String
- membership
Id String - name String
- pulumi
Labels Map<String> - project String
Supporting Types
GetMembershipAuthority
- Issuer string
- Issuer string
- issuer String
- issuer string
- issuer str
- issuer String
GetMembershipEndpoint
- Gke
Clusters List<GetMembership Endpoint Gke Cluster> - If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.
- Gke
Clusters []GetMembership Endpoint Gke Cluster - If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.
- gke
Clusters List<GetMembership Endpoint Gke Cluster> - If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.
- gke
Clusters GetMembership Endpoint Gke Cluster[] - If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.
- gke_
clusters Sequence[GetMembership Endpoint Gke Cluster] - If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.
- gke
Clusters List<Property Map> - If this Membership is a Kubernetes API server hosted on GKE, this is a self link to its GCP resource.
GetMembershipEndpointGkeCluster
- Resource
Link string
- Resource
Link string
- resource
Link String
- resource
Link string
- resource_
link str
- resource
Link String
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.