All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.managedkafka.kotlin.ClusterArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.13.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.managedkafka.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.managedkafka.ClusterArgs.builder
import com.pulumi.gcp.managedkafka.kotlin.inputs.ClusterCapacityConfigArgs
import com.pulumi.gcp.managedkafka.kotlin.inputs.ClusterCapacityConfigArgsBuilder
import com.pulumi.gcp.managedkafka.kotlin.inputs.ClusterGcpConfigArgs
import com.pulumi.gcp.managedkafka.kotlin.inputs.ClusterGcpConfigArgsBuilder
import com.pulumi.gcp.managedkafka.kotlin.inputs.ClusterRebalanceConfigArgs
import com.pulumi.gcp.managedkafka.kotlin.inputs.ClusterRebalanceConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * ### Managedkafka Cluster Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const project = gcp.organizations.getProject({});
 * const example = new gcp.managedkafka.Cluster("example", {
 *     clusterId: "my-cluster",
 *     location: "us-central1",
 *     capacityConfig: {
 *         vcpuCount: "3",
 *         memoryBytes: "3221225472",
 *     },
 *     gcpConfig: {
 *         accessConfig: {
 *             networkConfigs: [{
 *                 subnet: project.then(project => `projects/${project.number}/regions/us-central1/subnetworks/default`),
 *             }],
 *         },
 *     },
 *     rebalanceConfig: {
 *         mode: "NO_REBALANCE",
 *     },
 *     labels: {
 *         key: "value",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * project = gcp.organizations.get_project()
 * example = gcp.managedkafka.Cluster("example",
 *     cluster_id="my-cluster",
 *     location="us-central1",
 *     capacity_config={
 *         "vcpu_count": "3",
 *         "memory_bytes": "3221225472",
 *     },
 *     gcp_config={
 *         "access_config": {
 *             "network_configs": [{
 *                 "subnet": f"projects/{project.number}/regions/us-central1/subnetworks/default",
 *             }],
 *         },
 *     },
 *     rebalance_config={
 *         "mode": "NO_REBALANCE",
 *     },
 *     labels={
 *         "key": "value",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var example = new Gcp.ManagedKafka.Cluster("example", new()
 *     {
 *         ClusterId = "my-cluster",
 *         Location = "us-central1",
 *         CapacityConfig = new Gcp.ManagedKafka.Inputs.ClusterCapacityConfigArgs
 *         {
 *             VcpuCount = "3",
 *             MemoryBytes = "3221225472",
 *         },
 *         GcpConfig = new Gcp.ManagedKafka.Inputs.ClusterGcpConfigArgs
 *         {
 *             AccessConfig = new Gcp.ManagedKafka.Inputs.ClusterGcpConfigAccessConfigArgs
 *             {
 *                 NetworkConfigs = new[]
 *                 {
 *                     new Gcp.ManagedKafka.Inputs.ClusterGcpConfigAccessConfigNetworkConfigArgs
 *                     {
 *                         Subnet = $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}/regions/us-central1/subnetworks/default",
 *                     },
 *                 },
 *             },
 *         },
 *         RebalanceConfig = new Gcp.ManagedKafka.Inputs.ClusterRebalanceConfigArgs
 *         {
 *             Mode = "NO_REBALANCE",
 *         },
 *         Labels =
 *         {
 *             { "key", "value" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/managedkafka"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		project, err := organizations.LookupProject(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = managedkafka.NewCluster(ctx, "example", &managedkafka.ClusterArgs{
 * 			ClusterId: pulumi.String("my-cluster"),
 * 			Location:  pulumi.String("us-central1"),
 * 			CapacityConfig: &managedkafka.ClusterCapacityConfigArgs{
 * 				VcpuCount:   pulumi.String("3"),
 * 				MemoryBytes: pulumi.String("3221225472"),
 * 			},
 * 			GcpConfig: &managedkafka.ClusterGcpConfigArgs{
 * 				AccessConfig: &managedkafka.ClusterGcpConfigAccessConfigArgs{
 * 					NetworkConfigs: managedkafka.ClusterGcpConfigAccessConfigNetworkConfigArray{
 * 						&managedkafka.ClusterGcpConfigAccessConfigNetworkConfigArgs{
 * 							Subnet: pulumi.Sprintf("projects/%v/regions/us-central1/subnetworks/default", project.Number),
 * 						},
 * 					},
 * 				},
 * 			},
 * 			RebalanceConfig: &managedkafka.ClusterRebalanceConfigArgs{
 * 				Mode: pulumi.String("NO_REBALANCE"),
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"key": pulumi.String("value"),
 * 			},
 * 		})
 * 		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.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.managedkafka.Cluster;
 * import com.pulumi.gcp.managedkafka.ClusterArgs;
 * import com.pulumi.gcp.managedkafka.inputs.ClusterCapacityConfigArgs;
 * import com.pulumi.gcp.managedkafka.inputs.ClusterGcpConfigArgs;
 * import com.pulumi.gcp.managedkafka.inputs.ClusterGcpConfigAccessConfigArgs;
 * import com.pulumi.gcp.managedkafka.inputs.ClusterRebalanceConfigArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         final var project = OrganizationsFunctions.getProject();
 *         var example = new Cluster("example", ClusterArgs.builder()
 *             .clusterId("my-cluster")
 *             .location("us-central1")
 *             .capacityConfig(ClusterCapacityConfigArgs.builder()
 *                 .vcpuCount(3)
 *                 .memoryBytes(3221225472)
 *                 .build())
 *             .gcpConfig(ClusterGcpConfigArgs.builder()
 *                 .accessConfig(ClusterGcpConfigAccessConfigArgs.builder()
 *                     .networkConfigs(ClusterGcpConfigAccessConfigNetworkConfigArgs.builder()
 *                         .subnet(String.format("projects/%s/regions/us-central1/subnetworks/default", project.applyValue(getProjectResult -> getProjectResult.number())))
 *                         .build())
 *                     .build())
 *                 .build())
 *             .rebalanceConfig(ClusterRebalanceConfigArgs.builder()
 *                 .mode("NO_REBALANCE")
 *                 .build())
 *             .labels(Map.of("key", "value"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:managedkafka:Cluster
 *     properties:
 *       clusterId: my-cluster
 *       location: us-central1
 *       capacityConfig:
 *         vcpuCount: 3
 *         memoryBytes: 3.221225472e+09
 *       gcpConfig:
 *         accessConfig:
 *           networkConfigs:
 *             - subnet: projects/${project.number}/regions/us-central1/subnetworks/default
 *       rebalanceConfig:
 *         mode: NO_REBALANCE
 *       labels:
 *         key: value
 * variables:
 *   project:
 *     fn::invoke:
 *       Function: gcp:organizations:getProject
 *       Arguments: {}
 * ```
 * 
 * ### Managedkafka Cluster Cmek
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const keyRing = new gcp.kms.KeyRing("key_ring", {
 *     name: "example-key-ring",
 *     location: "us-central1",
 * });
 * const key = new gcp.kms.CryptoKey("key", {
 *     name: "example-key",
 *     keyRing: keyRing.id,
 * });
 * const project = gcp.organizations.getProject({});
 * const example = new gcp.managedkafka.Cluster("example", {
 *     clusterId: "my-cluster",
 *     location: "us-central1",
 *     capacityConfig: {
 *         vcpuCount: "3",
 *         memoryBytes: "3221225472",
 *     },
 *     gcpConfig: {
 *         accessConfig: {
 *             networkConfigs: [{
 *                 subnet: project.then(project => `projects/${project.number}/regions/us-central1/subnetworks/default`),
 *             }],
 *         },
 *         kmsKey: key.id,
 *     },
 * });
 * const kafkaServiceIdentity = new gcp.projects.ServiceIdentity("kafka_service_identity", {
 *     project: project.then(project => project.projectId),
 *     service: "managedkafka.googleapis.com",
 * });
 * const cryptoKeyBinding = new gcp.kms.CryptoKeyIAMBinding("crypto_key_binding", {
 *     cryptoKeyId: key.id,
 *     role: "roles/cloudkms.cryptoKeyEncrypterDecrypter",
 *     members: [project.then(project => `serviceAccount:service-${project.number}@gcp-sa-managedkafka.iam.gserviceaccount.com`)],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * key_ring = gcp.kms.KeyRing("key_ring",
 *     name="example-key-ring",
 *     location="us-central1")
 * key = gcp.kms.CryptoKey("key",
 *     name="example-key",
 *     key_ring=key_ring.id)
 * project = gcp.organizations.get_project()
 * example = gcp.managedkafka.Cluster("example",
 *     cluster_id="my-cluster",
 *     location="us-central1",
 *     capacity_config={
 *         "vcpu_count": "3",
 *         "memory_bytes": "3221225472",
 *     },
 *     gcp_config={
 *         "access_config": {
 *             "network_configs": [{
 *                 "subnet": f"projects/{project.number}/regions/us-central1/subnetworks/default",
 *             }],
 *         },
 *         "kms_key": key.id,
 *     })
 * kafka_service_identity = gcp.projects.ServiceIdentity("kafka_service_identity",
 *     project=project.project_id,
 *     service="managedkafka.googleapis.com")
 * crypto_key_binding = gcp.kms.CryptoKeyIAMBinding("crypto_key_binding",
 *     crypto_key_id=key.id,
 *     role="roles/cloudkms.cryptoKeyEncrypterDecrypter",
 *     members=[f"serviceAccount:service-{project.number}@gcp-sa-managedkafka.iam.gserviceaccount.com"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var keyRing = new Gcp.Kms.KeyRing("key_ring", new()
 *     {
 *         Name = "example-key-ring",
 *         Location = "us-central1",
 *     });
 *     var key = new Gcp.Kms.CryptoKey("key", new()
 *     {
 *         Name = "example-key",
 *         KeyRing = keyRing.Id,
 *     });
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var example = new Gcp.ManagedKafka.Cluster("example", new()
 *     {
 *         ClusterId = "my-cluster",
 *         Location = "us-central1",
 *         CapacityConfig = new Gcp.ManagedKafka.Inputs.ClusterCapacityConfigArgs
 *         {
 *             VcpuCount = "3",
 *             MemoryBytes = "3221225472",
 *         },
 *         GcpConfig = new Gcp.ManagedKafka.Inputs.ClusterGcpConfigArgs
 *         {
 *             AccessConfig = new Gcp.ManagedKafka.Inputs.ClusterGcpConfigAccessConfigArgs
 *             {
 *                 NetworkConfigs = new[]
 *                 {
 *                     new Gcp.ManagedKafka.Inputs.ClusterGcpConfigAccessConfigNetworkConfigArgs
 *                     {
 *                         Subnet = $"projects/{project.Apply(getProjectResult => getProjectResult.Number)}/regions/us-central1/subnetworks/default",
 *                     },
 *                 },
 *             },
 *             KmsKey = key.Id,
 *         },
 *     });
 *     var kafkaServiceIdentity = new Gcp.Projects.ServiceIdentity("kafka_service_identity", new()
 *     {
 *         Project = project.Apply(getProjectResult => getProjectResult.ProjectId),
 *         Service = "managedkafka.googleapis.com",
 *     });
 *     var cryptoKeyBinding = new Gcp.Kms.CryptoKeyIAMBinding("crypto_key_binding", new()
 *     {
 *         CryptoKeyId = key.Id,
 *         Role = "roles/cloudkms.cryptoKeyEncrypterDecrypter",
 *         Members = new[]
 *         {
 *             $"serviceAccount:service-{project.Apply(getProjectResult => getProjectResult.Number)}@gcp-sa-managedkafka.iam.gserviceaccount.com",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/managedkafka"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/projects"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		keyRing, err := kms.NewKeyRing(ctx, "key_ring", &kms.KeyRingArgs{
 * 			Name:     pulumi.String("example-key-ring"),
 * 			Location: pulumi.String("us-central1"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		key, err := kms.NewCryptoKey(ctx, "key", &kms.CryptoKeyArgs{
 * 			Name:    pulumi.String("example-key"),
 * 			KeyRing: keyRing.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		project, err := organizations.LookupProject(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = managedkafka.NewCluster(ctx, "example", &managedkafka.ClusterArgs{
 * 			ClusterId: pulumi.String("my-cluster"),
 * 			Location:  pulumi.String("us-central1"),
 * 			CapacityConfig: &managedkafka.ClusterCapacityConfigArgs{
 * 				VcpuCount:   pulumi.String("3"),
 * 				MemoryBytes: pulumi.String("3221225472"),
 * 			},
 * 			GcpConfig: &managedkafka.ClusterGcpConfigArgs{
 * 				AccessConfig: &managedkafka.ClusterGcpConfigAccessConfigArgs{
 * 					NetworkConfigs: managedkafka.ClusterGcpConfigAccessConfigNetworkConfigArray{
 * 						&managedkafka.ClusterGcpConfigAccessConfigNetworkConfigArgs{
 * 							Subnet: pulumi.Sprintf("projects/%v/regions/us-central1/subnetworks/default", project.Number),
 * 						},
 * 					},
 * 				},
 * 				KmsKey: key.ID(),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = projects.NewServiceIdentity(ctx, "kafka_service_identity", &projects.ServiceIdentityArgs{
 * 			Project: pulumi.String(project.ProjectId),
 * 			Service: pulumi.String("managedkafka.googleapis.com"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = kms.NewCryptoKeyIAMBinding(ctx, "crypto_key_binding", &kms.CryptoKeyIAMBindingArgs{
 * 			CryptoKeyId: key.ID(),
 * 			Role:        pulumi.String("roles/cloudkms.cryptoKeyEncrypterDecrypter"),
 * 			Members: pulumi.StringArray{
 * 				pulumi.Sprintf("serviceAccount:service-%[email protected]", project.Number),
 * 			},
 * 		})
 * 		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.kms.KeyRing;
 * import com.pulumi.gcp.kms.KeyRingArgs;
 * import com.pulumi.gcp.kms.CryptoKey;
 * import com.pulumi.gcp.kms.CryptoKeyArgs;
 * import com.pulumi.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.managedkafka.Cluster;
 * import com.pulumi.gcp.managedkafka.ClusterArgs;
 * import com.pulumi.gcp.managedkafka.inputs.ClusterCapacityConfigArgs;
 * import com.pulumi.gcp.managedkafka.inputs.ClusterGcpConfigArgs;
 * import com.pulumi.gcp.managedkafka.inputs.ClusterGcpConfigAccessConfigArgs;
 * import com.pulumi.gcp.projects.ServiceIdentity;
 * import com.pulumi.gcp.projects.ServiceIdentityArgs;
 * import com.pulumi.gcp.kms.CryptoKeyIAMBinding;
 * import com.pulumi.gcp.kms.CryptoKeyIAMBindingArgs;
 * 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 keyRing = new KeyRing("keyRing", KeyRingArgs.builder()
 *             .name("example-key-ring")
 *             .location("us-central1")
 *             .build());
 *         var key = new CryptoKey("key", CryptoKeyArgs.builder()
 *             .name("example-key")
 *             .keyRing(keyRing.id())
 *             .build());
 *         final var project = OrganizationsFunctions.getProject();
 *         var example = new Cluster("example", ClusterArgs.builder()
 *             .clusterId("my-cluster")
 *             .location("us-central1")
 *             .capacityConfig(ClusterCapacityConfigArgs.builder()
 *                 .vcpuCount(3)
 *                 .memoryBytes(3221225472)
 *                 .build())
 *             .gcpConfig(ClusterGcpConfigArgs.builder()
 *                 .accessConfig(ClusterGcpConfigAccessConfigArgs.builder()
 *                     .networkConfigs(ClusterGcpConfigAccessConfigNetworkConfigArgs.builder()
 *                         .subnet(String.format("projects/%s/regions/us-central1/subnetworks/default", project.applyValue(getProjectResult -> getProjectResult.number())))
 *                         .build())
 *                     .build())
 *                 .kmsKey(key.id())
 *                 .build())
 *             .build());
 *         var kafkaServiceIdentity = new ServiceIdentity("kafkaServiceIdentity", ServiceIdentityArgs.builder()
 *             .project(project.applyValue(getProjectResult -> getProjectResult.projectId()))
 *             .service("managedkafka.googleapis.com")
 *             .build());
 *         var cryptoKeyBinding = new CryptoKeyIAMBinding("cryptoKeyBinding", CryptoKeyIAMBindingArgs.builder()
 *             .cryptoKeyId(key.id())
 *             .role("roles/cloudkms.cryptoKeyEncrypterDecrypter")
 *             .members(String.format("serviceAccount:service-%[email protected]", project.applyValue(getProjectResult -> getProjectResult.number())))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:managedkafka:Cluster
 *     properties:
 *       clusterId: my-cluster
 *       location: us-central1
 *       capacityConfig:
 *         vcpuCount: 3
 *         memoryBytes: 3.221225472e+09
 *       gcpConfig:
 *         accessConfig:
 *           networkConfigs:
 *             - subnet: projects/${project.number}/regions/us-central1/subnetworks/default
 *         kmsKey: ${key.id}
 *   kafkaServiceIdentity:
 *     type: gcp:projects:ServiceIdentity
 *     name: kafka_service_identity
 *     properties:
 *       project: ${project.projectId}
 *       service: managedkafka.googleapis.com
 *   key:
 *     type: gcp:kms:CryptoKey
 *     properties:
 *       name: example-key
 *       keyRing: ${keyRing.id}
 *   keyRing:
 *     type: gcp:kms:KeyRing
 *     name: key_ring
 *     properties:
 *       name: example-key-ring
 *       location: us-central1
 *   cryptoKeyBinding:
 *     type: gcp:kms:CryptoKeyIAMBinding
 *     name: crypto_key_binding
 *     properties:
 *       cryptoKeyId: ${key.id}
 *       role: roles/cloudkms.cryptoKeyEncrypterDecrypter
 *       members:
 *         - serviceAccount:service-${project.number}@gcp-sa-managedkafka.iam.gserviceaccount.com
 * variables:
 *   project:
 *     fn::invoke:
 *       Function: gcp:organizations:getProject
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Cluster can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/clusters/{{cluster_id}}`
 * * `{{project}}/{{location}}/{{cluster_id}}`
 * * `{{location}}/{{cluster_id}}`
 * When using the `pulumi import` command, Cluster can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:managedkafka/cluster:Cluster default projects/{{project}}/locations/{{location}}/clusters/{{cluster_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:managedkafka/cluster:Cluster default {{project}}/{{location}}/{{cluster_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:managedkafka/cluster:Cluster default {{location}}/{{cluster_id}}
 * ```
 * @property capacityConfig A capacity configuration of a Kafka cluster.
 * Structure is documented below.
 * @property clusterId The ID to use for the cluster, which will become the final component of the cluster's name. The ID must be 1-63 characters long, and match the regular expression `a-z?` to comply with RFC 1035. This value is structured like: `my-cluster-id`.
 * @property gcpConfig Configuration properties for a Kafka cluster deployed to Google Cloud Platform.
 * Structure is documented below.
 * @property labels List of label KEY=VALUE pairs to add. Keys must start with a lowercase character and contain only hyphens (-),
 * underscores ( ), lowercase characters, and numbers. Values must contain only hyphens (-), underscores ( ), lowercase
 * characters, and numbers. **Note**: This field is non-authoritative, and will only manage the labels present in your
 * configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
 * @property location ID of the location of the Kafka resource. See https://cloud.google.com/managed-kafka/docs/locations for a list of supported locations.
 * @property project
 * @property rebalanceConfig Defines rebalancing behavior of a Kafka cluster.
 */
public data class ClusterArgs(
    public val capacityConfig: Output? = null,
    public val clusterId: Output? = null,
    public val gcpConfig: Output? = null,
    public val labels: Output>? = null,
    public val location: Output? = null,
    public val project: Output? = null,
    public val rebalanceConfig: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.managedkafka.ClusterArgs =
        com.pulumi.gcp.managedkafka.ClusterArgs.builder()
            .capacityConfig(capacityConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .clusterId(clusterId?.applyValue({ args0 -> args0 }))
            .gcpConfig(gcpConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .location(location?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .rebalanceConfig(
                rebalanceConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [ClusterArgs].
 */
@PulumiTagMarker
public class ClusterArgsBuilder internal constructor() {
    private var capacityConfig: Output? = null

    private var clusterId: Output? = null

    private var gcpConfig: Output? = null

    private var labels: Output>? = null

    private var location: Output? = null

    private var project: Output? = null

    private var rebalanceConfig: Output? = null

    /**
     * @param value A capacity configuration of a Kafka cluster.
     * Structure is documented below.
     */
    @JvmName("jferfwnjofjwvorp")
    public suspend fun capacityConfig(`value`: Output) {
        this.capacityConfig = value
    }

    /**
     * @param value The ID to use for the cluster, which will become the final component of the cluster's name. The ID must be 1-63 characters long, and match the regular expression `a-z?` to comply with RFC 1035. This value is structured like: `my-cluster-id`.
     */
    @JvmName("cicuaqeyqrtqxkli")
    public suspend fun clusterId(`value`: Output) {
        this.clusterId = value
    }

    /**
     * @param value Configuration properties for a Kafka cluster deployed to Google Cloud Platform.
     * Structure is documented below.
     */
    @JvmName("uxmgaxisaqloqcqp")
    public suspend fun gcpConfig(`value`: Output) {
        this.gcpConfig = value
    }

    /**
     * @param value List of label KEY=VALUE pairs to add. Keys must start with a lowercase character and contain only hyphens (-),
     * underscores ( ), lowercase characters, and numbers. Values must contain only hyphens (-), underscores ( ), lowercase
     * characters, and numbers. **Note**: This field is non-authoritative, and will only manage the labels present in your
     * configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("njqijgtwhudodbrr")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value ID of the location of the Kafka resource. See https://cloud.google.com/managed-kafka/docs/locations for a list of supported locations.
     */
    @JvmName("ywkxjaaadlmmtemu")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value
     */
    @JvmName("qddotpcyovbxqvdu")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Defines rebalancing behavior of a Kafka cluster.
     */
    @JvmName("sdyitfffujmmywfp")
    public suspend fun rebalanceConfig(`value`: Output) {
        this.rebalanceConfig = value
    }

    /**
     * @param value A capacity configuration of a Kafka cluster.
     * Structure is documented below.
     */
    @JvmName("jxlqtwapfbixxnjy")
    public suspend fun capacityConfig(`value`: ClusterCapacityConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.capacityConfig = mapped
    }

    /**
     * @param argument A capacity configuration of a Kafka cluster.
     * Structure is documented below.
     */
    @JvmName("oqswcsfjxenubwpg")
    public suspend fun capacityConfig(argument: suspend ClusterCapacityConfigArgsBuilder.() -> Unit) {
        val toBeMapped = ClusterCapacityConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.capacityConfig = mapped
    }

    /**
     * @param value The ID to use for the cluster, which will become the final component of the cluster's name. The ID must be 1-63 characters long, and match the regular expression `a-z?` to comply with RFC 1035. This value is structured like: `my-cluster-id`.
     */
    @JvmName("oblsxocdpaknbhfu")
    public suspend fun clusterId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clusterId = mapped
    }

    /**
     * @param value Configuration properties for a Kafka cluster deployed to Google Cloud Platform.
     * Structure is documented below.
     */
    @JvmName("tisxhfsygmpsegpg")
    public suspend fun gcpConfig(`value`: ClusterGcpConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.gcpConfig = mapped
    }

    /**
     * @param argument Configuration properties for a Kafka cluster deployed to Google Cloud Platform.
     * Structure is documented below.
     */
    @JvmName("mdhwkvrvwptjtmbb")
    public suspend fun gcpConfig(argument: suspend ClusterGcpConfigArgsBuilder.() -> Unit) {
        val toBeMapped = ClusterGcpConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.gcpConfig = mapped
    }

    /**
     * @param value List of label KEY=VALUE pairs to add. Keys must start with a lowercase character and contain only hyphens (-),
     * underscores ( ), lowercase characters, and numbers. Values must contain only hyphens (-), underscores ( ), lowercase
     * characters, and numbers. **Note**: This field is non-authoritative, and will only manage the labels present in your
     * configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("wwpnpxfnjeyposfb")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values List of label KEY=VALUE pairs to add. Keys must start with a lowercase character and contain only hyphens (-),
     * underscores ( ), lowercase characters, and numbers. Values must contain only hyphens (-), underscores ( ), lowercase
     * characters, and numbers. **Note**: This field is non-authoritative, and will only manage the labels present in your
     * configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
     */
    @JvmName("fnkuvuehbflctmpw")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value ID of the location of the Kafka resource. See https://cloud.google.com/managed-kafka/docs/locations for a list of supported locations.
     */
    @JvmName("cvxivtauglxllhiu")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value
     */
    @JvmName("wrfmjuiycnkewmxl")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Defines rebalancing behavior of a Kafka cluster.
     */
    @JvmName("bnkmkwiohfoeapqi")
    public suspend fun rebalanceConfig(`value`: ClusterRebalanceConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rebalanceConfig = mapped
    }

    /**
     * @param argument Defines rebalancing behavior of a Kafka cluster.
     */
    @JvmName("orylawvsubeyfitp")
    public suspend fun rebalanceConfig(argument: suspend ClusterRebalanceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = ClusterRebalanceConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.rebalanceConfig = mapped
    }

    internal fun build(): ClusterArgs = ClusterArgs(
        capacityConfig = capacityConfig,
        clusterId = clusterId,
        gcpConfig = gcpConfig,
        labels = labels,
        location = location,
        project = project,
        rebalanceConfig = rebalanceConfig,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy