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

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

package com.pulumi.azure.mssql.kotlin

import com.pulumi.azure.mssql.kotlin.outputs.VirtualMachineGroupWsfcDomainProfile
import com.pulumi.azure.mssql.kotlin.outputs.VirtualMachineGroupWsfcDomainProfile.Companion.toKotlin
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

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

    public var args: VirtualMachineGroupArgs = VirtualMachineGroupArgs()

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

/**
 * Manages a Microsoft SQL Virtual Machine Group.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleVirtualMachineGroup = new azure.mssql.VirtualMachineGroup("example", {
 *     name: "examplegroup",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     sqlImageOffer: "SQL2017-WS2016",
 *     sqlImageSku: "Developer",
 *     wsfcDomainProfile: {
 *         fqdn: "testdomain.com",
 *         clusterSubnetType: "SingleSubnet",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_virtual_machine_group = azure.mssql.VirtualMachineGroup("example",
 *     name="examplegroup",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     sql_image_offer="SQL2017-WS2016",
 *     sql_image_sku="Developer",
 *     wsfc_domain_profile=azure.mssql.VirtualMachineGroupWsfcDomainProfileArgs(
 *         fqdn="testdomain.com",
 *         cluster_subnet_type="SingleSubnet",
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleVirtualMachineGroup = new Azure.MSSql.VirtualMachineGroup("example", new()
 *     {
 *         Name = "examplegroup",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         SqlImageOffer = "SQL2017-WS2016",
 *         SqlImageSku = "Developer",
 *         WsfcDomainProfile = new Azure.MSSql.Inputs.VirtualMachineGroupWsfcDomainProfileArgs
 *         {
 *             Fqdn = "testdomain.com",
 *             ClusterSubnetType = "SingleSubnet",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = mssql.NewVirtualMachineGroup(ctx, "example", &mssql.VirtualMachineGroupArgs{
 * 			Name:              pulumi.String("examplegroup"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			SqlImageOffer:     pulumi.String("SQL2017-WS2016"),
 * 			SqlImageSku:       pulumi.String("Developer"),
 * 			WsfcDomainProfile: &mssql.VirtualMachineGroupWsfcDomainProfileArgs{
 * 				Fqdn:              pulumi.String("testdomain.com"),
 * 				ClusterSubnetType: pulumi.String("SingleSubnet"),
 * 			},
 * 		})
 * 		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.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.mssql.VirtualMachineGroup;
 * import com.pulumi.azure.mssql.VirtualMachineGroupArgs;
 * import com.pulumi.azure.mssql.inputs.VirtualMachineGroupWsfcDomainProfileArgs;
 * 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 ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleVirtualMachineGroup = new VirtualMachineGroup("exampleVirtualMachineGroup", VirtualMachineGroupArgs.builder()
 *             .name("examplegroup")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .sqlImageOffer("SQL2017-WS2016")
 *             .sqlImageSku("Developer")
 *             .wsfcDomainProfile(VirtualMachineGroupWsfcDomainProfileArgs.builder()
 *                 .fqdn("testdomain.com")
 *                 .clusterSubnetType("SingleSubnet")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleVirtualMachineGroup:
 *     type: azure:mssql:VirtualMachineGroup
 *     name: example
 *     properties:
 *       name: examplegroup
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       sqlImageOffer: SQL2017-WS2016
 *       sqlImageSku: Developer
 *       wsfcDomainProfile:
 *         fqdn: testdomain.com
 *         clusterSubnetType: SingleSubnet
 * ```
 * 
 * ## Import
 * Microsoft SQL Virtual Machine Groups can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:mssql/virtualMachineGroup:VirtualMachineGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachineGroups/vmgroup1
 * ```
 */
public class VirtualMachineGroup internal constructor(
    override val javaResource: com.pulumi.azure.mssql.VirtualMachineGroup,
) : KotlinCustomResource(javaResource, VirtualMachineGroupMapper) {
    /**
     * The Azure Region where the Microsoft SQL Virtual Machine Group should exist. Changing this forces a new resource to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

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

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

    /**
     * The offer type of the marketplace image cluster to be used by the SQL Virtual Machine Group. Changing this forces a new resource to be created.
     */
    public val sqlImageOffer: Output
        get() = javaResource.sqlImageOffer().applyValue({ args0 -> args0 })

    /**
     * The sku type of the marketplace image cluster to be used by the SQL Virtual Machine Group. Possible values are `Developer` and `Enterprise`.
     */
    public val sqlImageSku: Output
        get() = javaResource.sqlImageSku().applyValue({ args0 -> args0 })

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

    /**
     * A `wsfc_domain_profile` block as defined below.
     */
    public val wsfcDomainProfile: Output
        get() = javaResource.wsfcDomainProfile().applyValue({ args0 ->
            args0.let({ args0 ->
                toKotlin(args0)
            })
        })
}

public object VirtualMachineGroupMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.mssql.VirtualMachineGroup::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy