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

com.pulumi.azure.servicefabric.kotlin.ManagedCluster.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: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.servicefabric.kotlin

import com.pulumi.azure.servicefabric.kotlin.outputs.ManagedClusterAuthentication
import com.pulumi.azure.servicefabric.kotlin.outputs.ManagedClusterCustomFabricSetting
import com.pulumi.azure.servicefabric.kotlin.outputs.ManagedClusterLbRule
import com.pulumi.azure.servicefabric.kotlin.outputs.ManagedClusterNodeType
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
import kotlin.collections.Map
import com.pulumi.azure.servicefabric.kotlin.outputs.ManagedClusterAuthentication.Companion.toKotlin as managedClusterAuthenticationToKotlin
import com.pulumi.azure.servicefabric.kotlin.outputs.ManagedClusterCustomFabricSetting.Companion.toKotlin as managedClusterCustomFabricSettingToKotlin
import com.pulumi.azure.servicefabric.kotlin.outputs.ManagedClusterLbRule.Companion.toKotlin as managedClusterLbRuleToKotlin
import com.pulumi.azure.servicefabric.kotlin.outputs.ManagedClusterNodeType.Companion.toKotlin as managedClusterNodeTypeToKotlin

/**
 * Builder for [ManagedCluster].
 */
@PulumiTagMarker
public class ManagedClusterResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ManagedClusterArgs = ManagedClusterArgs()

    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 ManagedClusterArgsBuilder.() -> Unit) {
        val builder = ManagedClusterArgsBuilder()
        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(): ManagedCluster {
        val builtJavaResource = com.pulumi.azure.servicefabric.ManagedCluster(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return ManagedCluster(builtJavaResource)
    }
}

/**
 * Manages a Resource Group.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.servicefabric.ManagedCluster("example", {
 *     name: "example",
 *     resourceGroupName: "example",
 *     location: "West Europe",
 *     httpGatewayPort: 4567,
 *     lbRules: [{
 *         backendPort: 38080,
 *         frontendPort: 80,
 *         probeProtocol: "http",
 *         probeRequestPath: "/test",
 *         protocol: "tcp",
 *     }],
 *     clientConnectionPort: 12345,
 *     nodeTypes: [{
 *         dataDiskSizeGb: 130,
 *         name: "test1",
 *         primary: true,
 *         applicationPortRange: "30000-49000",
 *         ephemeralPortRange: "10000-20000",
 *         vmSize: "Standard_DS1_v2",
 *         vmImagePublisher: "MicrosoftWindowsServer",
 *         vmImageSku: "2019-Datacenter-with-Containers",
 *         vmImageOffer: "WindowsServer",
 *         vmImageVersion: "latest",
 *         vmInstanceCount: 5,
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.servicefabric.ManagedCluster("example",
 *     name="example",
 *     resource_group_name="example",
 *     location="West Europe",
 *     http_gateway_port=4567,
 *     lb_rules=[{
 *         "backend_port": 38080,
 *         "frontend_port": 80,
 *         "probe_protocol": "http",
 *         "probe_request_path": "/test",
 *         "protocol": "tcp",
 *     }],
 *     client_connection_port=12345,
 *     node_types=[{
 *         "data_disk_size_gb": 130,
 *         "name": "test1",
 *         "primary": True,
 *         "application_port_range": "30000-49000",
 *         "ephemeral_port_range": "10000-20000",
 *         "vm_size": "Standard_DS1_v2",
 *         "vm_image_publisher": "MicrosoftWindowsServer",
 *         "vm_image_sku": "2019-Datacenter-with-Containers",
 *         "vm_image_offer": "WindowsServer",
 *         "vm_image_version": "latest",
 *         "vm_instance_count": 5,
 *     }])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.ServiceFabric.ManagedCluster("example", new()
 *     {
 *         Name = "example",
 *         ResourceGroupName = "example",
 *         Location = "West Europe",
 *         HttpGatewayPort = 4567,
 *         LbRules = new[]
 *         {
 *             new Azure.ServiceFabric.Inputs.ManagedClusterLbRuleArgs
 *             {
 *                 BackendPort = 38080,
 *                 FrontendPort = 80,
 *                 ProbeProtocol = "http",
 *                 ProbeRequestPath = "/test",
 *                 Protocol = "tcp",
 *             },
 *         },
 *         ClientConnectionPort = 12345,
 *         NodeTypes = new[]
 *         {
 *             new Azure.ServiceFabric.Inputs.ManagedClusterNodeTypeArgs
 *             {
 *                 DataDiskSizeGb = 130,
 *                 Name = "test1",
 *                 Primary = true,
 *                 ApplicationPortRange = "30000-49000",
 *                 EphemeralPortRange = "10000-20000",
 *                 VmSize = "Standard_DS1_v2",
 *                 VmImagePublisher = "MicrosoftWindowsServer",
 *                 VmImageSku = "2019-Datacenter-with-Containers",
 *                 VmImageOffer = "WindowsServer",
 *                 VmImageVersion = "latest",
 *                 VmInstanceCount = 5,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicefabric"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := servicefabric.NewManagedCluster(ctx, "example", &servicefabric.ManagedClusterArgs{
 * 			Name:              pulumi.String("example"),
 * 			ResourceGroupName: pulumi.String("example"),
 * 			Location:          pulumi.String("West Europe"),
 * 			HttpGatewayPort:   pulumi.Int(4567),
 * 			LbRules: servicefabric.ManagedClusterLbRuleArray{
 * 				&servicefabric.ManagedClusterLbRuleArgs{
 * 					BackendPort:      pulumi.Int(38080),
 * 					FrontendPort:     pulumi.Int(80),
 * 					ProbeProtocol:    pulumi.String("http"),
 * 					ProbeRequestPath: pulumi.String("/test"),
 * 					Protocol:         pulumi.String("tcp"),
 * 				},
 * 			},
 * 			ClientConnectionPort: pulumi.Int(12345),
 * 			NodeTypes: servicefabric.ManagedClusterNodeTypeArray{
 * 				&servicefabric.ManagedClusterNodeTypeArgs{
 * 					DataDiskSizeGb:       pulumi.Int(130),
 * 					Name:                 pulumi.String("test1"),
 * 					Primary:              pulumi.Bool(true),
 * 					ApplicationPortRange: pulumi.String("30000-49000"),
 * 					EphemeralPortRange:   pulumi.String("10000-20000"),
 * 					VmSize:               pulumi.String("Standard_DS1_v2"),
 * 					VmImagePublisher:     pulumi.String("MicrosoftWindowsServer"),
 * 					VmImageSku:           pulumi.String("2019-Datacenter-with-Containers"),
 * 					VmImageOffer:         pulumi.String("WindowsServer"),
 * 					VmImageVersion:       pulumi.String("latest"),
 * 					VmInstanceCount:      pulumi.Int(5),
 * 				},
 * 			},
 * 		})
 * 		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.azure.servicefabric.ManagedCluster;
 * import com.pulumi.azure.servicefabric.ManagedClusterArgs;
 * import com.pulumi.azure.servicefabric.inputs.ManagedClusterLbRuleArgs;
 * import com.pulumi.azure.servicefabric.inputs.ManagedClusterNodeTypeArgs;
 * 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 example = new ManagedCluster("example", ManagedClusterArgs.builder()
 *             .name("example")
 *             .resourceGroupName("example")
 *             .location("West Europe")
 *             .httpGatewayPort(4567)
 *             .lbRules(ManagedClusterLbRuleArgs.builder()
 *                 .backendPort(38080)
 *                 .frontendPort(80)
 *                 .probeProtocol("http")
 *                 .probeRequestPath("/test")
 *                 .protocol("tcp")
 *                 .build())
 *             .clientConnectionPort(12345)
 *             .nodeTypes(ManagedClusterNodeTypeArgs.builder()
 *                 .dataDiskSizeGb(130)
 *                 .name("test1")
 *                 .primary(true)
 *                 .applicationPortRange("30000-49000")
 *                 .ephemeralPortRange("10000-20000")
 *                 .vmSize("Standard_DS1_v2")
 *                 .vmImagePublisher("MicrosoftWindowsServer")
 *                 .vmImageSku("2019-Datacenter-with-Containers")
 *                 .vmImageOffer("WindowsServer")
 *                 .vmImageVersion("latest")
 *                 .vmInstanceCount(5)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:servicefabric:ManagedCluster
 *     properties:
 *       name: example
 *       resourceGroupName: example
 *       location: West Europe
 *       httpGatewayPort: 4567
 *       lbRules:
 *         - backendPort: 38080
 *           frontendPort: 80
 *           probeProtocol: http
 *           probeRequestPath: /test
 *           protocol: tcp
 *       clientConnectionPort: 12345
 *       nodeTypes:
 *         - dataDiskSizeGb: 130
 *           name: test1
 *           primary: true
 *           applicationPortRange: 30000-49000
 *           ephemeralPortRange: 10000-20000
 *           vmSize: Standard_DS1_v2
 *           vmImagePublisher: MicrosoftWindowsServer
 *           vmImageSku: 2019-Datacenter-with-Containers
 *           vmImageOffer: WindowsServer
 *           vmImageVersion: latest
 *           vmInstanceCount: 5
 * ```
 * 
 * ## Import
 * Resource Groups can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:servicefabric/managedCluster:ManagedCluster example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.ServiceFabric/managedClusters/clusterName1
 * ```
 */
public class ManagedCluster internal constructor(
    override val javaResource: com.pulumi.azure.servicefabric.ManagedCluster,
) : KotlinCustomResource(javaResource, ManagedClusterMapper) {
    /**
     * Controls how connections to the cluster are authenticated. A `authentication` block as defined below.
     */
    public val authentication: Output?
        get() = javaResource.authentication().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> managedClusterAuthenticationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * If true, backup service is enabled.
     */
    public val backupServiceEnabled: Output?
        get() = javaResource.backupServiceEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Port to use when connecting to the cluster.
     */
    public val clientConnectionPort: Output
        get() = javaResource.clientConnectionPort().applyValue({ args0 -> args0 })

    /**
     * One or more `custom_fabric_setting` blocks as defined below.
     */
    public val customFabricSettings: Output>?
        get() = javaResource.customFabricSettings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        managedClusterCustomFabricSettingToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * Hostname for the cluster. If unset the cluster's name will be used..
     */
    public val dnsName: Output
        get() = javaResource.dnsName().applyValue({ args0 -> args0 })

    /**
     * If true, DNS service is enabled.
     */
    public val dnsServiceEnabled: Output?
        get() = javaResource.dnsServiceEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Port that should be used by the Service Fabric Explorer to visualize applications and cluster status.
     */
    public val httpGatewayPort: Output
        get() = javaResource.httpGatewayPort().applyValue({ args0 -> args0 })

    /**
     * One or more `lb_rule` blocks as defined below.
     */
    public val lbRules: Output>
        get() = javaResource.lbRules().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    managedClusterLbRuleToKotlin(args0)
                })
            })
        })

    /**
     * The Azure Region where the Resource Group should exist. Changing this forces a new Resource Group to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

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

    /**
     * One or more `node_type` blocks as defined below.
     */
    public val nodeTypes: Output>?
        get() = javaResource.nodeTypes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> managedClusterNodeTypeToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * Administrator password for the VMs that will be created as part of this cluster.
     */
    public val password: Output?
        get() = javaResource.password().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The name of the Resource Group where the Resource Group should exist. Changing this forces a new Resource Group to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * SKU for this cluster. Changing this forces a new resource to be created. Default is `Basic`, allowed values are either `Basic` or `Standard`.
     */
    public val sku: Output?
        get() = javaResource.sku().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * A mapping of tags which should be assigned to the Resource Group.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Upgrade wave for the fabric runtime. Default is `Wave0`, allowed value must be one of `Wave0`, `Wave1`, or `Wave2`.
     */
    public val upgradeWave: Output?
        get() = javaResource.upgradeWave().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Administrator password for the VMs that will be created as part of this cluster.
     */
    public val username: Output?
        get() = javaResource.username().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}

public object ManagedClusterMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.servicefabric.ManagedCluster::class == javaResource::class

    override fun map(javaResource: Resource): ManagedCluster = ManagedCluster(
        javaResource as
            com.pulumi.azure.servicefabric.ManagedCluster,
    )
}

/**
 * @see [ManagedCluster].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ManagedCluster].
 */
public suspend fun managedCluster(
    name: String,
    block: suspend ManagedClusterResourceBuilder.() -> Unit,
): ManagedCluster {
    val builder = ManagedClusterResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ManagedCluster].
 * @param name The _unique_ name of the resulting resource.
 */
public fun managedCluster(name: String): ManagedCluster {
    val builder = ManagedClusterResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy