com.pulumi.gcp.gkehub.kotlin.FeatureMembership.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.gkehub.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.gkehub.kotlin.outputs.FeatureMembershipConfigmanagement
import com.pulumi.gcp.gkehub.kotlin.outputs.FeatureMembershipMesh
import com.pulumi.gcp.gkehub.kotlin.outputs.FeatureMembershipPolicycontroller
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.gkehub.kotlin.outputs.FeatureMembershipConfigmanagement.Companion.toKotlin as featureMembershipConfigmanagementToKotlin
import com.pulumi.gcp.gkehub.kotlin.outputs.FeatureMembershipMesh.Companion.toKotlin as featureMembershipMeshToKotlin
import com.pulumi.gcp.gkehub.kotlin.outputs.FeatureMembershipPolicycontroller.Companion.toKotlin as featureMembershipPolicycontrollerToKotlin
/**
* Builder for [FeatureMembership].
*/
@PulumiTagMarker
public class FeatureMembershipResourceBuilder internal constructor() {
public var name: String? = null
public var args: FeatureMembershipArgs = FeatureMembershipArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend FeatureMembershipArgsBuilder.() -> Unit) {
val builder = FeatureMembershipArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): FeatureMembership {
val builtJavaResource = com.pulumi.gcp.gkehub.FeatureMembership(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return FeatureMembership(builtJavaResource)
}
}
/**
* Contains information about a GKEHub Feature Memberships. Feature Memberships configure GKEHub Features that apply to specific memberships rather than the project as a whole. The google_gke_hub is the Fleet API.
* ## Example Usage
* ### Config Management
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const cluster = new gcp.container.Cluster("cluster", {
* name: "my-cluster",
* location: "us-central1-a",
* initialNodeCount: 1,
* });
* const membership = new gcp.gkehub.Membership("membership", {
* membershipId: "my-membership",
* endpoint: {
* gkeCluster: {
* resourceLink: pulumi.interpolate`//container.googleapis.com/${cluster.id}`,
* },
* },
* });
* const feature = new gcp.gkehub.Feature("feature", {
* name: "configmanagement",
* location: "global",
* labels: {
* foo: "bar",
* },
* });
* const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
* location: "global",
* feature: feature.name,
* membership: membership.membershipId,
* configmanagement: {
* version: "1.6.2",
* configSync: {
* git: {
* syncRepo: "https://github.com/hashicorp/terraform",
* },
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* cluster = gcp.container.Cluster("cluster",
* name="my-cluster",
* location="us-central1-a",
* initial_node_count=1)
* membership = gcp.gkehub.Membership("membership",
* membership_id="my-membership",
* endpoint=gcp.gkehub.MembershipEndpointArgs(
* gke_cluster=gcp.gkehub.MembershipEndpointGkeClusterArgs(
* resource_link=cluster.id.apply(lambda id: f"//container.googleapis.com/{id}"),
* ),
* ))
* feature = gcp.gkehub.Feature("feature",
* name="configmanagement",
* location="global",
* labels={
* "foo": "bar",
* })
* feature_member = gcp.gkehub.FeatureMembership("feature_member",
* location="global",
* feature=feature.name,
* membership=membership.membership_id,
* configmanagement=gcp.gkehub.FeatureMembershipConfigmanagementArgs(
* version="1.6.2",
* config_sync=gcp.gkehub.FeatureMembershipConfigmanagementConfigSyncArgs(
* git=gcp.gkehub.FeatureMembershipConfigmanagementConfigSyncGitArgs(
* sync_repo="https://github.com/hashicorp/terraform",
* ),
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var cluster = new Gcp.Container.Cluster("cluster", new()
* {
* Name = "my-cluster",
* Location = "us-central1-a",
* InitialNodeCount = 1,
* });
* var membership = new Gcp.GkeHub.Membership("membership", new()
* {
* MembershipId = "my-membership",
* Endpoint = new Gcp.GkeHub.Inputs.MembershipEndpointArgs
* {
* GkeCluster = new Gcp.GkeHub.Inputs.MembershipEndpointGkeClusterArgs
* {
* ResourceLink = cluster.Id.Apply(id => $"//container.googleapis.com/{id}"),
* },
* },
* });
* var feature = new Gcp.GkeHub.Feature("feature", new()
* {
* Name = "configmanagement",
* Location = "global",
* Labels =
* {
* { "foo", "bar" },
* },
* });
* var featureMember = new Gcp.GkeHub.FeatureMembership("feature_member", new()
* {
* Location = "global",
* Feature = feature.Name,
* Membership = membership.MembershipId,
* Configmanagement = new Gcp.GkeHub.Inputs.FeatureMembershipConfigmanagementArgs
* {
* Version = "1.6.2",
* ConfigSync = new Gcp.GkeHub.Inputs.FeatureMembershipConfigmanagementConfigSyncArgs
* {
* Git = new Gcp.GkeHub.Inputs.FeatureMembershipConfigmanagementConfigSyncGitArgs
* {
* SyncRepo = "https://github.com/hashicorp/terraform",
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/gkehub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* cluster, err := container.NewCluster(ctx, "cluster", &container.ClusterArgs{
* Name: pulumi.String("my-cluster"),
* Location: pulumi.String("us-central1-a"),
* InitialNodeCount: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* membership, err := gkehub.NewMembership(ctx, "membership", &gkehub.MembershipArgs{
* MembershipId: pulumi.String("my-membership"),
* Endpoint: &gkehub.MembershipEndpointArgs{
* GkeCluster: &gkehub.MembershipEndpointGkeClusterArgs{
* ResourceLink: cluster.ID().ApplyT(func(id string) (string, error) {
* return fmt.Sprintf("//container.googleapis.com/%v", id), nil
* }).(pulumi.StringOutput),
* },
* },
* })
* if err != nil {
* return err
* }
* feature, err := gkehub.NewFeature(ctx, "feature", &gkehub.FeatureArgs{
* Name: pulumi.String("configmanagement"),
* Location: pulumi.String("global"),
* Labels: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* })
* if err != nil {
* return err
* }
* _, err = gkehub.NewFeatureMembership(ctx, "feature_member", &gkehub.FeatureMembershipArgs{
* Location: pulumi.String("global"),
* Feature: feature.Name,
* Membership: membership.MembershipId,
* Configmanagement: &gkehub.FeatureMembershipConfigmanagementArgs{
* Version: pulumi.String("1.6.2"),
* ConfigSync: &gkehub.FeatureMembershipConfigmanagementConfigSyncArgs{
* Git: &gkehub.FeatureMembershipConfigmanagementConfigSyncGitArgs{
* SyncRepo: pulumi.String("https://github.com/hashicorp/terraform"),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.container.Cluster;
* import com.pulumi.gcp.container.ClusterArgs;
* import com.pulumi.gcp.gkehub.Membership;
* import com.pulumi.gcp.gkehub.MembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointGkeClusterArgs;
* import com.pulumi.gcp.gkehub.Feature;
* import com.pulumi.gcp.gkehub.FeatureArgs;
* import com.pulumi.gcp.gkehub.FeatureMembership;
* import com.pulumi.gcp.gkehub.FeatureMembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipConfigmanagementArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipConfigmanagementConfigSyncArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipConfigmanagementConfigSyncGitArgs;
* 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) {
* var cluster = new Cluster("cluster", ClusterArgs.builder()
* .name("my-cluster")
* .location("us-central1-a")
* .initialNodeCount(1)
* .build());
* var membership = new Membership("membership", MembershipArgs.builder()
* .membershipId("my-membership")
* .endpoint(MembershipEndpointArgs.builder()
* .gkeCluster(MembershipEndpointGkeClusterArgs.builder()
* .resourceLink(cluster.id().applyValue(id -> String.format("//container.googleapis.com/%s", id)))
* .build())
* .build())
* .build());
* var feature = new Feature("feature", FeatureArgs.builder()
* .name("configmanagement")
* .location("global")
* .labels(Map.of("foo", "bar"))
* .build());
* var featureMember = new FeatureMembership("featureMember", FeatureMembershipArgs.builder()
* .location("global")
* .feature(feature.name())
* .membership(membership.membershipId())
* .configmanagement(FeatureMembershipConfigmanagementArgs.builder()
* .version("1.6.2")
* .configSync(FeatureMembershipConfigmanagementConfigSyncArgs.builder()
* .git(FeatureMembershipConfigmanagementConfigSyncGitArgs.builder()
* .syncRepo("https://github.com/hashicorp/terraform")
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* cluster:
* type: gcp:container:Cluster
* properties:
* name: my-cluster
* location: us-central1-a
* initialNodeCount: 1
* membership:
* type: gcp:gkehub:Membership
* properties:
* membershipId: my-membership
* endpoint:
* gkeCluster:
* resourceLink: //container.googleapis.com/${cluster.id}
* feature:
* type: gcp:gkehub:Feature
* properties:
* name: configmanagement
* location: global
* labels:
* foo: bar
* featureMember:
* type: gcp:gkehub:FeatureMembership
* name: feature_member
* properties:
* location: global
* feature: ${feature.name}
* membership: ${membership.membershipId}
* configmanagement:
* version: 1.6.2
* configSync:
* git:
* syncRepo: https://github.com/hashicorp/terraform
* ```
*
* ### Config Management With OCI
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const cluster = new gcp.container.Cluster("cluster", {
* name: "my-cluster",
* location: "us-central1-a",
* initialNodeCount: 1,
* });
* const membership = new gcp.gkehub.Membership("membership", {
* membershipId: "my-membership",
* endpoint: {
* gkeCluster: {
* resourceLink: pulumi.interpolate`//container.googleapis.com/${cluster.id}`,
* },
* },
* });
* const feature = new gcp.gkehub.Feature("feature", {
* name: "configmanagement",
* location: "global",
* labels: {
* foo: "bar",
* },
* });
* const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
* location: "global",
* feature: feature.name,
* membership: membership.membershipId,
* configmanagement: {
* version: "1.15.1",
* configSync: {
* oci: {
* syncRepo: "us-central1-docker.pkg.dev/sample-project/config-repo/config-sync-gke:latest",
* policyDir: "config-connector",
* syncWaitSecs: "20",
* secretType: "gcpserviceaccount",
* gcpServiceAccountEmail: "[email protected]",
* },
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* cluster = gcp.container.Cluster("cluster",
* name="my-cluster",
* location="us-central1-a",
* initial_node_count=1)
* membership = gcp.gkehub.Membership("membership",
* membership_id="my-membership",
* endpoint=gcp.gkehub.MembershipEndpointArgs(
* gke_cluster=gcp.gkehub.MembershipEndpointGkeClusterArgs(
* resource_link=cluster.id.apply(lambda id: f"//container.googleapis.com/{id}"),
* ),
* ))
* feature = gcp.gkehub.Feature("feature",
* name="configmanagement",
* location="global",
* labels={
* "foo": "bar",
* })
* feature_member = gcp.gkehub.FeatureMembership("feature_member",
* location="global",
* feature=feature.name,
* membership=membership.membership_id,
* configmanagement=gcp.gkehub.FeatureMembershipConfigmanagementArgs(
* version="1.15.1",
* config_sync=gcp.gkehub.FeatureMembershipConfigmanagementConfigSyncArgs(
* oci=gcp.gkehub.FeatureMembershipConfigmanagementConfigSyncOciArgs(
* sync_repo="us-central1-docker.pkg.dev/sample-project/config-repo/config-sync-gke:latest",
* policy_dir="config-connector",
* sync_wait_secs="20",
* secret_type="gcpserviceaccount",
* gcp_service_account_email="[email protected]",
* ),
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var cluster = new Gcp.Container.Cluster("cluster", new()
* {
* Name = "my-cluster",
* Location = "us-central1-a",
* InitialNodeCount = 1,
* });
* var membership = new Gcp.GkeHub.Membership("membership", new()
* {
* MembershipId = "my-membership",
* Endpoint = new Gcp.GkeHub.Inputs.MembershipEndpointArgs
* {
* GkeCluster = new Gcp.GkeHub.Inputs.MembershipEndpointGkeClusterArgs
* {
* ResourceLink = cluster.Id.Apply(id => $"//container.googleapis.com/{id}"),
* },
* },
* });
* var feature = new Gcp.GkeHub.Feature("feature", new()
* {
* Name = "configmanagement",
* Location = "global",
* Labels =
* {
* { "foo", "bar" },
* },
* });
* var featureMember = new Gcp.GkeHub.FeatureMembership("feature_member", new()
* {
* Location = "global",
* Feature = feature.Name,
* Membership = membership.MembershipId,
* Configmanagement = new Gcp.GkeHub.Inputs.FeatureMembershipConfigmanagementArgs
* {
* Version = "1.15.1",
* ConfigSync = new Gcp.GkeHub.Inputs.FeatureMembershipConfigmanagementConfigSyncArgs
* {
* Oci = new Gcp.GkeHub.Inputs.FeatureMembershipConfigmanagementConfigSyncOciArgs
* {
* SyncRepo = "us-central1-docker.pkg.dev/sample-project/config-repo/config-sync-gke:latest",
* PolicyDir = "config-connector",
* SyncWaitSecs = "20",
* SecretType = "gcpserviceaccount",
* GcpServiceAccountEmail = "[email protected]",
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/gkehub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* cluster, err := container.NewCluster(ctx, "cluster", &container.ClusterArgs{
* Name: pulumi.String("my-cluster"),
* Location: pulumi.String("us-central1-a"),
* InitialNodeCount: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* membership, err := gkehub.NewMembership(ctx, "membership", &gkehub.MembershipArgs{
* MembershipId: pulumi.String("my-membership"),
* Endpoint: &gkehub.MembershipEndpointArgs{
* GkeCluster: &gkehub.MembershipEndpointGkeClusterArgs{
* ResourceLink: cluster.ID().ApplyT(func(id string) (string, error) {
* return fmt.Sprintf("//container.googleapis.com/%v", id), nil
* }).(pulumi.StringOutput),
* },
* },
* })
* if err != nil {
* return err
* }
* feature, err := gkehub.NewFeature(ctx, "feature", &gkehub.FeatureArgs{
* Name: pulumi.String("configmanagement"),
* Location: pulumi.String("global"),
* Labels: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* })
* if err != nil {
* return err
* }
* _, err = gkehub.NewFeatureMembership(ctx, "feature_member", &gkehub.FeatureMembershipArgs{
* Location: pulumi.String("global"),
* Feature: feature.Name,
* Membership: membership.MembershipId,
* Configmanagement: &gkehub.FeatureMembershipConfigmanagementArgs{
* Version: pulumi.String("1.15.1"),
* ConfigSync: &gkehub.FeatureMembershipConfigmanagementConfigSyncArgs{
* Oci: &gkehub.FeatureMembershipConfigmanagementConfigSyncOciArgs{
* SyncRepo: pulumi.String("us-central1-docker.pkg.dev/sample-project/config-repo/config-sync-gke:latest"),
* PolicyDir: pulumi.String("config-connector"),
* SyncWaitSecs: pulumi.String("20"),
* SecretType: pulumi.String("gcpserviceaccount"),
* GcpServiceAccountEmail: pulumi.String("[email protected]"),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.container.Cluster;
* import com.pulumi.gcp.container.ClusterArgs;
* import com.pulumi.gcp.gkehub.Membership;
* import com.pulumi.gcp.gkehub.MembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointGkeClusterArgs;
* import com.pulumi.gcp.gkehub.Feature;
* import com.pulumi.gcp.gkehub.FeatureArgs;
* import com.pulumi.gcp.gkehub.FeatureMembership;
* import com.pulumi.gcp.gkehub.FeatureMembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipConfigmanagementArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipConfigmanagementConfigSyncArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipConfigmanagementConfigSyncOciArgs;
* 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) {
* var cluster = new Cluster("cluster", ClusterArgs.builder()
* .name("my-cluster")
* .location("us-central1-a")
* .initialNodeCount(1)
* .build());
* var membership = new Membership("membership", MembershipArgs.builder()
* .membershipId("my-membership")
* .endpoint(MembershipEndpointArgs.builder()
* .gkeCluster(MembershipEndpointGkeClusterArgs.builder()
* .resourceLink(cluster.id().applyValue(id -> String.format("//container.googleapis.com/%s", id)))
* .build())
* .build())
* .build());
* var feature = new Feature("feature", FeatureArgs.builder()
* .name("configmanagement")
* .location("global")
* .labels(Map.of("foo", "bar"))
* .build());
* var featureMember = new FeatureMembership("featureMember", FeatureMembershipArgs.builder()
* .location("global")
* .feature(feature.name())
* .membership(membership.membershipId())
* .configmanagement(FeatureMembershipConfigmanagementArgs.builder()
* .version("1.15.1")
* .configSync(FeatureMembershipConfigmanagementConfigSyncArgs.builder()
* .oci(FeatureMembershipConfigmanagementConfigSyncOciArgs.builder()
* .syncRepo("us-central1-docker.pkg.dev/sample-project/config-repo/config-sync-gke:latest")
* .policyDir("config-connector")
* .syncWaitSecs("20")
* .secretType("gcpserviceaccount")
* .gcpServiceAccountEmail("[email protected]")
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* cluster:
* type: gcp:container:Cluster
* properties:
* name: my-cluster
* location: us-central1-a
* initialNodeCount: 1
* membership:
* type: gcp:gkehub:Membership
* properties:
* membershipId: my-membership
* endpoint:
* gkeCluster:
* resourceLink: //container.googleapis.com/${cluster.id}
* feature:
* type: gcp:gkehub:Feature
* properties:
* name: configmanagement
* location: global
* labels:
* foo: bar
* featureMember:
* type: gcp:gkehub:FeatureMembership
* name: feature_member
* properties:
* location: global
* feature: ${feature.name}
* membership: ${membership.membershipId}
* configmanagement:
* version: 1.15.1
* configSync:
* oci:
* syncRepo: us-central1-docker.pkg.dev/sample-project/config-repo/config-sync-gke:latest
* policyDir: config-connector
* syncWaitSecs: '20'
* secretType: gcpserviceaccount
* gcpServiceAccountEmail: [email protected]
* ```
*
* ### Multi Cluster Service Discovery
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const feature = new gcp.gkehub.Feature("feature", {
* name: "multiclusterservicediscovery",
* location: "global",
* labels: {
* foo: "bar",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* feature = gcp.gkehub.Feature("feature",
* name="multiclusterservicediscovery",
* location="global",
* labels={
* "foo": "bar",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var feature = new Gcp.GkeHub.Feature("feature", new()
* {
* Name = "multiclusterservicediscovery",
* Location = "global",
* Labels =
* {
* { "foo", "bar" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/gkehub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := gkehub.NewFeature(ctx, "feature", &gkehub.FeatureArgs{
* Name: pulumi.String("multiclusterservicediscovery"),
* Location: pulumi.String("global"),
* Labels: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.gkehub.Feature;
* import com.pulumi.gcp.gkehub.FeatureArgs;
* 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) {
* var feature = new Feature("feature", FeatureArgs.builder()
* .name("multiclusterservicediscovery")
* .location("global")
* .labels(Map.of("foo", "bar"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* feature:
* type: gcp:gkehub:Feature
* properties:
* name: multiclusterservicediscovery
* location: global
* labels:
* foo: bar
* ```
*
* ### Service Mesh
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const cluster = new gcp.container.Cluster("cluster", {
* name: "my-cluster",
* location: "us-central1-a",
* initialNodeCount: 1,
* });
* const membership = new gcp.gkehub.Membership("membership", {
* membershipId: "my-membership",
* endpoint: {
* gkeCluster: {
* resourceLink: pulumi.interpolate`//container.googleapis.com/${cluster.id}`,
* },
* },
* });
* const feature = new gcp.gkehub.Feature("feature", {
* name: "servicemesh",
* location: "global",
* });
* const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
* location: "global",
* feature: feature.name,
* membership: membership.membershipId,
* mesh: {
* management: "MANAGEMENT_AUTOMATIC",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* cluster = gcp.container.Cluster("cluster",
* name="my-cluster",
* location="us-central1-a",
* initial_node_count=1)
* membership = gcp.gkehub.Membership("membership",
* membership_id="my-membership",
* endpoint=gcp.gkehub.MembershipEndpointArgs(
* gke_cluster=gcp.gkehub.MembershipEndpointGkeClusterArgs(
* resource_link=cluster.id.apply(lambda id: f"//container.googleapis.com/{id}"),
* ),
* ))
* feature = gcp.gkehub.Feature("feature",
* name="servicemesh",
* location="global")
* feature_member = gcp.gkehub.FeatureMembership("feature_member",
* location="global",
* feature=feature.name,
* membership=membership.membership_id,
* mesh=gcp.gkehub.FeatureMembershipMeshArgs(
* management="MANAGEMENT_AUTOMATIC",
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var cluster = new Gcp.Container.Cluster("cluster", new()
* {
* Name = "my-cluster",
* Location = "us-central1-a",
* InitialNodeCount = 1,
* });
* var membership = new Gcp.GkeHub.Membership("membership", new()
* {
* MembershipId = "my-membership",
* Endpoint = new Gcp.GkeHub.Inputs.MembershipEndpointArgs
* {
* GkeCluster = new Gcp.GkeHub.Inputs.MembershipEndpointGkeClusterArgs
* {
* ResourceLink = cluster.Id.Apply(id => $"//container.googleapis.com/{id}"),
* },
* },
* });
* var feature = new Gcp.GkeHub.Feature("feature", new()
* {
* Name = "servicemesh",
* Location = "global",
* });
* var featureMember = new Gcp.GkeHub.FeatureMembership("feature_member", new()
* {
* Location = "global",
* Feature = feature.Name,
* Membership = membership.MembershipId,
* Mesh = new Gcp.GkeHub.Inputs.FeatureMembershipMeshArgs
* {
* Management = "MANAGEMENT_AUTOMATIC",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/gkehub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* cluster, err := container.NewCluster(ctx, "cluster", &container.ClusterArgs{
* Name: pulumi.String("my-cluster"),
* Location: pulumi.String("us-central1-a"),
* InitialNodeCount: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* membership, err := gkehub.NewMembership(ctx, "membership", &gkehub.MembershipArgs{
* MembershipId: pulumi.String("my-membership"),
* Endpoint: &gkehub.MembershipEndpointArgs{
* GkeCluster: &gkehub.MembershipEndpointGkeClusterArgs{
* ResourceLink: cluster.ID().ApplyT(func(id string) (string, error) {
* return fmt.Sprintf("//container.googleapis.com/%v", id), nil
* }).(pulumi.StringOutput),
* },
* },
* })
* if err != nil {
* return err
* }
* feature, err := gkehub.NewFeature(ctx, "feature", &gkehub.FeatureArgs{
* Name: pulumi.String("servicemesh"),
* Location: pulumi.String("global"),
* })
* if err != nil {
* return err
* }
* _, err = gkehub.NewFeatureMembership(ctx, "feature_member", &gkehub.FeatureMembershipArgs{
* Location: pulumi.String("global"),
* Feature: feature.Name,
* Membership: membership.MembershipId,
* Mesh: &gkehub.FeatureMembershipMeshArgs{
* Management: pulumi.String("MANAGEMENT_AUTOMATIC"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.container.Cluster;
* import com.pulumi.gcp.container.ClusterArgs;
* import com.pulumi.gcp.gkehub.Membership;
* import com.pulumi.gcp.gkehub.MembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointGkeClusterArgs;
* import com.pulumi.gcp.gkehub.Feature;
* import com.pulumi.gcp.gkehub.FeatureArgs;
* import com.pulumi.gcp.gkehub.FeatureMembership;
* import com.pulumi.gcp.gkehub.FeatureMembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipMeshArgs;
* 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) {
* var cluster = new Cluster("cluster", ClusterArgs.builder()
* .name("my-cluster")
* .location("us-central1-a")
* .initialNodeCount(1)
* .build());
* var membership = new Membership("membership", MembershipArgs.builder()
* .membershipId("my-membership")
* .endpoint(MembershipEndpointArgs.builder()
* .gkeCluster(MembershipEndpointGkeClusterArgs.builder()
* .resourceLink(cluster.id().applyValue(id -> String.format("//container.googleapis.com/%s", id)))
* .build())
* .build())
* .build());
* var feature = new Feature("feature", FeatureArgs.builder()
* .name("servicemesh")
* .location("global")
* .build());
* var featureMember = new FeatureMembership("featureMember", FeatureMembershipArgs.builder()
* .location("global")
* .feature(feature.name())
* .membership(membership.membershipId())
* .mesh(FeatureMembershipMeshArgs.builder()
* .management("MANAGEMENT_AUTOMATIC")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* cluster:
* type: gcp:container:Cluster
* properties:
* name: my-cluster
* location: us-central1-a
* initialNodeCount: 1
* membership:
* type: gcp:gkehub:Membership
* properties:
* membershipId: my-membership
* endpoint:
* gkeCluster:
* resourceLink: //container.googleapis.com/${cluster.id}
* feature:
* type: gcp:gkehub:Feature
* properties:
* name: servicemesh
* location: global
* featureMember:
* type: gcp:gkehub:FeatureMembership
* name: feature_member
* properties:
* location: global
* feature: ${feature.name}
* membership: ${membership.membershipId}
* mesh:
* management: MANAGEMENT_AUTOMATIC
* ```
*
* ### Config Management With Regional Membership
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const cluster = new gcp.container.Cluster("cluster", {
* name: "my-cluster",
* location: "us-central1-a",
* initialNodeCount: 1,
* });
* const membership = new gcp.gkehub.Membership("membership", {
* membershipId: "my-membership",
* location: "us-central1",
* endpoint: {
* gkeCluster: {
* resourceLink: pulumi.interpolate`//container.googleapis.com/${cluster.id}`,
* },
* },
* });
* const feature = new gcp.gkehub.Feature("feature", {
* name: "configmanagement",
* location: "global",
* labels: {
* foo: "bar",
* },
* });
* const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
* location: "global",
* feature: feature.name,
* membership: membership.membershipId,
* membershipLocation: membership.location,
* configmanagement: {
* version: "1.6.2",
* configSync: {
* git: {
* syncRepo: "https://github.com/hashicorp/terraform",
* },
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* cluster = gcp.container.Cluster("cluster",
* name="my-cluster",
* location="us-central1-a",
* initial_node_count=1)
* membership = gcp.gkehub.Membership("membership",
* membership_id="my-membership",
* location="us-central1",
* endpoint=gcp.gkehub.MembershipEndpointArgs(
* gke_cluster=gcp.gkehub.MembershipEndpointGkeClusterArgs(
* resource_link=cluster.id.apply(lambda id: f"//container.googleapis.com/{id}"),
* ),
* ))
* feature = gcp.gkehub.Feature("feature",
* name="configmanagement",
* location="global",
* labels={
* "foo": "bar",
* })
* feature_member = gcp.gkehub.FeatureMembership("feature_member",
* location="global",
* feature=feature.name,
* membership=membership.membership_id,
* membership_location=membership.location,
* configmanagement=gcp.gkehub.FeatureMembershipConfigmanagementArgs(
* version="1.6.2",
* config_sync=gcp.gkehub.FeatureMembershipConfigmanagementConfigSyncArgs(
* git=gcp.gkehub.FeatureMembershipConfigmanagementConfigSyncGitArgs(
* sync_repo="https://github.com/hashicorp/terraform",
* ),
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var cluster = new Gcp.Container.Cluster("cluster", new()
* {
* Name = "my-cluster",
* Location = "us-central1-a",
* InitialNodeCount = 1,
* });
* var membership = new Gcp.GkeHub.Membership("membership", new()
* {
* MembershipId = "my-membership",
* Location = "us-central1",
* Endpoint = new Gcp.GkeHub.Inputs.MembershipEndpointArgs
* {
* GkeCluster = new Gcp.GkeHub.Inputs.MembershipEndpointGkeClusterArgs
* {
* ResourceLink = cluster.Id.Apply(id => $"//container.googleapis.com/{id}"),
* },
* },
* });
* var feature = new Gcp.GkeHub.Feature("feature", new()
* {
* Name = "configmanagement",
* Location = "global",
* Labels =
* {
* { "foo", "bar" },
* },
* });
* var featureMember = new Gcp.GkeHub.FeatureMembership("feature_member", new()
* {
* Location = "global",
* Feature = feature.Name,
* Membership = membership.MembershipId,
* MembershipLocation = membership.Location,
* Configmanagement = new Gcp.GkeHub.Inputs.FeatureMembershipConfigmanagementArgs
* {
* Version = "1.6.2",
* ConfigSync = new Gcp.GkeHub.Inputs.FeatureMembershipConfigmanagementConfigSyncArgs
* {
* Git = new Gcp.GkeHub.Inputs.FeatureMembershipConfigmanagementConfigSyncGitArgs
* {
* SyncRepo = "https://github.com/hashicorp/terraform",
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/gkehub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* cluster, err := container.NewCluster(ctx, "cluster", &container.ClusterArgs{
* Name: pulumi.String("my-cluster"),
* Location: pulumi.String("us-central1-a"),
* InitialNodeCount: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* membership, err := gkehub.NewMembership(ctx, "membership", &gkehub.MembershipArgs{
* MembershipId: pulumi.String("my-membership"),
* Location: pulumi.String("us-central1"),
* Endpoint: &gkehub.MembershipEndpointArgs{
* GkeCluster: &gkehub.MembershipEndpointGkeClusterArgs{
* ResourceLink: cluster.ID().ApplyT(func(id string) (string, error) {
* return fmt.Sprintf("//container.googleapis.com/%v", id), nil
* }).(pulumi.StringOutput),
* },
* },
* })
* if err != nil {
* return err
* }
* feature, err := gkehub.NewFeature(ctx, "feature", &gkehub.FeatureArgs{
* Name: pulumi.String("configmanagement"),
* Location: pulumi.String("global"),
* Labels: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* })
* if err != nil {
* return err
* }
* _, err = gkehub.NewFeatureMembership(ctx, "feature_member", &gkehub.FeatureMembershipArgs{
* Location: pulumi.String("global"),
* Feature: feature.Name,
* Membership: membership.MembershipId,
* MembershipLocation: membership.Location,
* Configmanagement: &gkehub.FeatureMembershipConfigmanagementArgs{
* Version: pulumi.String("1.6.2"),
* ConfigSync: &gkehub.FeatureMembershipConfigmanagementConfigSyncArgs{
* Git: &gkehub.FeatureMembershipConfigmanagementConfigSyncGitArgs{
* SyncRepo: pulumi.String("https://github.com/hashicorp/terraform"),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.container.Cluster;
* import com.pulumi.gcp.container.ClusterArgs;
* import com.pulumi.gcp.gkehub.Membership;
* import com.pulumi.gcp.gkehub.MembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointGkeClusterArgs;
* import com.pulumi.gcp.gkehub.Feature;
* import com.pulumi.gcp.gkehub.FeatureArgs;
* import com.pulumi.gcp.gkehub.FeatureMembership;
* import com.pulumi.gcp.gkehub.FeatureMembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipConfigmanagementArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipConfigmanagementConfigSyncArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipConfigmanagementConfigSyncGitArgs;
* 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) {
* var cluster = new Cluster("cluster", ClusterArgs.builder()
* .name("my-cluster")
* .location("us-central1-a")
* .initialNodeCount(1)
* .build());
* var membership = new Membership("membership", MembershipArgs.builder()
* .membershipId("my-membership")
* .location("us-central1")
* .endpoint(MembershipEndpointArgs.builder()
* .gkeCluster(MembershipEndpointGkeClusterArgs.builder()
* .resourceLink(cluster.id().applyValue(id -> String.format("//container.googleapis.com/%s", id)))
* .build())
* .build())
* .build());
* var feature = new Feature("feature", FeatureArgs.builder()
* .name("configmanagement")
* .location("global")
* .labels(Map.of("foo", "bar"))
* .build());
* var featureMember = new FeatureMembership("featureMember", FeatureMembershipArgs.builder()
* .location("global")
* .feature(feature.name())
* .membership(membership.membershipId())
* .membershipLocation(membership.location())
* .configmanagement(FeatureMembershipConfigmanagementArgs.builder()
* .version("1.6.2")
* .configSync(FeatureMembershipConfigmanagementConfigSyncArgs.builder()
* .git(FeatureMembershipConfigmanagementConfigSyncGitArgs.builder()
* .syncRepo("https://github.com/hashicorp/terraform")
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* cluster:
* type: gcp:container:Cluster
* properties:
* name: my-cluster
* location: us-central1-a
* initialNodeCount: 1
* membership:
* type: gcp:gkehub:Membership
* properties:
* membershipId: my-membership
* location: us-central1
* endpoint:
* gkeCluster:
* resourceLink: //container.googleapis.com/${cluster.id}
* feature:
* type: gcp:gkehub:Feature
* properties:
* name: configmanagement
* location: global
* labels:
* foo: bar
* featureMember:
* type: gcp:gkehub:FeatureMembership
* name: feature_member
* properties:
* location: global
* feature: ${feature.name}
* membership: ${membership.membershipId}
* membershipLocation: ${membership.location}
* configmanagement:
* version: 1.6.2
* configSync:
* git:
* syncRepo: https://github.com/hashicorp/terraform
* ```
*
* ### Policy Controller With Minimal Configuration
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const cluster = new gcp.container.Cluster("cluster", {
* name: "my-cluster",
* location: "us-central1-a",
* initialNodeCount: 1,
* });
* const membership = new gcp.gkehub.Membership("membership", {
* membershipId: "my-membership",
* endpoint: {
* gkeCluster: {
* resourceLink: pulumi.interpolate`//container.googleapis.com/${cluster.id}`,
* },
* },
* });
* const feature = new gcp.gkehub.Feature("feature", {
* name: "policycontroller",
* location: "global",
* });
* const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
* location: "global",
* feature: feature.name,
* membership: membership.membershipId,
* policycontroller: {
* policyControllerHubConfig: {
* installSpec: "INSTALL_SPEC_ENABLED",
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* cluster = gcp.container.Cluster("cluster",
* name="my-cluster",
* location="us-central1-a",
* initial_node_count=1)
* membership = gcp.gkehub.Membership("membership",
* membership_id="my-membership",
* endpoint=gcp.gkehub.MembershipEndpointArgs(
* gke_cluster=gcp.gkehub.MembershipEndpointGkeClusterArgs(
* resource_link=cluster.id.apply(lambda id: f"//container.googleapis.com/{id}"),
* ),
* ))
* feature = gcp.gkehub.Feature("feature",
* name="policycontroller",
* location="global")
* feature_member = gcp.gkehub.FeatureMembership("feature_member",
* location="global",
* feature=feature.name,
* membership=membership.membership_id,
* policycontroller=gcp.gkehub.FeatureMembershipPolicycontrollerArgs(
* policy_controller_hub_config=gcp.gkehub.FeatureMembershipPolicycontrollerPolicyControllerHubConfigArgs(
* install_spec="INSTALL_SPEC_ENABLED",
* ),
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var cluster = new Gcp.Container.Cluster("cluster", new()
* {
* Name = "my-cluster",
* Location = "us-central1-a",
* InitialNodeCount = 1,
* });
* var membership = new Gcp.GkeHub.Membership("membership", new()
* {
* MembershipId = "my-membership",
* Endpoint = new Gcp.GkeHub.Inputs.MembershipEndpointArgs
* {
* GkeCluster = new Gcp.GkeHub.Inputs.MembershipEndpointGkeClusterArgs
* {
* ResourceLink = cluster.Id.Apply(id => $"//container.googleapis.com/{id}"),
* },
* },
* });
* var feature = new Gcp.GkeHub.Feature("feature", new()
* {
* Name = "policycontroller",
* Location = "global",
* });
* var featureMember = new Gcp.GkeHub.FeatureMembership("feature_member", new()
* {
* Location = "global",
* Feature = feature.Name,
* Membership = membership.MembershipId,
* Policycontroller = new Gcp.GkeHub.Inputs.FeatureMembershipPolicycontrollerArgs
* {
* PolicyControllerHubConfig = new Gcp.GkeHub.Inputs.FeatureMembershipPolicycontrollerPolicyControllerHubConfigArgs
* {
* InstallSpec = "INSTALL_SPEC_ENABLED",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/gkehub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* cluster, err := container.NewCluster(ctx, "cluster", &container.ClusterArgs{
* Name: pulumi.String("my-cluster"),
* Location: pulumi.String("us-central1-a"),
* InitialNodeCount: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* membership, err := gkehub.NewMembership(ctx, "membership", &gkehub.MembershipArgs{
* MembershipId: pulumi.String("my-membership"),
* Endpoint: &gkehub.MembershipEndpointArgs{
* GkeCluster: &gkehub.MembershipEndpointGkeClusterArgs{
* ResourceLink: cluster.ID().ApplyT(func(id string) (string, error) {
* return fmt.Sprintf("//container.googleapis.com/%v", id), nil
* }).(pulumi.StringOutput),
* },
* },
* })
* if err != nil {
* return err
* }
* feature, err := gkehub.NewFeature(ctx, "feature", &gkehub.FeatureArgs{
* Name: pulumi.String("policycontroller"),
* Location: pulumi.String("global"),
* })
* if err != nil {
* return err
* }
* _, err = gkehub.NewFeatureMembership(ctx, "feature_member", &gkehub.FeatureMembershipArgs{
* Location: pulumi.String("global"),
* Feature: feature.Name,
* Membership: membership.MembershipId,
* Policycontroller: &gkehub.FeatureMembershipPolicycontrollerArgs{
* PolicyControllerHubConfig: &gkehub.FeatureMembershipPolicycontrollerPolicyControllerHubConfigArgs{
* InstallSpec: pulumi.String("INSTALL_SPEC_ENABLED"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.container.Cluster;
* import com.pulumi.gcp.container.ClusterArgs;
* import com.pulumi.gcp.gkehub.Membership;
* import com.pulumi.gcp.gkehub.MembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointGkeClusterArgs;
* import com.pulumi.gcp.gkehub.Feature;
* import com.pulumi.gcp.gkehub.FeatureArgs;
* import com.pulumi.gcp.gkehub.FeatureMembership;
* import com.pulumi.gcp.gkehub.FeatureMembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipPolicycontrollerArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipPolicycontrollerPolicyControllerHubConfigArgs;
* 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) {
* var cluster = new Cluster("cluster", ClusterArgs.builder()
* .name("my-cluster")
* .location("us-central1-a")
* .initialNodeCount(1)
* .build());
* var membership = new Membership("membership", MembershipArgs.builder()
* .membershipId("my-membership")
* .endpoint(MembershipEndpointArgs.builder()
* .gkeCluster(MembershipEndpointGkeClusterArgs.builder()
* .resourceLink(cluster.id().applyValue(id -> String.format("//container.googleapis.com/%s", id)))
* .build())
* .build())
* .build());
* var feature = new Feature("feature", FeatureArgs.builder()
* .name("policycontroller")
* .location("global")
* .build());
* var featureMember = new FeatureMembership("featureMember", FeatureMembershipArgs.builder()
* .location("global")
* .feature(feature.name())
* .membership(membership.membershipId())
* .policycontroller(FeatureMembershipPolicycontrollerArgs.builder()
* .policyControllerHubConfig(FeatureMembershipPolicycontrollerPolicyControllerHubConfigArgs.builder()
* .installSpec("INSTALL_SPEC_ENABLED")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* cluster:
* type: gcp:container:Cluster
* properties:
* name: my-cluster
* location: us-central1-a
* initialNodeCount: 1
* membership:
* type: gcp:gkehub:Membership
* properties:
* membershipId: my-membership
* endpoint:
* gkeCluster:
* resourceLink: //container.googleapis.com/${cluster.id}
* feature:
* type: gcp:gkehub:Feature
* properties:
* name: policycontroller
* location: global
* featureMember:
* type: gcp:gkehub:FeatureMembership
* name: feature_member
* properties:
* location: global
* feature: ${feature.name}
* membership: ${membership.membershipId}
* policycontroller:
* policyControllerHubConfig:
* installSpec: INSTALL_SPEC_ENABLED
* ```
*
* ### Policy Controller With Custom Configurations
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const cluster = new gcp.container.Cluster("cluster", {
* name: "my-cluster",
* location: "us-central1-a",
* initialNodeCount: 1,
* });
* const membership = new gcp.gkehub.Membership("membership", {
* membershipId: "my-membership",
* endpoint: {
* gkeCluster: {
* resourceLink: pulumi.interpolate`//container.googleapis.com/${cluster.id}`,
* },
* },
* });
* const feature = new gcp.gkehub.Feature("feature", {
* name: "policycontroller",
* location: "global",
* });
* const featureMember = new gcp.gkehub.FeatureMembership("feature_member", {
* location: "global",
* feature: feature.name,
* membership: membership.membershipId,
* policycontroller: {
* policyControllerHubConfig: {
* installSpec: "INSTALL_SPEC_SUSPENDED",
* policyContent: {
* templateLibrary: {
* installation: "NOT_INSTALLED",
* },
* },
* constraintViolationLimit: 50,
* auditIntervalSeconds: 120,
* referentialRulesEnabled: true,
* logDeniesEnabled: true,
* mutationEnabled: true,
* },
* version: "1.17.0",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* cluster = gcp.container.Cluster("cluster",
* name="my-cluster",
* location="us-central1-a",
* initial_node_count=1)
* membership = gcp.gkehub.Membership("membership",
* membership_id="my-membership",
* endpoint=gcp.gkehub.MembershipEndpointArgs(
* gke_cluster=gcp.gkehub.MembershipEndpointGkeClusterArgs(
* resource_link=cluster.id.apply(lambda id: f"//container.googleapis.com/{id}"),
* ),
* ))
* feature = gcp.gkehub.Feature("feature",
* name="policycontroller",
* location="global")
* feature_member = gcp.gkehub.FeatureMembership("feature_member",
* location="global",
* feature=feature.name,
* membership=membership.membership_id,
* policycontroller=gcp.gkehub.FeatureMembershipPolicycontrollerArgs(
* policy_controller_hub_config=gcp.gkehub.FeatureMembershipPolicycontrollerPolicyControllerHubConfigArgs(
* install_spec="INSTALL_SPEC_SUSPENDED",
* policy_content=gcp.gkehub.FeatureMembershipPolicycontrollerPolicyControllerHubConfigPolicyContentArgs(
* template_library=gcp.gkehub.FeatureMembershipPolicycontrollerPolicyControllerHubConfigPolicyContentTemplateLibraryArgs(
* installation="NOT_INSTALLED",
* ),
* ),
* constraint_violation_limit=50,
* audit_interval_seconds=120,
* referential_rules_enabled=True,
* log_denies_enabled=True,
* mutation_enabled=True,
* ),
* version="1.17.0",
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var cluster = new Gcp.Container.Cluster("cluster", new()
* {
* Name = "my-cluster",
* Location = "us-central1-a",
* InitialNodeCount = 1,
* });
* var membership = new Gcp.GkeHub.Membership("membership", new()
* {
* MembershipId = "my-membership",
* Endpoint = new Gcp.GkeHub.Inputs.MembershipEndpointArgs
* {
* GkeCluster = new Gcp.GkeHub.Inputs.MembershipEndpointGkeClusterArgs
* {
* ResourceLink = cluster.Id.Apply(id => $"//container.googleapis.com/{id}"),
* },
* },
* });
* var feature = new Gcp.GkeHub.Feature("feature", new()
* {
* Name = "policycontroller",
* Location = "global",
* });
* var featureMember = new Gcp.GkeHub.FeatureMembership("feature_member", new()
* {
* Location = "global",
* Feature = feature.Name,
* Membership = membership.MembershipId,
* Policycontroller = new Gcp.GkeHub.Inputs.FeatureMembershipPolicycontrollerArgs
* {
* PolicyControllerHubConfig = new Gcp.GkeHub.Inputs.FeatureMembershipPolicycontrollerPolicyControllerHubConfigArgs
* {
* InstallSpec = "INSTALL_SPEC_SUSPENDED",
* PolicyContent = new Gcp.GkeHub.Inputs.FeatureMembershipPolicycontrollerPolicyControllerHubConfigPolicyContentArgs
* {
* TemplateLibrary = new Gcp.GkeHub.Inputs.FeatureMembershipPolicycontrollerPolicyControllerHubConfigPolicyContentTemplateLibraryArgs
* {
* Installation = "NOT_INSTALLED",
* },
* },
* ConstraintViolationLimit = 50,
* AuditIntervalSeconds = 120,
* ReferentialRulesEnabled = true,
* LogDeniesEnabled = true,
* MutationEnabled = true,
* },
* Version = "1.17.0",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/gkehub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* cluster, err := container.NewCluster(ctx, "cluster", &container.ClusterArgs{
* Name: pulumi.String("my-cluster"),
* Location: pulumi.String("us-central1-a"),
* InitialNodeCount: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* membership, err := gkehub.NewMembership(ctx, "membership", &gkehub.MembershipArgs{
* MembershipId: pulumi.String("my-membership"),
* Endpoint: &gkehub.MembershipEndpointArgs{
* GkeCluster: &gkehub.MembershipEndpointGkeClusterArgs{
* ResourceLink: cluster.ID().ApplyT(func(id string) (string, error) {
* return fmt.Sprintf("//container.googleapis.com/%v", id), nil
* }).(pulumi.StringOutput),
* },
* },
* })
* if err != nil {
* return err
* }
* feature, err := gkehub.NewFeature(ctx, "feature", &gkehub.FeatureArgs{
* Name: pulumi.String("policycontroller"),
* Location: pulumi.String("global"),
* })
* if err != nil {
* return err
* }
* _, err = gkehub.NewFeatureMembership(ctx, "feature_member", &gkehub.FeatureMembershipArgs{
* Location: pulumi.String("global"),
* Feature: feature.Name,
* Membership: membership.MembershipId,
* Policycontroller: &gkehub.FeatureMembershipPolicycontrollerArgs{
* PolicyControllerHubConfig: &gkehub.FeatureMembershipPolicycontrollerPolicyControllerHubConfigArgs{
* InstallSpec: pulumi.String("INSTALL_SPEC_SUSPENDED"),
* PolicyContent: &gkehub.FeatureMembershipPolicycontrollerPolicyControllerHubConfigPolicyContentArgs{
* TemplateLibrary: &gkehub.FeatureMembershipPolicycontrollerPolicyControllerHubConfigPolicyContentTemplateLibraryArgs{
* Installation: pulumi.String("NOT_INSTALLED"),
* },
* },
* ConstraintViolationLimit: pulumi.Int(50),
* AuditIntervalSeconds: pulumi.Int(120),
* ReferentialRulesEnabled: pulumi.Bool(true),
* LogDeniesEnabled: pulumi.Bool(true),
* MutationEnabled: pulumi.Bool(true),
* },
* Version: pulumi.String("1.17.0"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.container.Cluster;
* import com.pulumi.gcp.container.ClusterArgs;
* import com.pulumi.gcp.gkehub.Membership;
* import com.pulumi.gcp.gkehub.MembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointArgs;
* import com.pulumi.gcp.gkehub.inputs.MembershipEndpointGkeClusterArgs;
* import com.pulumi.gcp.gkehub.Feature;
* import com.pulumi.gcp.gkehub.FeatureArgs;
* import com.pulumi.gcp.gkehub.FeatureMembership;
* import com.pulumi.gcp.gkehub.FeatureMembershipArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipPolicycontrollerArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipPolicycontrollerPolicyControllerHubConfigArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipPolicycontrollerPolicyControllerHubConfigPolicyContentArgs;
* import com.pulumi.gcp.gkehub.inputs.FeatureMembershipPolicycontrollerPolicyControllerHubConfigPolicyContentTemplateLibraryArgs;
* 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) {
* var cluster = new Cluster("cluster", ClusterArgs.builder()
* .name("my-cluster")
* .location("us-central1-a")
* .initialNodeCount(1)
* .build());
* var membership = new Membership("membership", MembershipArgs.builder()
* .membershipId("my-membership")
* .endpoint(MembershipEndpointArgs.builder()
* .gkeCluster(MembershipEndpointGkeClusterArgs.builder()
* .resourceLink(cluster.id().applyValue(id -> String.format("//container.googleapis.com/%s", id)))
* .build())
* .build())
* .build());
* var feature = new Feature("feature", FeatureArgs.builder()
* .name("policycontroller")
* .location("global")
* .build());
* var featureMember = new FeatureMembership("featureMember", FeatureMembershipArgs.builder()
* .location("global")
* .feature(feature.name())
* .membership(membership.membershipId())
* .policycontroller(FeatureMembershipPolicycontrollerArgs.builder()
* .policyControllerHubConfig(FeatureMembershipPolicycontrollerPolicyControllerHubConfigArgs.builder()
* .installSpec("INSTALL_SPEC_SUSPENDED")
* .policyContent(FeatureMembershipPolicycontrollerPolicyControllerHubConfigPolicyContentArgs.builder()
* .templateLibrary(FeatureMembershipPolicycontrollerPolicyControllerHubConfigPolicyContentTemplateLibraryArgs.builder()
* .installation("NOT_INSTALLED")
* .build())
* .build())
* .constraintViolationLimit(50)
* .auditIntervalSeconds(120)
* .referentialRulesEnabled(true)
* .logDeniesEnabled(true)
* .mutationEnabled(true)
* .build())
* .version("1.17.0")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* cluster:
* type: gcp:container:Cluster
* properties:
* name: my-cluster
* location: us-central1-a
* initialNodeCount: 1
* membership:
* type: gcp:gkehub:Membership
* properties:
* membershipId: my-membership
* endpoint:
* gkeCluster:
* resourceLink: //container.googleapis.com/${cluster.id}
* feature:
* type: gcp:gkehub:Feature
* properties:
* name: policycontroller
* location: global
* featureMember:
* type: gcp:gkehub:FeatureMembership
* name: feature_member
* properties:
* location: global
* feature: ${feature.name}
* membership: ${membership.membershipId}
* policycontroller:
* policyControllerHubConfig:
* installSpec: INSTALL_SPEC_SUSPENDED
* policyContent:
* templateLibrary:
* installation: NOT_INSTALLED
* constraintViolationLimit: 50
* auditIntervalSeconds: 120
* referentialRulesEnabled: true
* logDeniesEnabled: true
* mutationEnabled: true
* version: 1.17.0
* ```
*
* ## Import
* FeatureMembership can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/features/{{feature}}/membershipId/{{membership}}`
* * `{{project}}/{{location}}/{{feature}}/{{membership}}`
* * `{{location}}/{{feature}}/{{membership}}`
* When using the `pulumi import` command, FeatureMembership can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:gkehub/featureMembership:FeatureMembership default projects/{{project}}/locations/{{location}}/features/{{feature}}/membershipId/{{membership}}
* ```
* ```sh
* $ pulumi import gcp:gkehub/featureMembership:FeatureMembership default {{project}}/{{location}}/{{feature}}/{{membership}}
* ```
* ```sh
* $ pulumi import gcp:gkehub/featureMembership:FeatureMembership default {{location}}/{{feature}}/{{membership}}
* ```
*/
public class FeatureMembership internal constructor(
override val javaResource: com.pulumi.gcp.gkehub.FeatureMembership,
) : KotlinCustomResource(javaResource, FeatureMembershipMapper) {
/**
* Config Management-specific spec. Structure is documented below.
*/
public val configmanagement: Output?
get() = javaResource.configmanagement().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> featureMembershipConfigmanagementToKotlin(args0) })
}).orElse(null)
})
/**
* The name of the feature
*/
public val feature: Output
get() = javaResource.feature().applyValue({ args0 -> args0 })
/**
* The location of the feature
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* The name of the membership
*/
public val membership: Output
get() = javaResource.membership().applyValue({ args0 -> args0 })
/**
* The location of the membership, for example, "us-central1". Default is "global".
*/
public val membershipLocation: Output?
get() = javaResource.membershipLocation().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Service mesh specific spec. Structure is documented below.
*/
public val mesh: Output?
get() = javaResource.mesh().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
featureMembershipMeshToKotlin(args0)
})
}).orElse(null)
})
/**
* Policy Controller-specific spec. Structure is documented below.
*/
public val policycontroller: Output?
get() = javaResource.policycontroller().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> featureMembershipPolicycontrollerToKotlin(args0) })
}).orElse(null)
})
/**
* The project of the feature
*/
public val project: Output
get() = javaResource.project().applyValue({ args0 -> args0 })
}
public object FeatureMembershipMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.gcp.gkehub.FeatureMembership::class == javaResource::class
override fun map(javaResource: Resource): FeatureMembership = FeatureMembership(
javaResource as
com.pulumi.gcp.gkehub.FeatureMembership,
)
}
/**
* @see [FeatureMembership].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [FeatureMembership].
*/
public suspend fun featureMembership(
name: String,
block: suspend FeatureMembershipResourceBuilder.() -> Unit,
): FeatureMembership {
val builder = FeatureMembershipResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [FeatureMembership].
* @param name The _unique_ name of the resulting resource.
*/
public fun featureMembership(name: String): FeatureMembership {
val builder = FeatureMembershipResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy