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

com.pulumi.azure.avs.kotlin.Cluster.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.avs.kotlin

import com.pulumi.core.Output
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.Int
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.opts(block)
    }

    internal fun build(): Cluster {
        val builtJavaResource = com.pulumi.azure.avs.Cluster(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Cluster(builtJavaResource)
    }
}

/**
 * Manages a VMware Cluster.
 * ## Example Usage
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.avs.PrivateCloud;
 * import com.pulumi.azure.avs.PrivateCloudArgs;
 * import com.pulumi.azure.avs.inputs.PrivateCloudManagementClusterArgs;
 * import com.pulumi.azure.avs.Cluster;
 * import com.pulumi.azure.avs.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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
 *             .location("West Europe")
 *             .build());
 *         var examplePrivateCloud = new PrivateCloud("examplePrivateCloud", PrivateCloudArgs.builder()
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .skuName("av36")
 *             .managementCluster(PrivateCloudManagementClusterArgs.builder()
 *                 .size(3)
 *                 .build())
 *             .networkSubnetCidr("192.168.48.0/22")
 *             .internetConnectionEnabled(false)
 *             .nsxtPassword("QazWsx13$Edc")
 *             .vcenterPassword("WsxEdc23$Rfv")
 *             .build());
 *         var exampleCluster = new Cluster("exampleCluster", ClusterArgs.builder()
 *             .vmwareCloudId(examplePrivateCloud.id())
 *             .clusterNodeCount(3)
 *             .skuName("av36")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * VMware Clusters can be imported using the `resource id`, e.g.
 * ```sh
 *  $ pulumi import azure:avs/cluster:Cluster example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.AVS/privateClouds/privateCloud1/clusters/cluster1
 * ```
 *
 */
public class Cluster internal constructor(
    override val javaResource: com.pulumi.azure.avs.Cluster,
) : KotlinCustomResource(javaResource, ClusterMapper) {
    /**
     * The count of the VMware Cluster nodes.
     */
    public val clusterNodeCount: Output
        get() = javaResource.clusterNodeCount().applyValue({ args0 -> args0 })

    /**
     * A number that identifies this VMware Cluster in its VMware Private Cloud.
     */
    public val clusterNumber: Output
        get() = javaResource.clusterNumber().applyValue({ args0 -> args0 })

    /**
     * A list of host of the VMware Cluster.
     */
    public val hosts: Output>
        get() = javaResource.hosts().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The name which should be used for this VMware Cluster. Changing this forces a new VMware Cluster to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The cluster SKU to use. Possible values are `av20`, `av36`, `av36t`, `av36p` and `av52`. Changing this forces a new VMware Cluster to be created.
     */
    public val skuName: Output
        get() = javaResource.skuName().applyValue({ args0 -> args0 })

    /**
     * The ID of the VMware Private Cloud in which to create this VMware Cluster. Changing this forces a new VMware Cluster to be created.
     */
    public val vmwareCloudId: Output
        get() = javaResource.vmwareCloudId().applyValue({ args0 -> args0 })
}

public object ClusterMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.avs.Cluster::class == javaResource::class

    override fun map(javaResource: Resource): Cluster = Cluster(
        javaResource as
            com.pulumi.azure.avs.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()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy