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

com.pulumi.azure.iot.kotlin.IotHubDpsArgs.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.iot.kotlin

import com.pulumi.azure.iot.IotHubDpsArgs.builder
import com.pulumi.azure.iot.kotlin.inputs.IotHubDpsIpFilterRuleArgs
import com.pulumi.azure.iot.kotlin.inputs.IotHubDpsIpFilterRuleArgsBuilder
import com.pulumi.azure.iot.kotlin.inputs.IotHubDpsLinkedHubArgs
import com.pulumi.azure.iot.kotlin.inputs.IotHubDpsLinkedHubArgsBuilder
import com.pulumi.azure.iot.kotlin.inputs.IotHubDpsSkuArgs
import com.pulumi.azure.iot.kotlin.inputs.IotHubDpsSkuArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages an IotHub Device Provisioning Service.
 * ## 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 exampleIotHubDps = new azure.iot.IotHubDps("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     allocationPolicy: "Hashed",
 *     sku: {
 *         name: "S1",
 *         capacity: 1,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_iot_hub_dps = azure.iot.IotHubDps("example",
 *     name="example",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     allocation_policy="Hashed",
 *     sku={
 *         "name": "S1",
 *         "capacity": 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-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleIotHubDps = new Azure.Iot.IotHubDps("example", new()
 *     {
 *         Name = "example",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AllocationPolicy = "Hashed",
 *         Sku = new Azure.Iot.Inputs.IotHubDpsSkuArgs
 *         {
 *             Name = "S1",
 *             Capacity = 1,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iot"
 * 	"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 = iot.NewIotHubDps(ctx, "example", &iot.IotHubDpsArgs{
 * 			Name:              pulumi.String("example"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			AllocationPolicy:  pulumi.String("Hashed"),
 * 			Sku: &iot.IotHubDpsSkuArgs{
 * 				Name:     pulumi.String("S1"),
 * 				Capacity: 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.iot.IotHubDps;
 * import com.pulumi.azure.iot.IotHubDpsArgs;
 * import com.pulumi.azure.iot.inputs.IotHubDpsSkuArgs;
 * 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 exampleIotHubDps = new IotHubDps("exampleIotHubDps", IotHubDpsArgs.builder()
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .allocationPolicy("Hashed")
 *             .sku(IotHubDpsSkuArgs.builder()
 *                 .name("S1")
 *                 .capacity("1")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleIotHubDps:
 *     type: azure:iot:IotHubDps
 *     name: example
 *     properties:
 *       name: example
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       allocationPolicy: Hashed
 *       sku:
 *         name: S1
 *         capacity: '1'
 * ```
 * 
 * ## Import
 * IoT Device Provisioning Service can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:iot/iotHubDps:IotHubDps example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/provisioningServices/example
 * ```
 * @property allocationPolicy The allocation policy of the IoT Device Provisioning Service (`Hashed`, `GeoLatency` or `Static`). Defaults to `Hashed`.
 * @property dataResidencyEnabled Specifies if the IoT Device Provisioning Service has data residency and disaster recovery enabled. Defaults to `false`. Changing this forces a new resource to be created.
 * @property ipFilterRules An `ip_filter_rule` block as defined below.
 * @property linkedHubs A `linked_hub` block as defined below.
 * @property location Specifies the supported Azure location where the resource has to be created. Changing this forces a new resource to be created.
 * @property name Specifies the name of the Iot Device Provisioning Service resource. Changing this forces a new resource to be created.
 * @property publicNetworkAccessEnabled Whether requests from Public Network are allowed. Defaults to `true`.
 * @property resourceGroupName The name of the resource group under which the Iot Device Provisioning Service resource has to be created. Changing this forces a new resource to be created.
 * @property sku A `sku` block as defined below.
 * @property tags A mapping of tags to assign to the resource.
 */
public data class IotHubDpsArgs(
    public val allocationPolicy: Output? = null,
    public val dataResidencyEnabled: Output? = null,
    public val ipFilterRules: Output>? = null,
    public val linkedHubs: Output>? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val publicNetworkAccessEnabled: Output? = null,
    public val resourceGroupName: Output? = null,
    public val sku: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.iot.IotHubDpsArgs =
        com.pulumi.azure.iot.IotHubDpsArgs.builder()
            .allocationPolicy(allocationPolicy?.applyValue({ args0 -> args0 }))
            .dataResidencyEnabled(dataResidencyEnabled?.applyValue({ args0 -> args0 }))
            .ipFilterRules(
                ipFilterRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .linkedHubs(
                linkedHubs?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .publicNetworkAccessEnabled(publicNetworkAccessEnabled?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .sku(sku?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [IotHubDpsArgs].
 */
@PulumiTagMarker
public class IotHubDpsArgsBuilder internal constructor() {
    private var allocationPolicy: Output? = null

    private var dataResidencyEnabled: Output? = null

    private var ipFilterRules: Output>? = null

    private var linkedHubs: Output>? = null

    private var location: Output? = null

    private var name: Output? = null

    private var publicNetworkAccessEnabled: Output? = null

    private var resourceGroupName: Output? = null

    private var sku: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The allocation policy of the IoT Device Provisioning Service (`Hashed`, `GeoLatency` or `Static`). Defaults to `Hashed`.
     */
    @JvmName("ixvtgvbivnuctwtp")
    public suspend fun allocationPolicy(`value`: Output) {
        this.allocationPolicy = value
    }

    /**
     * @param value Specifies if the IoT Device Provisioning Service has data residency and disaster recovery enabled. Defaults to `false`. Changing this forces a new resource to be created.
     */
    @JvmName("jqhoqlgleglwuryt")
    public suspend fun dataResidencyEnabled(`value`: Output) {
        this.dataResidencyEnabled = value
    }

    /**
     * @param value An `ip_filter_rule` block as defined below.
     */
    @JvmName("nukmouflneynxmft")
    public suspend fun ipFilterRules(`value`: Output>) {
        this.ipFilterRules = value
    }

    @JvmName("bqlxlotnwgumubvb")
    public suspend fun ipFilterRules(vararg values: Output) {
        this.ipFilterRules = Output.all(values.asList())
    }

    /**
     * @param values An `ip_filter_rule` block as defined below.
     */
    @JvmName("vohfvcfqfnjoblsb")
    public suspend fun ipFilterRules(values: List>) {
        this.ipFilterRules = Output.all(values)
    }

    /**
     * @param value A `linked_hub` block as defined below.
     */
    @JvmName("sbxrkkpbvdhvcpnv")
    public suspend fun linkedHubs(`value`: Output>) {
        this.linkedHubs = value
    }

    @JvmName("aumaseaujkgvwyau")
    public suspend fun linkedHubs(vararg values: Output) {
        this.linkedHubs = Output.all(values.asList())
    }

    /**
     * @param values A `linked_hub` block as defined below.
     */
    @JvmName("jxnqoktkxdrwukox")
    public suspend fun linkedHubs(values: List>) {
        this.linkedHubs = Output.all(values)
    }

    /**
     * @param value Specifies the supported Azure location where the resource has to be created. Changing this forces a new resource to be created.
     */
    @JvmName("bdhbeurqkshhpoek")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Specifies the name of the Iot Device Provisioning Service resource. Changing this forces a new resource to be created.
     */
    @JvmName("lkybkfgbyraoxilt")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Whether requests from Public Network are allowed. Defaults to `true`.
     */
    @JvmName("kupbypfdaqavlugj")
    public suspend fun publicNetworkAccessEnabled(`value`: Output) {
        this.publicNetworkAccessEnabled = value
    }

    /**
     * @param value The name of the resource group under which the Iot Device Provisioning Service resource has to be created. Changing this forces a new resource to be created.
     */
    @JvmName("qmqcsgjpxtecxaef")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value A `sku` block as defined below.
     */
    @JvmName("jwdmibcgkwtfmbku")
    public suspend fun sku(`value`: Output) {
        this.sku = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("sgaxdegutqtkggkc")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The allocation policy of the IoT Device Provisioning Service (`Hashed`, `GeoLatency` or `Static`). Defaults to `Hashed`.
     */
    @JvmName("hoqfwbywscsmhfth")
    public suspend fun allocationPolicy(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allocationPolicy = mapped
    }

    /**
     * @param value Specifies if the IoT Device Provisioning Service has data residency and disaster recovery enabled. Defaults to `false`. Changing this forces a new resource to be created.
     */
    @JvmName("lryjbemijpnxkbqc")
    public suspend fun dataResidencyEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dataResidencyEnabled = mapped
    }

    /**
     * @param value An `ip_filter_rule` block as defined below.
     */
    @JvmName("qsiamnjpohyjurjy")
    public suspend fun ipFilterRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ipFilterRules = mapped
    }

    /**
     * @param argument An `ip_filter_rule` block as defined below.
     */
    @JvmName("gvgklhqkxqgosjse")
    public suspend fun ipFilterRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            IotHubDpsIpFilterRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.ipFilterRules = mapped
    }

    /**
     * @param argument An `ip_filter_rule` block as defined below.
     */
    @JvmName("eadqokwatldbukhh")
    public suspend fun ipFilterRules(vararg argument: suspend IotHubDpsIpFilterRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            IotHubDpsIpFilterRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.ipFilterRules = mapped
    }

    /**
     * @param argument An `ip_filter_rule` block as defined below.
     */
    @JvmName("cwrhsopuxlapkbio")
    public suspend fun ipFilterRules(argument: suspend IotHubDpsIpFilterRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(IotHubDpsIpFilterRuleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.ipFilterRules = mapped
    }

    /**
     * @param values An `ip_filter_rule` block as defined below.
     */
    @JvmName("nbclquhfmckrbyhu")
    public suspend fun ipFilterRules(vararg values: IotHubDpsIpFilterRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ipFilterRules = mapped
    }

    /**
     * @param value A `linked_hub` block as defined below.
     */
    @JvmName("wlnsrnlwkpxkyexp")
    public suspend fun linkedHubs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.linkedHubs = mapped
    }

    /**
     * @param argument A `linked_hub` block as defined below.
     */
    @JvmName("mdduoxrnvwnbxfqi")
    public suspend fun linkedHubs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            IotHubDpsLinkedHubArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.linkedHubs = mapped
    }

    /**
     * @param argument A `linked_hub` block as defined below.
     */
    @JvmName("qllsifscxlctlxhw")
    public suspend fun linkedHubs(vararg argument: suspend IotHubDpsLinkedHubArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            IotHubDpsLinkedHubArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.linkedHubs = mapped
    }

    /**
     * @param argument A `linked_hub` block as defined below.
     */
    @JvmName("iuwopcyldwhjtfjc")
    public suspend fun linkedHubs(argument: suspend IotHubDpsLinkedHubArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(IotHubDpsLinkedHubArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.linkedHubs = mapped
    }

    /**
     * @param values A `linked_hub` block as defined below.
     */
    @JvmName("pcavhmycqackntnc")
    public suspend fun linkedHubs(vararg values: IotHubDpsLinkedHubArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.linkedHubs = mapped
    }

    /**
     * @param value Specifies the supported Azure location where the resource has to be created. Changing this forces a new resource to be created.
     */
    @JvmName("tnfkndbappwcqoma")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Specifies the name of the Iot Device Provisioning Service resource. Changing this forces a new resource to be created.
     */
    @JvmName("csvjimrwjmuhcyhh")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Whether requests from Public Network are allowed. Defaults to `true`.
     */
    @JvmName("bsawcqkywkwcyckc")
    public suspend fun publicNetworkAccessEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.publicNetworkAccessEnabled = mapped
    }

    /**
     * @param value The name of the resource group under which the Iot Device Provisioning Service resource has to be created. Changing this forces a new resource to be created.
     */
    @JvmName("iyionlpekrqsqdnx")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value A `sku` block as defined below.
     */
    @JvmName("ibklrrxjjnyvnjen")
    public suspend fun sku(`value`: IotHubDpsSkuArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sku = mapped
    }

    /**
     * @param argument A `sku` block as defined below.
     */
    @JvmName("nccumstwpabwcpku")
    public suspend fun sku(argument: suspend IotHubDpsSkuArgsBuilder.() -> Unit) {
        val toBeMapped = IotHubDpsSkuArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.sku = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("yhmeaeiprnqcpfma")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("gnsirlhbqasprqjm")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): IotHubDpsArgs = IotHubDpsArgs(
        allocationPolicy = allocationPolicy,
        dataResidencyEnabled = dataResidencyEnabled,
        ipFilterRules = ipFilterRules,
        linkedHubs = linkedHubs,
        location = location,
        name = name,
        publicNetworkAccessEnabled = publicNetworkAccessEnabled,
        resourceGroupName = resourceGroupName,
        sku = sku,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy