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

com.pulumi.azure.iot.kotlin.DpsSharedAccessPolicyArgs.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.DpsSharedAccessPolicyArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages an IotHub Device Provisioning Service Shared Access Policy
 * ## 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,
 *     sku: {
 *         name: "S1",
 *         capacity: 1,
 *     },
 * });
 * const exampleDpsSharedAccessPolicy = new azure.iot.DpsSharedAccessPolicy("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     iothubDpsName: exampleIotHubDps.name,
 *     enrollmentWrite: true,
 *     enrollmentRead: true,
 * });
 * ```
 * ```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,
 *     sku={
 *         "name": "S1",
 *         "capacity": 1,
 *     })
 * example_dps_shared_access_policy = azure.iot.DpsSharedAccessPolicy("example",
 *     name="example",
 *     resource_group_name=example.name,
 *     iothub_dps_name=example_iot_hub_dps.name,
 *     enrollment_write=True,
 *     enrollment_read=True)
 * ```
 * ```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,
 *         Sku = new Azure.Iot.Inputs.IotHubDpsSkuArgs
 *         {
 *             Name = "S1",
 *             Capacity = 1,
 *         },
 *     });
 *     var exampleDpsSharedAccessPolicy = new Azure.Iot.DpsSharedAccessPolicy("example", new()
 *     {
 *         Name = "example",
 *         ResourceGroupName = example.Name,
 *         IothubDpsName = exampleIotHubDps.Name,
 *         EnrollmentWrite = true,
 *         EnrollmentRead = true,
 *     });
 * });
 * ```
 * ```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
 * 		}
 * 		exampleIotHubDps, err := iot.NewIotHubDps(ctx, "example", &iot.IotHubDpsArgs{
 * 			Name:              pulumi.String("example"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Sku: &iot.IotHubDpsSkuArgs{
 * 				Name:     pulumi.String("S1"),
 * 				Capacity: pulumi.Int(1),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = iot.NewDpsSharedAccessPolicy(ctx, "example", &iot.DpsSharedAccessPolicyArgs{
 * 			Name:              pulumi.String("example"),
 * 			ResourceGroupName: example.Name,
 * 			IothubDpsName:     exampleIotHubDps.Name,
 * 			EnrollmentWrite:   pulumi.Bool(true),
 * 			EnrollmentRead:    pulumi.Bool(true),
 * 		})
 * 		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 com.pulumi.azure.iot.DpsSharedAccessPolicy;
 * import com.pulumi.azure.iot.DpsSharedAccessPolicyArgs;
 * 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())
 *             .sku(IotHubDpsSkuArgs.builder()
 *                 .name("S1")
 *                 .capacity("1")
 *                 .build())
 *             .build());
 *         var exampleDpsSharedAccessPolicy = new DpsSharedAccessPolicy("exampleDpsSharedAccessPolicy", DpsSharedAccessPolicyArgs.builder()
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .iothubDpsName(exampleIotHubDps.name())
 *             .enrollmentWrite(true)
 *             .enrollmentRead(true)
 *             .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}
 *       sku:
 *         name: S1
 *         capacity: '1'
 *   exampleDpsSharedAccessPolicy:
 *     type: azure:iot:DpsSharedAccessPolicy
 *     name: example
 *     properties:
 *       name: example
 *       resourceGroupName: ${example.name}
 *       iothubDpsName: ${exampleIotHubDps.name}
 *       enrollmentWrite: true
 *       enrollmentRead: true
 * ```
 * 
 * ## Import
 * IoTHub Device Provisioning Service Shared Access Policies can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:iot/dpsSharedAccessPolicy:DpsSharedAccessPolicy shared_access_policy1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/provisioningServices/dps1/keys/shared_access_policy1
 * ```
 * @property enrollmentRead Adds `EnrollmentRead` permission to this Shared Access Account. It allows read access to enrollment data.
 * > **NOTE** When `enrollment_read` is set to `true`, `registration_read` must also be set to true. This is a limitation of the Azure REST API
 * @property enrollmentWrite Adds `EnrollmentWrite` permission to this Shared Access Account. It allows write access to enrollment data.
 * > **NOTE** When `registration_write` is set to `true`, `enrollment_read`, `registration_read`, and `registration_write` must also be set to true. This is a requirement of the Azure API.
 * @property iothubDpsName The name of the IoT Hub Device Provisioning service to which this Shared Access Policy belongs. Changing this forces a new resource to be created.
 * @property name Specifies the name of the IotHub Shared Access Policy resource. Changing this forces a new resource to be created.
 * @property registrationRead Adds `RegistrationStatusRead` permission to this Shared Access Account. It allows read access to device registrations.
 * @property registrationWrite Adds `RegistrationStatusWrite` permission to this Shared Access Account. It allows write access to device registrations.
 * > **NOTE** When `registration_write` is set to `true`, `registration_read` must also be set to true. This is a requirement of the Azure API.
 * @property resourceGroupName The name of the resource group under which the IotHub Shared Access Policy resource has to be created. Changing this forces a new resource to be created.
 * @property serviceConfig Adds `ServiceConfig` permission to this Shared Access Account. It allows configuration of the Device Provisioning Service.
 * > **NOTE** At least one of `registration_read`, `registration_write`, `service_config`, `enrollment_read`, `enrollment_write` permissions must be set to `true`.
 */
public data class DpsSharedAccessPolicyArgs(
    public val enrollmentRead: Output? = null,
    public val enrollmentWrite: Output? = null,
    public val iothubDpsName: Output? = null,
    public val name: Output? = null,
    public val registrationRead: Output? = null,
    public val registrationWrite: Output? = null,
    public val resourceGroupName: Output? = null,
    public val serviceConfig: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.iot.DpsSharedAccessPolicyArgs =
        com.pulumi.azure.iot.DpsSharedAccessPolicyArgs.builder()
            .enrollmentRead(enrollmentRead?.applyValue({ args0 -> args0 }))
            .enrollmentWrite(enrollmentWrite?.applyValue({ args0 -> args0 }))
            .iothubDpsName(iothubDpsName?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .registrationRead(registrationRead?.applyValue({ args0 -> args0 }))
            .registrationWrite(registrationWrite?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .serviceConfig(serviceConfig?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [DpsSharedAccessPolicyArgs].
 */
@PulumiTagMarker
public class DpsSharedAccessPolicyArgsBuilder internal constructor() {
    private var enrollmentRead: Output? = null

    private var enrollmentWrite: Output? = null

    private var iothubDpsName: Output? = null

    private var name: Output? = null

    private var registrationRead: Output? = null

    private var registrationWrite: Output? = null

    private var resourceGroupName: Output? = null

    private var serviceConfig: Output? = null

    /**
     * @param value Adds `EnrollmentRead` permission to this Shared Access Account. It allows read access to enrollment data.
     * > **NOTE** When `enrollment_read` is set to `true`, `registration_read` must also be set to true. This is a limitation of the Azure REST API
     */
    @JvmName("qmioicxyyesdluuf")
    public suspend fun enrollmentRead(`value`: Output) {
        this.enrollmentRead = value
    }

    /**
     * @param value Adds `EnrollmentWrite` permission to this Shared Access Account. It allows write access to enrollment data.
     * > **NOTE** When `registration_write` is set to `true`, `enrollment_read`, `registration_read`, and `registration_write` must also be set to true. This is a requirement of the Azure API.
     */
    @JvmName("clkxomltwgiufncc")
    public suspend fun enrollmentWrite(`value`: Output) {
        this.enrollmentWrite = value
    }

    /**
     * @param value The name of the IoT Hub Device Provisioning service to which this Shared Access Policy belongs. Changing this forces a new resource to be created.
     */
    @JvmName("ajugeogsedcsbuue")
    public suspend fun iothubDpsName(`value`: Output) {
        this.iothubDpsName = value
    }

    /**
     * @param value Specifies the name of the IotHub Shared Access Policy resource. Changing this forces a new resource to be created.
     */
    @JvmName("bvqpgptlwwnrooiu")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Adds `RegistrationStatusRead` permission to this Shared Access Account. It allows read access to device registrations.
     */
    @JvmName("lgxgsymeibaeqkop")
    public suspend fun registrationRead(`value`: Output) {
        this.registrationRead = value
    }

    /**
     * @param value Adds `RegistrationStatusWrite` permission to this Shared Access Account. It allows write access to device registrations.
     * > **NOTE** When `registration_write` is set to `true`, `registration_read` must also be set to true. This is a requirement of the Azure API.
     */
    @JvmName("egvwayekqxghtdtv")
    public suspend fun registrationWrite(`value`: Output) {
        this.registrationWrite = value
    }

    /**
     * @param value The name of the resource group under which the IotHub Shared Access Policy resource has to be created. Changing this forces a new resource to be created.
     */
    @JvmName("dhuuyomjijkshujs")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Adds `ServiceConfig` permission to this Shared Access Account. It allows configuration of the Device Provisioning Service.
     * > **NOTE** At least one of `registration_read`, `registration_write`, `service_config`, `enrollment_read`, `enrollment_write` permissions must be set to `true`.
     */
    @JvmName("vgbkprhqtocckgae")
    public suspend fun serviceConfig(`value`: Output) {
        this.serviceConfig = value
    }

    /**
     * @param value Adds `EnrollmentRead` permission to this Shared Access Account. It allows read access to enrollment data.
     * > **NOTE** When `enrollment_read` is set to `true`, `registration_read` must also be set to true. This is a limitation of the Azure REST API
     */
    @JvmName("xwdselmaesjiqgmg")
    public suspend fun enrollmentRead(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enrollmentRead = mapped
    }

    /**
     * @param value Adds `EnrollmentWrite` permission to this Shared Access Account. It allows write access to enrollment data.
     * > **NOTE** When `registration_write` is set to `true`, `enrollment_read`, `registration_read`, and `registration_write` must also be set to true. This is a requirement of the Azure API.
     */
    @JvmName("xdhemchtpvdpcxxn")
    public suspend fun enrollmentWrite(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enrollmentWrite = mapped
    }

    /**
     * @param value The name of the IoT Hub Device Provisioning service to which this Shared Access Policy belongs. Changing this forces a new resource to be created.
     */
    @JvmName("oamfcsuorxmhgpto")
    public suspend fun iothubDpsName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.iothubDpsName = mapped
    }

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

    /**
     * @param value Adds `RegistrationStatusRead` permission to this Shared Access Account. It allows read access to device registrations.
     */
    @JvmName("sdbjnyhyyshdfudw")
    public suspend fun registrationRead(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.registrationRead = mapped
    }

    /**
     * @param value Adds `RegistrationStatusWrite` permission to this Shared Access Account. It allows write access to device registrations.
     * > **NOTE** When `registration_write` is set to `true`, `registration_read` must also be set to true. This is a requirement of the Azure API.
     */
    @JvmName("hmybarhedvcoyrgj")
    public suspend fun registrationWrite(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.registrationWrite = mapped
    }

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

    /**
     * @param value Adds `ServiceConfig` permission to this Shared Access Account. It allows configuration of the Device Provisioning Service.
     * > **NOTE** At least one of `registration_read`, `registration_write`, `service_config`, `enrollment_read`, `enrollment_write` permissions must be set to `true`.
     */
    @JvmName("orjhppgbuurbokcr")
    public suspend fun serviceConfig(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceConfig = mapped
    }

    internal fun build(): DpsSharedAccessPolicyArgs = DpsSharedAccessPolicyArgs(
        enrollmentRead = enrollmentRead,
        enrollmentWrite = enrollmentWrite,
        iothubDpsName = iothubDpsName,
        name = name,
        registrationRead = registrationRead,
        registrationWrite = registrationWrite,
        resourceGroupName = resourceGroupName,
        serviceConfig = serviceConfig,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy