Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
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.container.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.container.ClusterArgs.builder
import com.pulumi.gcp.container.kotlin.inputs.ClusterAddonsConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterAddonsConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterAuthenticatorGroupsConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterAuthenticatorGroupsConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterBinaryAuthorizationArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterBinaryAuthorizationArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterClusterAutoscalingArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterClusterAutoscalingArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterClusterTelemetryArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterClusterTelemetryArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterConfidentialNodesArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterConfidentialNodesArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterCostManagementConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterCostManagementConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterDatabaseEncryptionArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterDatabaseEncryptionArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterDefaultSnatStatusArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterDefaultSnatStatusArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterDnsConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterDnsConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterEnableK8sBetaApisArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterEnableK8sBetaApisArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterFleetArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterFleetArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterGatewayApiConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterGatewayApiConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterIdentityServiceConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterIdentityServiceConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterIpAllocationPolicyArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterIpAllocationPolicyArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterLoggingConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterLoggingConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterMaintenancePolicyArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterMaintenancePolicyArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterMasterAuthArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterMasterAuthArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterMasterAuthorizedNetworksConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterMasterAuthorizedNetworksConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterMeshCertificatesArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterMeshCertificatesArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterMonitoringConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterMonitoringConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterNetworkPolicyArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterNetworkPolicyArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterNodeConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterNodeConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterNodePoolArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterNodePoolArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterNodePoolAutoConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterNodePoolAutoConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterNodePoolDefaultsArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterNodePoolDefaultsArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterNotificationConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterNotificationConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterPodSecurityPolicyConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterPodSecurityPolicyConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterPrivateClusterConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterPrivateClusterConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterProtectConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterProtectConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterReleaseChannelArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterReleaseChannelArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterResourceUsageExportConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterResourceUsageExportConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterSecurityPostureConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterSecurityPostureConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterServiceExternalIpsConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterServiceExternalIpsConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterTpuConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterTpuConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterVerticalPodAutoscalingArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterVerticalPodAutoscalingArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterWorkloadAltsConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterWorkloadAltsConfigArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.ClusterWorkloadIdentityConfigArgs
import com.pulumi.gcp.container.kotlin.inputs.ClusterWorkloadIdentityConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Manages a Google Kubernetes Engine (GKE) cluster.
* To get more information about GKE clusters, see:
* * [The API reference](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters)
* * How-to guides
* * [GKE overview](https://cloud.google.com/kubernetes-engine/docs/concepts/kubernetes-engine-overview)
* * [About cluster configuration choices](https://cloud.google.com/kubernetes-engine/docs/concepts/types-of-clusters)
* > On version 5.0.0+ of the provider, you must explicitly set `deletion_protection = false`
* and run `pulumi up` to write the field to state in order to destroy a cluster.
* > All arguments and attributes (including certificate outputs) will be stored in the raw state as
* plaintext. [Read more about secrets in state](https://www.pulumi.com/docs/intro/concepts/programming-model/#secrets).
* ## Example Usage
* ### With A Separately Managed Node Pool (Recommended)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.serviceaccount.Account("default", {
* accountId: "service-account-id",
* displayName: "Service Account",
* });
* const primary = new gcp.container.Cluster("primary", {
* name: "my-gke-cluster",
* location: "us-central1",
* removeDefaultNodePool: true,
* initialNodeCount: 1,
* });
* const primaryPreemptibleNodes = new gcp.container.NodePool("primary_preemptible_nodes", {
* name: "my-node-pool",
* location: "us-central1",
* cluster: primary.name,
* nodeCount: 1,
* nodeConfig: {
* preemptible: true,
* machineType: "e2-medium",
* serviceAccount: _default.email,
* oauthScopes: ["https://www.googleapis.com/auth/cloud-platform"],
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.serviceaccount.Account("default",
* account_id="service-account-id",
* display_name="Service Account")
* primary = gcp.container.Cluster("primary",
* name="my-gke-cluster",
* location="us-central1",
* remove_default_node_pool=True,
* initial_node_count=1)
* primary_preemptible_nodes = gcp.container.NodePool("primary_preemptible_nodes",
* name="my-node-pool",
* location="us-central1",
* cluster=primary.name,
* node_count=1,
* node_config=gcp.container.NodePoolNodeConfigArgs(
* preemptible=True,
* machine_type="e2-medium",
* service_account=default.email,
* oauth_scopes=["https://www.googleapis.com/auth/cloud-platform"],
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.ServiceAccount.Account("default", new()
* {
* AccountId = "service-account-id",
* DisplayName = "Service Account",
* });
* var primary = new Gcp.Container.Cluster("primary", new()
* {
* Name = "my-gke-cluster",
* Location = "us-central1",
* RemoveDefaultNodePool = true,
* InitialNodeCount = 1,
* });
* var primaryPreemptibleNodes = new Gcp.Container.NodePool("primary_preemptible_nodes", new()
* {
* Name = "my-node-pool",
* Location = "us-central1",
* Cluster = primary.Name,
* NodeCount = 1,
* NodeConfig = new Gcp.Container.Inputs.NodePoolNodeConfigArgs
* {
* Preemptible = true,
* MachineType = "e2-medium",
* ServiceAccount = @default.Email,
* OauthScopes = new[]
* {
* "https://www.googleapis.com/auth/cloud-platform",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/serviceaccount"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := serviceaccount.NewAccount(ctx, "default", &serviceaccount.AccountArgs{
* AccountId: pulumi.String("service-account-id"),
* DisplayName: pulumi.String("Service Account"),
* })
* if err != nil {
* return err
* }
* primary, err := container.NewCluster(ctx, "primary", &container.ClusterArgs{
* Name: pulumi.String("my-gke-cluster"),
* Location: pulumi.String("us-central1"),
* RemoveDefaultNodePool: pulumi.Bool(true),
* InitialNodeCount: pulumi.Int(1),
* })
* if err != nil {
* return err
* }
* _, err = container.NewNodePool(ctx, "primary_preemptible_nodes", &container.NodePoolArgs{
* Name: pulumi.String("my-node-pool"),
* Location: pulumi.String("us-central1"),
* Cluster: primary.Name,
* NodeCount: pulumi.Int(1),
* NodeConfig: &container.NodePoolNodeConfigArgs{
* Preemptible: pulumi.Bool(true),
* MachineType: pulumi.String("e2-medium"),
* ServiceAccount: _default.Email,
* OauthScopes: pulumi.StringArray{
* pulumi.String("https://www.googleapis.com/auth/cloud-platform"),
* },
* },
* })
* 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.serviceaccount.Account;
* import com.pulumi.gcp.serviceaccount.AccountArgs;
* import com.pulumi.gcp.container.Cluster;
* import com.pulumi.gcp.container.ClusterArgs;
* import com.pulumi.gcp.container.NodePool;
* import com.pulumi.gcp.container.NodePoolArgs;
* import com.pulumi.gcp.container.inputs.NodePoolNodeConfigArgs;
* 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 default_ = new Account("default", AccountArgs.builder()
* .accountId("service-account-id")
* .displayName("Service Account")
* .build());
* var primary = new Cluster("primary", ClusterArgs.builder()
* .name("my-gke-cluster")
* .location("us-central1")
* .removeDefaultNodePool(true)
* .initialNodeCount(1)
* .build());
* var primaryPreemptibleNodes = new NodePool("primaryPreemptibleNodes", NodePoolArgs.builder()
* .name("my-node-pool")
* .location("us-central1")
* .cluster(primary.name())
* .nodeCount(1)
* .nodeConfig(NodePoolNodeConfigArgs.builder()
* .preemptible(true)
* .machineType("e2-medium")
* .serviceAccount(default_.email())
* .oauthScopes("https://www.googleapis.com/auth/cloud-platform")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:serviceaccount:Account
* properties:
* accountId: service-account-id
* displayName: Service Account
* primary:
* type: gcp:container:Cluster
* properties:
* name: my-gke-cluster
* location: us-central1
* removeDefaultNodePool: true
* initialNodeCount: 1
* primaryPreemptibleNodes:
* type: gcp:container:NodePool
* name: primary_preemptible_nodes
* properties:
* name: my-node-pool
* location: us-central1
* cluster: ${primary.name}
* nodeCount: 1
* nodeConfig:
* preemptible: true
* machineType: e2-medium
* serviceAccount: ${default.email}
* oauthScopes:
* - https://www.googleapis.com/auth/cloud-platform
* ```
*
* > **Note:** It is recommended that node pools be created and managed as separate resources as in the example above.
* This allows node pools to be added and removed without recreating the cluster. Node pools defined directly in the
* `gcp.container.Cluster` resource cannot be removed without re-creating the cluster.
* ### With The Default Node Pool
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.serviceaccount.Account("default", {
* accountId: "service-account-id",
* displayName: "Service Account",
* });
* const primary = new gcp.container.Cluster("primary", {
* name: "marcellus-wallace",
* location: "us-central1-a",
* initialNodeCount: 3,
* nodeConfig: {
* serviceAccount: _default.email,
* oauthScopes: ["https://www.googleapis.com/auth/cloud-platform"],
* labels: {
* foo: "bar",
* },
* tags: [
* "foo",
* "bar",
* ],
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.serviceaccount.Account("default",
* account_id="service-account-id",
* display_name="Service Account")
* primary = gcp.container.Cluster("primary",
* name="marcellus-wallace",
* location="us-central1-a",
* initial_node_count=3,
* node_config=gcp.container.ClusterNodeConfigArgs(
* service_account=default.email,
* oauth_scopes=["https://www.googleapis.com/auth/cloud-platform"],
* labels={
* "foo": "bar",
* },
* tags=[
* "foo",
* "bar",
* ],
* ))
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.ServiceAccount.Account("default", new()
* {
* AccountId = "service-account-id",
* DisplayName = "Service Account",
* });
* var primary = new Gcp.Container.Cluster("primary", new()
* {
* Name = "marcellus-wallace",
* Location = "us-central1-a",
* InitialNodeCount = 3,
* NodeConfig = new Gcp.Container.Inputs.ClusterNodeConfigArgs
* {
* ServiceAccount = @default.Email,
* OauthScopes = new[]
* {
* "https://www.googleapis.com/auth/cloud-platform",
* },
* Labels =
* {
* { "foo", "bar" },
* },
* Tags = new[]
* {
* "foo",
* "bar",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/serviceaccount"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := serviceaccount.NewAccount(ctx, "default", &serviceaccount.AccountArgs{
* AccountId: pulumi.String("service-account-id"),
* DisplayName: pulumi.String("Service Account"),
* })
* if err != nil {
* return err
* }
* _, err = container.NewCluster(ctx, "primary", &container.ClusterArgs{
* Name: pulumi.String("marcellus-wallace"),
* Location: pulumi.String("us-central1-a"),
* InitialNodeCount: pulumi.Int(3),
* NodeConfig: &container.ClusterNodeConfigArgs{
* ServiceAccount: _default.Email,
* OauthScopes: pulumi.StringArray{
* pulumi.String("https://www.googleapis.com/auth/cloud-platform"),
* },
* Labels: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* Tags: pulumi.StringArray{
* pulumi.String("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.serviceaccount.Account;
* import com.pulumi.gcp.serviceaccount.AccountArgs;
* import com.pulumi.gcp.container.Cluster;
* import com.pulumi.gcp.container.ClusterArgs;
* import com.pulumi.gcp.container.inputs.ClusterNodeConfigArgs;
* 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 default_ = new Account("default", AccountArgs.builder()
* .accountId("service-account-id")
* .displayName("Service Account")
* .build());
* var primary = new Cluster("primary", ClusterArgs.builder()
* .name("marcellus-wallace")
* .location("us-central1-a")
* .initialNodeCount(3)
* .nodeConfig(ClusterNodeConfigArgs.builder()
* .serviceAccount(default_.email())
* .oauthScopes("https://www.googleapis.com/auth/cloud-platform")
* .labels(Map.of("foo", "bar"))
* .tags(
* "foo",
* "bar")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:serviceaccount:Account
* properties:
* accountId: service-account-id
* displayName: Service Account
* primary:
* type: gcp:container:Cluster
* properties:
* name: marcellus-wallace
* location: us-central1-a
* initialNodeCount: 3
* nodeConfig:
* serviceAccount: ${default.email}
* oauthScopes:
* - https://www.googleapis.com/auth/cloud-platform
* labels:
* foo: bar
* tags:
* - foo
* - bar
* ```
*
* ### Autopilot
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.serviceaccount.Account("default", {
* accountId: "service-account-id",
* displayName: "Service Account",
* });
* const primary = new gcp.container.Cluster("primary", {
* name: "marcellus-wallace",
* location: "us-central1-a",
* enableAutopilot: true,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.serviceaccount.Account("default",
* account_id="service-account-id",
* display_name="Service Account")
* primary = gcp.container.Cluster("primary",
* name="marcellus-wallace",
* location="us-central1-a",
* enable_autopilot=True)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.ServiceAccount.Account("default", new()
* {
* AccountId = "service-account-id",
* DisplayName = "Service Account",
* });
* var primary = new Gcp.Container.Cluster("primary", new()
* {
* Name = "marcellus-wallace",
* Location = "us-central1-a",
* EnableAutopilot = true,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/serviceaccount"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := serviceaccount.NewAccount(ctx, "default", &serviceaccount.AccountArgs{
* AccountId: pulumi.String("service-account-id"),
* DisplayName: pulumi.String("Service Account"),
* })
* if err != nil {
* return err
* }
* _, err = container.NewCluster(ctx, "primary", &container.ClusterArgs{
* Name: pulumi.String("marcellus-wallace"),
* Location: pulumi.String("us-central1-a"),
* EnableAutopilot: pulumi.Bool(true),
* })
* 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.serviceaccount.Account;
* import com.pulumi.gcp.serviceaccount.AccountArgs;
* import com.pulumi.gcp.container.Cluster;
* import com.pulumi.gcp.container.ClusterArgs;
* 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 default_ = new Account("default", AccountArgs.builder()
* .accountId("service-account-id")
* .displayName("Service Account")
* .build());
* var primary = new Cluster("primary", ClusterArgs.builder()
* .name("marcellus-wallace")
* .location("us-central1-a")
* .enableAutopilot(true)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:serviceaccount:Account
* properties:
* accountId: service-account-id
* displayName: Service Account
* primary:
* type: gcp:container:Cluster
* properties:
* name: marcellus-wallace
* location: us-central1-a
* enableAutopilot: true
* ```
*
* ## Import
* GKE clusters can be imported using the `project` , `location`, and `name`. If the project is omitted, the default
* provider value will be used. Examples:
* * `projects/{{project_id}}/locations/{{location}}/clusters/{{cluster_id}}`
* * `{{project_id}}/{{location}}/{{cluster_id}}`
* * `{{location}}/{{cluster_id}}`
* When using the `pulumi import` command, GKE clusters can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:container/cluster:Cluster default projects/{{project_id}}/locations/{{location}}/clusters/{{cluster_id}}
* ```
* ```sh
* $ pulumi import gcp:container/cluster:Cluster default {{project_id}}/{{location}}/{{cluster_id}}
* ```
* ```sh
* $ pulumi import gcp:container/cluster:Cluster default {{location}}/{{cluster_id}}
* ```
* For example, the following fields will show diffs if set in config:
* - `min_master_version`
* - `remove_default_node_pool`
* @property addonsConfig The configuration for addons supported by GKE.
* Structure is documented below.
* @property allowNetAdmin Enable NET_ADMIN for the cluster. Defaults to
* `false`. This field should only be enabled for Autopilot clusters (`enable_autopilot`
* set to `true`).
* @property authenticatorGroupsConfig Configuration for the
* [Google Groups for GKE](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control#groups-setup-gsuite) feature.
* Structure is documented below.
* @property binaryAuthorization Configuration options for the Binary
* Authorization feature. Structure is documented below.
* @property clusterAutoscaling Per-cluster configuration of Node Auto-Provisioning with Cluster Autoscaler to
* automatically adjust the size of the cluster and create/delete node pools based
* on the current needs of the cluster's workload. See the
* [guide to using Node Auto-Provisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning)
* for more details. Structure is documented below.
* @property clusterIpv4Cidr The IP address range of the Kubernetes pods
* in this cluster in CIDR notation (e.g. `10.96.0.0/14`). Leave blank to have one
* automatically chosen or specify a `/14` block in `10.0.0.0/8`. This field will
* default a new cluster to routes-based, where `ip_allocation_policy` is not defined.
* @property clusterTelemetry Configuration for
* [ClusterTelemetry](https://cloud.google.com/monitoring/kubernetes-engine/installing#controlling_the_collection_of_application_logs) feature,
* Structure is documented below.
* @property confidentialNodes Configuration for [Confidential Nodes](https://cloud.google.com/kubernetes-engine/docs/how-to/confidential-gke-nodes) feature. Structure is documented below documented below.
* @property costManagementConfig Configuration for the
* [Cost Allocation](https://cloud.google.com/kubernetes-engine/docs/how-to/cost-allocations) feature.
* Structure is documented below.
* @property databaseEncryption Structure is documented below.
* @property datapathProvider The desired datapath provider for this cluster. This is set to `LEGACY_DATAPATH` by default, which uses the IPTables-based kube-proxy implementation. Set to `ADVANCED_DATAPATH` to enable Dataplane v2.
* @property defaultMaxPodsPerNode The default maximum number of pods
* per node in this cluster. This doesn't work on "routes-based" clusters, clusters
* that don't have IP Aliasing enabled. See the [official documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/flexible-pod-cidr)
* for more information.
* @property defaultSnatStatus [GKE SNAT](https://cloud.google.com/kubernetes-engine/docs/how-to/ip-masquerade-agent#how_ipmasq_works) DefaultSnatStatus contains the desired state of whether default sNAT should be disabled on the cluster, [API doc](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#networkconfig). Structure is documented below
* @property deletionProtection
* @property description Description of the cluster.
* @property dnsConfig Configuration for [Using Cloud DNS for GKE](https://cloud.google.com/kubernetes-engine/docs/how-to/cloud-dns). Structure is documented below.
* @property enableAutopilot Enable Autopilot for this cluster. Defaults to `false`.
* Note that when this option is enabled, certain features of Standard GKE are not available.
* See the [official documentation](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#comparison)
* for available features.
* @property enableCiliumClusterwideNetworkPolicy Whether CiliumClusterWideNetworkPolicy is enabled on this cluster. Defaults to false.
* @property enableFqdnNetworkPolicy Whether FQDN Network Policy is enabled on this cluster. Users who enable this feature for existing Standard clusters must restart the GKE Dataplane V2 `anetd` DaemonSet after enabling it. See the [Enable FQDN Network Policy in an existing cluster](https://cloud.google.com/kubernetes-engine/docs/how-to/fqdn-network-policies#enable_fqdn_network_policy_in_an_existing_cluster) for more information.
* @property enableIntranodeVisibility Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network.
* @property enableK8sBetaApis Configuration for Kubernetes Beta APIs.
* Structure is documented below.
* @property enableKubernetesAlpha Whether to enable Kubernetes Alpha features for
* this cluster. Note that when this option is enabled, the cluster cannot be upgraded
* and will be automatically deleted after 30 days.
* @property enableL4IlbSubsetting Whether L4ILB Subsetting is enabled for this cluster.
* @property enableLegacyAbac Whether the ABAC authorizer is enabled for this cluster.
* When enabled, identities in the system, including service accounts, nodes, and controllers,
* will have statically granted permissions beyond those provided by the RBAC configuration or IAM.
* Defaults to `false`
* @property enableMultiNetworking Whether multi-networking is enabled for this cluster.
* @property enableShieldedNodes Enable Shielded Nodes features on all nodes in this cluster. Defaults to `true`.
* @property enableTpu Whether to enable Cloud TPU resources in this cluster.
* See the [official documentation](https://cloud.google.com/tpu/docs/kubernetes-engine-setup).
* @property fleet Fleet configuration for the cluster. Structure is documented below.
* @property gatewayApiConfig Configuration for [GKE Gateway API controller](https://cloud.google.com/kubernetes-engine/docs/concepts/gateway-api). Structure is documented below.
* @property identityServiceConfig . Structure is documented below.
* @property initialNodeCount The number of nodes to create in this
* cluster's default node pool. In regional or multi-zonal clusters, this is the
* number of nodes per zone. Must be set if `node_pool` is not set. If you're using
* `gcp.container.NodePool` objects with no default node pool, you'll need to
* set this to a value of at least `1`, alongside setting
* `remove_default_node_pool` to `true`.
* @property ipAllocationPolicy Configuration of cluster IP allocation for
* VPC-native clusters. If this block is unset during creation, it will be set by the GKE backend.
* Structure is documented below.
* @property location The location (region or zone) in which the cluster
* master will be created, as well as the default node location. If you specify a
* zone (such as `us-central1-a`), the cluster will be a zonal cluster with a
* single cluster master. If you specify a region (such as `us-west1`), the
* cluster will be a regional cluster with multiple masters spread across zones in
* the region, and with default node locations in those zones as well
* @property loggingConfig Logging configuration for the cluster.
* Structure is documented below.
* @property loggingService The logging service that the cluster should
* write logs to. Available options include `logging.googleapis.com`(Legacy Stackdriver),
* `logging.googleapis.com/kubernetes`(Stackdriver Kubernetes Engine Logging), and `none`. Defaults to `logging.googleapis.com/kubernetes`
* @property maintenancePolicy The maintenance policy to use for the cluster. Structure is
* documented below.
* @property masterAuth The authentication information for accessing the
* Kubernetes master. Some values in this block are only returned by the API if
* your service account has permission to get credentials for your GKE cluster. If
* you see an unexpected diff unsetting your client cert, ensure you have the
* `container.clusters.getCredentials` permission.
* Structure is documented below.
* @property masterAuthorizedNetworksConfig The desired
* configuration options for master authorized networks. Omit the
* nested `cidr_blocks` attribute to disallow external access (except
* the cluster node IPs, which GKE automatically whitelists).
* Structure is documented below.
* @property meshCertificates Structure is documented below.
* @property minMasterVersion The minimum version of the master. GKE
* will auto-update the master to new versions, so this does not guarantee the
* current master version--use the read-only `master_version` field to obtain that.
* If unset, the cluster's version will be set by GKE to the version of the most recent
* official release (which is not necessarily the latest version). Most users will find
* the `gcp.container.getEngineVersions` data source useful - it indicates which versions
* are available. If you intend to specify versions manually,
* [the docs](https://cloud.google.com/kubernetes-engine/versioning-and-upgrades#specifying_cluster_version)
* describe the various acceptable formats for this field.
* > If you are using the `gcp.container.getEngineVersions` datasource with a regional cluster, ensure that you have provided a `location`
* to the datasource. A region can have a different set of supported versions than its corresponding zones, and not all zones in a
* region are guaranteed to support the same version.
* @property monitoringConfig Monitoring configuration for the cluster.
* Structure is documented below.
* @property monitoringService The monitoring service that the cluster
* should write metrics to.
* Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API.
* VM metrics will be collected by Google Compute Engine regardless of this setting
* Available options include
* `monitoring.googleapis.com`(Legacy Stackdriver), `monitoring.googleapis.com/kubernetes`(Stackdriver Kubernetes Engine Monitoring), and `none`.
* Defaults to `monitoring.googleapis.com/kubernetes`
* @property name The name of the cluster, unique within the project and
* location.
* - - -
* @property network The name or self_link of the Google Compute Engine
* network to which the cluster is connected. For Shared VPC, set this to the self link of the
* shared network.
* @property networkPolicy Configuration options for the
* [NetworkPolicy](https://kubernetes.io/docs/concepts/services-networking/networkpolicies/)
* feature. Structure is documented below.
* @property networkingMode Determines whether alias IPs or routes will be used for pod IPs in the cluster.
* Options are `VPC_NATIVE` or `ROUTES`. `VPC_NATIVE` enables [IP aliasing](https://cloud.google.com/kubernetes-engine/docs/how-to/ip-aliases). Newly created clusters will default to `VPC_NATIVE`.
* @property nodeConfig Parameters used in creating the default node pool.
* Generally, this field should not be used at the same time as a
* `gcp.container.NodePool` or a `node_pool` block; this configuration
* manages the default node pool, which isn't recommended to be used.
* Structure is documented below.
* @property nodeLocations The list of zones in which the cluster's nodes
* are located. Nodes must be in the region of their regional cluster or in the
* same region as their cluster's zone for zonal clusters. If this is specified for
* a zonal cluster, omit the cluster's zone.
* > A "multi-zonal" cluster is a zonal cluster with at least one additional zone
* defined; in a multi-zonal cluster, the cluster master is only present in a
* single zone while nodes are present in each of the primary zone and the node
* locations. In contrast, in a regional cluster, cluster master nodes are present
* in multiple zones in the region. For that reason, regional clusters should be
* preferred.
* @property nodePoolAutoConfig Node pool configs that apply to auto-provisioned node pools in
* [autopilot](https://cloud.google.com/kubernetes-engine/docs/concepts/autopilot-overview#comparison) clusters and
* [node auto-provisioning](https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning)-enabled clusters. Structure is documented below.
* @property nodePoolDefaults Default NodePool settings for the entire cluster. These settings are overridden if specified on the specific NodePool object. Structure is documented below.
* @property nodePools List of node pools associated with this cluster.
* See gcp.container.NodePool for schema.
* **Warning:** node pools defined inside a cluster can't be changed (or added/removed) after
* cluster creation without deleting and recreating the entire cluster. Unless you absolutely need the ability
* to say "these are the _only_ node pools associated with this cluster", use the
* gcp.container.NodePool resource instead of this property.
* @property nodeVersion The Kubernetes version on the nodes. Must either be unset
* or set to the same value as `min_master_version` on create. Defaults to the default
* version set by GKE which is not necessarily the latest version. This only affects
* nodes in the default node pool. While a fuzzy version can be specified, it's
* recommended that you specify explicit versions as the provider will see spurious diffs
* when fuzzy versions are used. See the `gcp.container.getEngineVersions` data source's
* `version_prefix` field to approximate fuzzy versions.
* To update nodes in other node pools, use the `version` attribute on the node pool.
* @property notificationConfig Configuration for the [cluster upgrade notifications](https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-upgrade-notifications) feature. Structure is documented below.
* @property podSecurityPolicyConfig Configuration for the
* [PodSecurityPolicy](https://cloud.google.com/kubernetes-engine/docs/how-to/pod-security-policies) feature.
* Structure is documented below.
* @property privateClusterConfig Configuration for [private clusters](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters),
* clusters with private nodes. Structure is documented below.
* @property privateIpv6GoogleAccess The desired state of IPv6 connectivity to Google Services. By default, no private IPv6 access to or from Google Services (all access will be via IPv4).
* @property project The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
* @property protectConfig Enable/Disable Protect API features for the cluster. Structure is documented below.
* @property releaseChannel Configuration options for the [Release channel](https://cloud.google.com/kubernetes-engine/docs/concepts/release-channels)
* feature, which provide more control over automatic upgrades of your GKE clusters.
* When updating this field, GKE imposes specific version requirements. See
* [Selecting a new release channel](https://cloud.google.com/kubernetes-engine/docs/concepts/release-channels#selecting_a_new_release_channel)
* for more details; the `gcp.container.getEngineVersions` datasource can provide
* the default version for a channel. Note that removing the `release_channel`
* field from your config will cause the provider to stop managing your cluster's
* release channel, but will not unenroll it. Instead, use the `"UNSPECIFIED"`
* channel. Structure is documented below.
* @property removeDefaultNodePool If `true`, deletes the default node
* pool upon cluster creation. If you're using `gcp.container.NodePool`
* resources with no default node pool, this should be set to `true`, alongside
* setting `initial_node_count` to at least `1`.
* @property resourceLabels The GCE resource labels (a map of key/value pairs) to be applied to the cluster.
* @property resourceUsageExportConfig Configuration for the
* [ResourceUsageExportConfig](https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-usage-metering) feature.
* Structure is documented below.
* @property securityPostureConfig Enable/Disable Security Posture API features for the cluster. Structure is documented below.
* @property serviceExternalIpsConfig Structure is documented below.
* @property subnetwork The name or self_link of the Google Compute Engine
* subnetwork in which the cluster's instances are launched.
* @property tpuConfig TPU configuration for the cluster.
* @property verticalPodAutoscaling Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it.
* Structure is documented below.
* @property workloadAltsConfig Configuration for [direct-path (via ALTS) with workload identity.](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#workloadaltsconfig). Structure is documented below.
* The `default_snat_status` block supports
* @property workloadIdentityConfig Workload Identity allows Kubernetes service accounts to act as a user-managed
* [Google IAM Service Account](https://cloud.google.com/iam/docs/service-accounts#user-managed_service_accounts).
* Structure is documented below.
*/
public data class ClusterArgs(
public val addonsConfig: Output? = null,
public val allowNetAdmin: Output? = null,
public val authenticatorGroupsConfig: Output? = null,
public val binaryAuthorization: Output? = null,
public val clusterAutoscaling: Output? = null,
public val clusterIpv4Cidr: Output? = null,
public val clusterTelemetry: Output? = null,
public val confidentialNodes: Output? = null,
public val costManagementConfig: Output? = null,
public val databaseEncryption: Output? = null,
public val datapathProvider: Output? = null,
public val defaultMaxPodsPerNode: Output? = null,
public val defaultSnatStatus: Output? = null,
public val deletionProtection: Output? = null,
public val description: Output? = null,
public val dnsConfig: Output? = null,
public val enableAutopilot: Output? = null,
public val enableCiliumClusterwideNetworkPolicy: Output? = null,
public val enableFqdnNetworkPolicy: Output? = null,
public val enableIntranodeVisibility: Output? = null,
public val enableK8sBetaApis: Output? = null,
public val enableKubernetesAlpha: Output? = null,
public val enableL4IlbSubsetting: Output? = null,
public val enableLegacyAbac: Output? = null,
public val enableMultiNetworking: Output? = null,
public val enableShieldedNodes: Output? = null,
public val enableTpu: Output? = null,
public val fleet: Output? = null,
public val gatewayApiConfig: Output? = null,
public val identityServiceConfig: Output? = null,
public val initialNodeCount: Output? = null,
public val ipAllocationPolicy: Output? = null,
public val location: Output? = null,
public val loggingConfig: Output? = null,
public val loggingService: Output? = null,
public val maintenancePolicy: Output? = null,
public val masterAuth: Output? = null,
public val masterAuthorizedNetworksConfig: Output? =
null,
public val meshCertificates: Output? = null,
public val minMasterVersion: Output? = null,
public val monitoringConfig: Output? = null,
public val monitoringService: Output? = null,
public val name: Output? = null,
public val network: Output? = null,
public val networkPolicy: Output? = null,
public val networkingMode: Output? = null,
public val nodeConfig: Output? = null,
public val nodeLocations: Output>? = null,
public val nodePoolAutoConfig: Output? = null,
public val nodePoolDefaults: Output? = null,
public val nodePools: Output>? = null,
public val nodeVersion: Output? = null,
public val notificationConfig: Output? = null,
public val podSecurityPolicyConfig: Output? = null,
public val privateClusterConfig: Output? = null,
public val privateIpv6GoogleAccess: Output? = null,
public val project: Output? = null,
public val protectConfig: Output? = null,
public val releaseChannel: Output? = null,
public val removeDefaultNodePool: Output? = null,
public val resourceLabels: Output