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

com.pulumi.azure.iot.kotlin.CertificateArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.iot.kotlin

import com.pulumi.azure.iot.CertificateArgs.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 Certificate.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleIoTHub = new azure.iot.IoTHub("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     sku: {
 *         name: "B1",
 *         capacity: 1,
 *     },
 * });
 * const exampleCertificate = new azure.iot.Certificate("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     iothubName: exampleIoTHub.name,
 *     isVerified: true,
 *     certificateContent: std.filebase64({
 *         input: "example.cer",
 *     }).then(invoke => invoke.result),
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_std as std
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_io_t_hub = azure.iot.IoTHub("example",
 *     name="example",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     sku={
 *         "name": "B1",
 *         "capacity": 1,
 *     })
 * example_certificate = azure.iot.Certificate("example",
 *     name="example",
 *     resource_group_name=example.name,
 *     iothub_name=example_io_t_hub.name,
 *     is_verified=True,
 *     certificate_content=std.filebase64(input="example.cer").result)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleIoTHub = new Azure.Iot.IoTHub("example", new()
 *     {
 *         Name = "example",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Sku = new Azure.Iot.Inputs.IoTHubSkuArgs
 *         {
 *             Name = "B1",
 *             Capacity = 1,
 *         },
 *     });
 *     var exampleCertificate = new Azure.Iot.Certificate("example", new()
 *     {
 *         Name = "example",
 *         ResourceGroupName = example.Name,
 *         IothubName = exampleIoTHub.Name,
 *         IsVerified = true,
 *         CertificateContent = Std.Filebase64.Invoke(new()
 *         {
 *             Input = "example.cer",
 *         }).Apply(invoke => invoke.Result),
 *     });
 * });
 * ```
 * ```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-std/sdk/go/std"
 * 	"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
 * 		}
 * 		exampleIoTHub, err := iot.NewIoTHub(ctx, "example", &iot.IoTHubArgs{
 * 			Name:              pulumi.String("example"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Sku: &iot.IoTHubSkuArgs{
 * 				Name:     pulumi.String("B1"),
 * 				Capacity: pulumi.Int(1),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
 * 			Input: "example.cer",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = iot.NewCertificate(ctx, "example", &iot.CertificateArgs{
 * 			Name:               pulumi.String("example"),
 * 			ResourceGroupName:  example.Name,
 * 			IothubName:         exampleIoTHub.Name,
 * 			IsVerified:         pulumi.Bool(true),
 * 			CertificateContent: pulumi.String(invokeFilebase64.Result),
 * 		})
 * 		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.IoTHub;
 * import com.pulumi.azure.iot.IoTHubArgs;
 * import com.pulumi.azure.iot.inputs.IoTHubSkuArgs;
 * import com.pulumi.azure.iot.Certificate;
 * import com.pulumi.azure.iot.CertificateArgs;
 * 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 exampleIoTHub = new IoTHub("exampleIoTHub", IoTHubArgs.builder()
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .sku(IoTHubSkuArgs.builder()
 *                 .name("B1")
 *                 .capacity("1")
 *                 .build())
 *             .build());
 *         var exampleCertificate = new Certificate("exampleCertificate", CertificateArgs.builder()
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .iothubName(exampleIoTHub.name())
 *             .isVerified(true)
 *             .certificateContent(StdFunctions.filebase64(Filebase64Args.builder()
 *                 .input("example.cer")
 *                 .build()).result())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleIoTHub:
 *     type: azure:iot:IoTHub
 *     name: example
 *     properties:
 *       name: example
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       sku:
 *         name: B1
 *         capacity: '1'
 *   exampleCertificate:
 *     type: azure:iot:Certificate
 *     name: example
 *     properties:
 *       name: example
 *       resourceGroupName: ${example.name}
 *       iothubName: ${exampleIoTHub.name}
 *       isVerified: true
 *       certificateContent:
 *         fn::invoke:
 *           Function: std:filebase64
 *           Arguments:
 *             input: example.cer
 *           Return: result
 * ```
 * 
 * ## Import
 * IoTHub Certificates can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:iot/certificate:Certificate example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/iotHubs/example/certificates/example
 * ```
 * @property certificateContent The Base-64 representation of the X509 leaf certificate .cer file or just a .pem file content.
 * @property iothubName The name of the IoTHub that this certificate will be attached to. Changing this forces a new resource to be created.
 * @property isVerified Is the certificate verified? Defaults to `false`.
 * @property name Specifies the name of the IotHub Certificate resource. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the resource group under which the IotHub Certificate resource has to be created. Changing this forces a new resource to be created.
 */
public data class CertificateArgs(
    public val certificateContent: Output? = null,
    public val iothubName: Output? = null,
    public val isVerified: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.iot.CertificateArgs =
        com.pulumi.azure.iot.CertificateArgs.builder()
            .certificateContent(certificateContent?.applyValue({ args0 -> args0 }))
            .iothubName(iothubName?.applyValue({ args0 -> args0 }))
            .isVerified(isVerified?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [CertificateArgs].
 */
@PulumiTagMarker
public class CertificateArgsBuilder internal constructor() {
    private var certificateContent: Output? = null

    private var iothubName: Output? = null

    private var isVerified: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    /**
     * @param value The Base-64 representation of the X509 leaf certificate .cer file or just a .pem file content.
     */
    @JvmName("ygwxkxfcigvrnvpd")
    public suspend fun certificateContent(`value`: Output) {
        this.certificateContent = value
    }

    /**
     * @param value The name of the IoTHub that this certificate will be attached to. Changing this forces a new resource to be created.
     */
    @JvmName("rgpgierpxhmgkpbt")
    public suspend fun iothubName(`value`: Output) {
        this.iothubName = value
    }

    /**
     * @param value Is the certificate verified? Defaults to `false`.
     */
    @JvmName("cxqynewwmygghhkg")
    public suspend fun isVerified(`value`: Output) {
        this.isVerified = value
    }

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

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

    /**
     * @param value The Base-64 representation of the X509 leaf certificate .cer file or just a .pem file content.
     */
    @JvmName("yairdemeakcpsjte")
    public suspend fun certificateContent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.certificateContent = mapped
    }

    /**
     * @param value The name of the IoTHub that this certificate will be attached to. Changing this forces a new resource to be created.
     */
    @JvmName("cleywxgntaoxtvip")
    public suspend fun iothubName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.iothubName = mapped
    }

    /**
     * @param value Is the certificate verified? Defaults to `false`.
     */
    @JvmName("ufoncaxawkribpmj")
    public suspend fun isVerified(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.isVerified = mapped
    }

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

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

    internal fun build(): CertificateArgs = CertificateArgs(
        certificateContent = certificateContent,
        iothubName = iothubName,
        isVerified = isVerified,
        name = name,
        resourceGroupName = resourceGroupName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy