Please wait. This can take some minutes ...
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.
com.pulumi.gcp.vmwareengine.kotlin.Cluster.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.vmwareengine.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.vmwareengine.kotlin.outputs.ClusterNodeTypeConfig
import com.pulumi.gcp.vmwareengine.kotlin.outputs.ClusterNodeTypeConfig.Companion.toKotlin
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 kotlin.collections.List
/**
* Builder for [Cluster].
*/
@PulumiTagMarker
public class ClusterResourceBuilder internal constructor() {
public var name: String? = null
public var args: ClusterArgs = ClusterArgs()
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 ClusterArgsBuilder.() -> Unit) {
val builder = ClusterArgsBuilder()
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(): Cluster {
val builtJavaResource = com.pulumi.gcp.vmwareengine.Cluster(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Cluster(builtJavaResource)
}
}
/**
* A cluster in a private cloud.
* To get more information about Cluster, see:
* * [API documentation](https://cloud.google.com/vmware-engine/docs/reference/rest/v1/projects.locations.privateClouds.clusters)
* ## Example Usage
* ### Vmware Engine Cluster Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const cluster_nw = new gcp.vmwareengine.Network("cluster-nw", {
* name: "pc-nw",
* type: "STANDARD",
* location: "global",
* description: "PC network description.",
* });
* const cluster_pc = new gcp.vmwareengine.PrivateCloud("cluster-pc", {
* location: "us-west1-a",
* name: "sample-pc",
* description: "Sample test PC.",
* networkConfig: {
* managementCidr: "192.168.30.0/24",
* vmwareEngineNetwork: cluster_nw.id,
* },
* managementCluster: {
* clusterId: "sample-mgmt-cluster",
* nodeTypeConfigs: [{
* nodeTypeId: "standard-72",
* nodeCount: 3,
* }],
* },
* });
* const vmw_engine_ext_cluster = new gcp.vmwareengine.Cluster("vmw-engine-ext-cluster", {
* name: "ext-cluster",
* parent: cluster_pc.id,
* nodeTypeConfigs: [{
* nodeTypeId: "standard-72",
* nodeCount: 3,
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* cluster_nw = gcp.vmwareengine.Network("cluster-nw",
* name="pc-nw",
* type="STANDARD",
* location="global",
* description="PC network description.")
* cluster_pc = gcp.vmwareengine.PrivateCloud("cluster-pc",
* location="us-west1-a",
* name="sample-pc",
* description="Sample test PC.",
* network_config={
* "management_cidr": "192.168.30.0/24",
* "vmware_engine_network": cluster_nw.id,
* },
* management_cluster={
* "cluster_id": "sample-mgmt-cluster",
* "node_type_configs": [{
* "node_type_id": "standard-72",
* "node_count": 3,
* }],
* })
* vmw_engine_ext_cluster = gcp.vmwareengine.Cluster("vmw-engine-ext-cluster",
* name="ext-cluster",
* parent=cluster_pc.id,
* node_type_configs=[{
* "node_type_id": "standard-72",
* "node_count": 3,
* }])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var cluster_nw = new Gcp.VMwareEngine.Network("cluster-nw", new()
* {
* Name = "pc-nw",
* Type = "STANDARD",
* Location = "global",
* Description = "PC network description.",
* });
* var cluster_pc = new Gcp.VMwareEngine.PrivateCloud("cluster-pc", new()
* {
* Location = "us-west1-a",
* Name = "sample-pc",
* Description = "Sample test PC.",
* NetworkConfig = new Gcp.VMwareEngine.Inputs.PrivateCloudNetworkConfigArgs
* {
* ManagementCidr = "192.168.30.0/24",
* VmwareEngineNetwork = cluster_nw.Id,
* },
* ManagementCluster = new Gcp.VMwareEngine.Inputs.PrivateCloudManagementClusterArgs
* {
* ClusterId = "sample-mgmt-cluster",
* NodeTypeConfigs = new[]
* {
* new Gcp.VMwareEngine.Inputs.PrivateCloudManagementClusterNodeTypeConfigArgs
* {
* NodeTypeId = "standard-72",
* NodeCount = 3,
* },
* },
* },
* });
* var vmw_engine_ext_cluster = new Gcp.VMwareEngine.Cluster("vmw-engine-ext-cluster", new()
* {
* Name = "ext-cluster",
* Parent = cluster_pc.Id,
* NodeTypeConfigs = new[]
* {
* new Gcp.VMwareEngine.Inputs.ClusterNodeTypeConfigArgs
* {
* NodeTypeId = "standard-72",
* NodeCount = 3,
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vmwareengine"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vmwareengine.NewNetwork(ctx, "cluster-nw", &vmwareengine.NetworkArgs{
* Name: pulumi.String("pc-nw"),
* Type: pulumi.String("STANDARD"),
* Location: pulumi.String("global"),
* Description: pulumi.String("PC network description."),
* })
* if err != nil {
* return err
* }
* _, err = vmwareengine.NewPrivateCloud(ctx, "cluster-pc", &vmwareengine.PrivateCloudArgs{
* Location: pulumi.String("us-west1-a"),
* Name: pulumi.String("sample-pc"),
* Description: pulumi.String("Sample test PC."),
* NetworkConfig: &vmwareengine.PrivateCloudNetworkConfigArgs{
* ManagementCidr: pulumi.String("192.168.30.0/24"),
* VmwareEngineNetwork: cluster_nw.ID(),
* },
* ManagementCluster: &vmwareengine.PrivateCloudManagementClusterArgs{
* ClusterId: pulumi.String("sample-mgmt-cluster"),
* NodeTypeConfigs: vmwareengine.PrivateCloudManagementClusterNodeTypeConfigArray{
* &vmwareengine.PrivateCloudManagementClusterNodeTypeConfigArgs{
* NodeTypeId: pulumi.String("standard-72"),
* NodeCount: pulumi.Int(3),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* _, err = vmwareengine.NewCluster(ctx, "vmw-engine-ext-cluster", &vmwareengine.ClusterArgs{
* Name: pulumi.String("ext-cluster"),
* Parent: cluster_pc.ID(),
* NodeTypeConfigs: vmwareengine.ClusterNodeTypeConfigArray{
* &vmwareengine.ClusterNodeTypeConfigArgs{
* NodeTypeId: pulumi.String("standard-72"),
* NodeCount: pulumi.Int(3),
* },
* },
* })
* 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.vmwareengine.Network;
* import com.pulumi.gcp.vmwareengine.NetworkArgs;
* import com.pulumi.gcp.vmwareengine.PrivateCloud;
* import com.pulumi.gcp.vmwareengine.PrivateCloudArgs;
* import com.pulumi.gcp.vmwareengine.inputs.PrivateCloudNetworkConfigArgs;
* import com.pulumi.gcp.vmwareengine.inputs.PrivateCloudManagementClusterArgs;
* import com.pulumi.gcp.vmwareengine.Cluster;
* import com.pulumi.gcp.vmwareengine.ClusterArgs;
* import com.pulumi.gcp.vmwareengine.inputs.ClusterNodeTypeConfigArgs;
* 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_nw = new Network("cluster-nw", NetworkArgs.builder()
* .name("pc-nw")
* .type("STANDARD")
* .location("global")
* .description("PC network description.")
* .build());
* var cluster_pc = new PrivateCloud("cluster-pc", PrivateCloudArgs.builder()
* .location("us-west1-a")
* .name("sample-pc")
* .description("Sample test PC.")
* .networkConfig(PrivateCloudNetworkConfigArgs.builder()
* .managementCidr("192.168.30.0/24")
* .vmwareEngineNetwork(cluster_nw.id())
* .build())
* .managementCluster(PrivateCloudManagementClusterArgs.builder()
* .clusterId("sample-mgmt-cluster")
* .nodeTypeConfigs(PrivateCloudManagementClusterNodeTypeConfigArgs.builder()
* .nodeTypeId("standard-72")
* .nodeCount(3)
* .build())
* .build())
* .build());
* var vmw_engine_ext_cluster = new Cluster("vmw-engine-ext-cluster", ClusterArgs.builder()
* .name("ext-cluster")
* .parent(cluster_pc.id())
* .nodeTypeConfigs(ClusterNodeTypeConfigArgs.builder()
* .nodeTypeId("standard-72")
* .nodeCount(3)
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* vmw-engine-ext-cluster:
* type: gcp:vmwareengine:Cluster
* properties:
* name: ext-cluster
* parent: ${["cluster-pc"].id}
* nodeTypeConfigs:
* - nodeTypeId: standard-72
* nodeCount: 3
* cluster-pc:
* type: gcp:vmwareengine:PrivateCloud
* properties:
* location: us-west1-a
* name: sample-pc
* description: Sample test PC.
* networkConfig:
* managementCidr: 192.168.30.0/24
* vmwareEngineNetwork: ${["cluster-nw"].id}
* managementCluster:
* clusterId: sample-mgmt-cluster
* nodeTypeConfigs:
* - nodeTypeId: standard-72
* nodeCount: 3
* cluster-nw:
* type: gcp:vmwareengine:Network
* properties:
* name: pc-nw
* type: STANDARD
* location: global
* description: PC network description.
* ```
*
* ### Vmware Engine Cluster Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const cluster_nw = new gcp.vmwareengine.Network("cluster-nw", {
* name: "pc-nw",
* type: "STANDARD",
* location: "global",
* description: "PC network description.",
* });
* const cluster_pc = new gcp.vmwareengine.PrivateCloud("cluster-pc", {
* location: "us-west1-a",
* name: "sample-pc",
* description: "Sample test PC.",
* networkConfig: {
* managementCidr: "192.168.30.0/24",
* vmwareEngineNetwork: cluster_nw.id,
* },
* managementCluster: {
* clusterId: "sample-mgmt-cluster",
* nodeTypeConfigs: [{
* nodeTypeId: "standard-72",
* nodeCount: 3,
* customCoreCount: 32,
* }],
* },
* });
* const vmw_ext_cluster = new gcp.vmwareengine.Cluster("vmw-ext-cluster", {
* name: "ext-cluster",
* parent: cluster_pc.id,
* nodeTypeConfigs: [{
* nodeTypeId: "standard-72",
* nodeCount: 3,
* customCoreCount: 32,
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* cluster_nw = gcp.vmwareengine.Network("cluster-nw",
* name="pc-nw",
* type="STANDARD",
* location="global",
* description="PC network description.")
* cluster_pc = gcp.vmwareengine.PrivateCloud("cluster-pc",
* location="us-west1-a",
* name="sample-pc",
* description="Sample test PC.",
* network_config={
* "management_cidr": "192.168.30.0/24",
* "vmware_engine_network": cluster_nw.id,
* },
* management_cluster={
* "cluster_id": "sample-mgmt-cluster",
* "node_type_configs": [{
* "node_type_id": "standard-72",
* "node_count": 3,
* "custom_core_count": 32,
* }],
* })
* vmw_ext_cluster = gcp.vmwareengine.Cluster("vmw-ext-cluster",
* name="ext-cluster",
* parent=cluster_pc.id,
* node_type_configs=[{
* "node_type_id": "standard-72",
* "node_count": 3,
* "custom_core_count": 32,
* }])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var cluster_nw = new Gcp.VMwareEngine.Network("cluster-nw", new()
* {
* Name = "pc-nw",
* Type = "STANDARD",
* Location = "global",
* Description = "PC network description.",
* });
* var cluster_pc = new Gcp.VMwareEngine.PrivateCloud("cluster-pc", new()
* {
* Location = "us-west1-a",
* Name = "sample-pc",
* Description = "Sample test PC.",
* NetworkConfig = new Gcp.VMwareEngine.Inputs.PrivateCloudNetworkConfigArgs
* {
* ManagementCidr = "192.168.30.0/24",
* VmwareEngineNetwork = cluster_nw.Id,
* },
* ManagementCluster = new Gcp.VMwareEngine.Inputs.PrivateCloudManagementClusterArgs
* {
* ClusterId = "sample-mgmt-cluster",
* NodeTypeConfigs = new[]
* {
* new Gcp.VMwareEngine.Inputs.PrivateCloudManagementClusterNodeTypeConfigArgs
* {
* NodeTypeId = "standard-72",
* NodeCount = 3,
* CustomCoreCount = 32,
* },
* },
* },
* });
* var vmw_ext_cluster = new Gcp.VMwareEngine.Cluster("vmw-ext-cluster", new()
* {
* Name = "ext-cluster",
* Parent = cluster_pc.Id,
* NodeTypeConfigs = new[]
* {
* new Gcp.VMwareEngine.Inputs.ClusterNodeTypeConfigArgs
* {
* NodeTypeId = "standard-72",
* NodeCount = 3,
* CustomCoreCount = 32,
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vmwareengine"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vmwareengine.NewNetwork(ctx, "cluster-nw", &vmwareengine.NetworkArgs{
* Name: pulumi.String("pc-nw"),
* Type: pulumi.String("STANDARD"),
* Location: pulumi.String("global"),
* Description: pulumi.String("PC network description."),
* })
* if err != nil {
* return err
* }
* _, err = vmwareengine.NewPrivateCloud(ctx, "cluster-pc", &vmwareengine.PrivateCloudArgs{
* Location: pulumi.String("us-west1-a"),
* Name: pulumi.String("sample-pc"),
* Description: pulumi.String("Sample test PC."),
* NetworkConfig: &vmwareengine.PrivateCloudNetworkConfigArgs{
* ManagementCidr: pulumi.String("192.168.30.0/24"),
* VmwareEngineNetwork: cluster_nw.ID(),
* },
* ManagementCluster: &vmwareengine.PrivateCloudManagementClusterArgs{
* ClusterId: pulumi.String("sample-mgmt-cluster"),
* NodeTypeConfigs: vmwareengine.PrivateCloudManagementClusterNodeTypeConfigArray{
* &vmwareengine.PrivateCloudManagementClusterNodeTypeConfigArgs{
* NodeTypeId: pulumi.String("standard-72"),
* NodeCount: pulumi.Int(3),
* CustomCoreCount: pulumi.Int(32),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* _, err = vmwareengine.NewCluster(ctx, "vmw-ext-cluster", &vmwareengine.ClusterArgs{
* Name: pulumi.String("ext-cluster"),
* Parent: cluster_pc.ID(),
* NodeTypeConfigs: vmwareengine.ClusterNodeTypeConfigArray{
* &vmwareengine.ClusterNodeTypeConfigArgs{
* NodeTypeId: pulumi.String("standard-72"),
* NodeCount: pulumi.Int(3),
* CustomCoreCount: pulumi.Int(32),
* },
* },
* })
* 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.vmwareengine.Network;
* import com.pulumi.gcp.vmwareengine.NetworkArgs;
* import com.pulumi.gcp.vmwareengine.PrivateCloud;
* import com.pulumi.gcp.vmwareengine.PrivateCloudArgs;
* import com.pulumi.gcp.vmwareengine.inputs.PrivateCloudNetworkConfigArgs;
* import com.pulumi.gcp.vmwareengine.inputs.PrivateCloudManagementClusterArgs;
* import com.pulumi.gcp.vmwareengine.Cluster;
* import com.pulumi.gcp.vmwareengine.ClusterArgs;
* import com.pulumi.gcp.vmwareengine.inputs.ClusterNodeTypeConfigArgs;
* 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_nw = new Network("cluster-nw", NetworkArgs.builder()
* .name("pc-nw")
* .type("STANDARD")
* .location("global")
* .description("PC network description.")
* .build());
* var cluster_pc = new PrivateCloud("cluster-pc", PrivateCloudArgs.builder()
* .location("us-west1-a")
* .name("sample-pc")
* .description("Sample test PC.")
* .networkConfig(PrivateCloudNetworkConfigArgs.builder()
* .managementCidr("192.168.30.0/24")
* .vmwareEngineNetwork(cluster_nw.id())
* .build())
* .managementCluster(PrivateCloudManagementClusterArgs.builder()
* .clusterId("sample-mgmt-cluster")
* .nodeTypeConfigs(PrivateCloudManagementClusterNodeTypeConfigArgs.builder()
* .nodeTypeId("standard-72")
* .nodeCount(3)
* .customCoreCount(32)
* .build())
* .build())
* .build());
* var vmw_ext_cluster = new Cluster("vmw-ext-cluster", ClusterArgs.builder()
* .name("ext-cluster")
* .parent(cluster_pc.id())
* .nodeTypeConfigs(ClusterNodeTypeConfigArgs.builder()
* .nodeTypeId("standard-72")
* .nodeCount(3)
* .customCoreCount(32)
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* vmw-ext-cluster:
* type: gcp:vmwareengine:Cluster
* properties:
* name: ext-cluster
* parent: ${["cluster-pc"].id}
* nodeTypeConfigs:
* - nodeTypeId: standard-72
* nodeCount: 3
* customCoreCount: 32
* cluster-pc:
* type: gcp:vmwareengine:PrivateCloud
* properties:
* location: us-west1-a
* name: sample-pc
* description: Sample test PC.
* networkConfig:
* managementCidr: 192.168.30.0/24
* vmwareEngineNetwork: ${["cluster-nw"].id}
* managementCluster:
* clusterId: sample-mgmt-cluster
* nodeTypeConfigs:
* - nodeTypeId: standard-72
* nodeCount: 3
* customCoreCount: 32
* cluster-nw:
* type: gcp:vmwareengine:Network
* properties:
* name: pc-nw
* type: STANDARD
* location: global
* description: PC network description.
* ```
*
* ## Import
* Cluster can be imported using any of these accepted formats:
* * `{{parent}}/clusters/{{name}}`
* When using the `pulumi import` command, Cluster can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:vmwareengine/cluster:Cluster default {{parent}}/clusters/{{name}}
* ```
*/
public class Cluster internal constructor(
override val javaResource: com.pulumi.gcp.vmwareengine.Cluster,
) : KotlinCustomResource(javaResource, ClusterMapper) {
/**
* True if the cluster is a management cluster; false otherwise.
* There can only be one management cluster in a private cloud and it has to be the first one.
*/
public val management: Output
get() = javaResource.management().applyValue({ args0 -> args0 })
/**
* The ID of the Cluster.
* - - -
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The map of cluster node types in this cluster,
* where the key is canonical identifier of the node type (corresponds to the NodeType).
* Structure is documented below.
*/
public val nodeTypeConfigs: Output>?
get() = javaResource.nodeTypeConfigs().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })
}).orElse(null)
})
/**
* The resource name of the private cloud to create a new cluster in.
* Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.
* For example: projects/my-project/locations/us-west1-a/privateClouds/my-cloud
*/
public val parent: Output
get() = javaResource.parent().applyValue({ args0 -> args0 })
/**
* State of the Cluster.
*/
public val state: Output
get() = javaResource.state().applyValue({ args0 -> args0 })
/**
* System-generated unique identifier for the resource.
*/
public val uid: Output
get() = javaResource.uid().applyValue({ args0 -> args0 })
}
public object ClusterMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.gcp.vmwareengine.Cluster::class == javaResource::class
override fun map(javaResource: Resource): Cluster = Cluster(
javaResource as
com.pulumi.gcp.vmwareengine.Cluster,
)
}
/**
* @see [Cluster].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Cluster].
*/
public suspend fun cluster(name: String, block: suspend ClusterResourceBuilder.() -> Unit): Cluster {
val builder = ClusterResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Cluster].
* @param name The _unique_ name of the resulting resource.
*/
public fun cluster(name: String): Cluster {
val builder = ClusterResourceBuilder()
builder.name(name)
return builder.build()
}