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

com.pulumi.azure.compute.kotlin.DedicatedHostGroup.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.compute.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.Map

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

    public var args: DedicatedHostGroupArgs = DedicatedHostGroupArgs()

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

/**
 * Manage a Dedicated Host 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-rg-compute",
 *     location: "West Europe",
 * });
 * const exampleDedicatedHostGroup = new azure.compute.DedicatedHostGroup("example", {
 *     name: "example-dedicated-host-group",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     platformFaultDomainCount: 1,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-rg-compute",
 *     location="West Europe")
 * example_dedicated_host_group = azure.compute.DedicatedHostGroup("example",
 *     name="example-dedicated-host-group",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     platform_fault_domain_count=1)
 * ```
 * ```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-rg-compute",
 *         Location = "West Europe",
 *     });
 *     var exampleDedicatedHostGroup = new Azure.Compute.DedicatedHostGroup("example", new()
 *     {
 *         Name = "example-dedicated-host-group",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         PlatformFaultDomainCount = 1,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"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-rg-compute"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewDedicatedHostGroup(ctx, "example", &compute.DedicatedHostGroupArgs{
 * 			Name:                     pulumi.String("example-dedicated-host-group"),
 * 			ResourceGroupName:        example.Name,
 * 			Location:                 example.Location,
 * 			PlatformFaultDomainCount: pulumi.Int(1),
 * 		})
 * 		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.compute.DedicatedHostGroup;
 * import com.pulumi.azure.compute.DedicatedHostGroupArgs;
 * 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-rg-compute")
 *             .location("West Europe")
 *             .build());
 *         var exampleDedicatedHostGroup = new DedicatedHostGroup("exampleDedicatedHostGroup", DedicatedHostGroupArgs.builder()
 *             .name("example-dedicated-host-group")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .platformFaultDomainCount(1)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-rg-compute
 *       location: West Europe
 *   exampleDedicatedHostGroup:
 *     type: azure:compute:DedicatedHostGroup
 *     name: example
 *     properties:
 *       name: example-dedicated-host-group
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       platformFaultDomainCount: 1
 * ```
 * 
 * ## Import
 * Dedicated Host Group can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:compute/dedicatedHostGroup:DedicatedHostGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.Compute/hostGroups/group1
 * ```
 */
public class DedicatedHostGroup internal constructor(
    override val javaResource: com.pulumi.azure.compute.DedicatedHostGroup,
) : KotlinCustomResource(javaResource, DedicatedHostGroupMapper) {
    /**
     * Would virtual machines or virtual machine scale sets be placed automatically on this Dedicated Host Group? Defaults to `false`. Changing this forces a new resource to be created.
     */
    public val automaticPlacementEnabled: Output?
        get() = javaResource.automaticPlacementEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * Specifies the name of the Dedicated Host Group. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The number of fault domains that the Dedicated Host Group spans. Changing this forces a new resource to be created.
     */
    public val platformFaultDomainCount: Output
        get() = javaResource.platformFaultDomainCount().applyValue({ args0 -> args0 })

    /**
     * Specifies the name of the resource group the Dedicated Host Group is located in. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags to assign to the resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Specifies the Availability Zone in which this Dedicated Host Group should be located. Changing this forces a new Dedicated Host Group to be created.
     */
    public val zone: Output?
        get() = javaResource.zone().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}

public object DedicatedHostGroupMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.compute.DedicatedHostGroup::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy