![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azure.iot.kotlin.IotHubCertificate.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.iot.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.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [IotHubCertificate].
*/
@PulumiTagMarker
public class IotHubCertificateResourceBuilder internal constructor() {
public var name: String? = null
public var args: IotHubCertificateArgs = IotHubCertificateArgs()
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 IotHubCertificateArgsBuilder.() -> Unit) {
val builder = IotHubCertificateArgsBuilder()
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(): IotHubCertificate {
val builtJavaResource = com.pulumi.azure.iot.IotHubCertificate(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return IotHubCertificate(builtJavaResource)
}
}
/**
* Manages an IotHub Device Provisioning Service 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 exampleIotHubDps = new azure.iot.IotHubDps("example", {
* name: "example",
* resourceGroupName: example.name,
* location: example.location,
* sku: {
* name: "S1",
* capacity: 1,
* },
* });
* const exampleIotHubCertificate = new azure.iot.IotHubCertificate("example", {
* name: "example",
* resourceGroupName: example.name,
* iotDpsName: exampleIotHubDps.name,
* 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_iot_hub_dps = azure.iot.IotHubDps("example",
* name="example",
* resource_group_name=example.name,
* location=example.location,
* sku={
* "name": "S1",
* "capacity": 1,
* })
* example_iot_hub_certificate = azure.iot.IotHubCertificate("example",
* name="example",
* resource_group_name=example.name,
* iot_dps_name=example_iot_hub_dps.name,
* 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 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 exampleIotHubCertificate = new Azure.Iot.IotHubCertificate("example", new()
* {
* Name = "example",
* ResourceGroupName = example.Name,
* IotDpsName = exampleIotHubDps.Name,
* 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
* }
* 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
* }
* invokeFilebase64, err := std.Filebase64(ctx, &std.Filebase64Args{
* Input: "example.cer",
* }, nil)
* if err != nil {
* return err
* }
* _, err = iot.NewIotHubCertificate(ctx, "example", &iot.IotHubCertificateArgs{
* Name: pulumi.String("example"),
* ResourceGroupName: example.Name,
* IotDpsName: exampleIotHubDps.Name,
* 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.IotHubDps;
* import com.pulumi.azure.iot.IotHubDpsArgs;
* import com.pulumi.azure.iot.inputs.IotHubDpsSkuArgs;
* import com.pulumi.azure.iot.IotHubCertificate;
* import com.pulumi.azure.iot.IotHubCertificateArgs;
* 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 exampleIotHubCertificate = new IotHubCertificate("exampleIotHubCertificate", IotHubCertificateArgs.builder()
* .name("example")
* .resourceGroupName(example.name())
* .iotDpsName(exampleIotHubDps.name())
* .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
* exampleIotHubDps:
* type: azure:iot:IotHubDps
* name: example
* properties:
* name: example
* resourceGroupName: ${example.name}
* location: ${example.location}
* sku:
* name: S1
* capacity: '1'
* exampleIotHubCertificate:
* type: azure:iot:IotHubCertificate
* name: example
* properties:
* name: example
* resourceGroupName: ${example.name}
* iotDpsName: ${exampleIotHubDps.name}
* certificateContent:
* fn::invoke:
* Function: std:filebase64
* Arguments:
* input: example.cer
* Return: result
* ```
*
* ## Import
* IoTHub Device Provisioning Service Certificates can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:iot/iotHubCertificate:IotHubCertificate example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Devices/provisioningServices/example/certificates/example
* ```
*/
public class IotHubCertificate internal constructor(
override val javaResource: com.pulumi.azure.iot.IotHubCertificate,
) : KotlinCustomResource(javaResource, IotHubCertificateMapper) {
/**
* The Base-64 representation of the X509 leaf certificate .cer file or just a .pem file content.
*/
public val certificateContent: Output
get() = javaResource.certificateContent().applyValue({ args0 -> args0 })
/**
* The name of the IoT Device Provisioning Service that this certificate will be attached to. Changing this forces a new resource to be created.
*/
public val iotDpsName: Output
get() = javaResource.iotDpsName().applyValue({ args0 -> args0 })
/**
* Specifies if the certificate is created in verified state. Defaults to `false`. Changing this forces a new resource to be created.
*/
public val isVerified: Output?
get() = javaResource.isVerified().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies the name of the Iot Device Provisioning Service Certificate resource. 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 under which the Iot Device Provisioning Service Certificate resource has to be created. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
}
public object IotHubCertificateMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.iot.IotHubCertificate::class == javaResource::class
override fun map(javaResource: Resource): IotHubCertificate = IotHubCertificate(
javaResource as
com.pulumi.azure.iot.IotHubCertificate,
)
}
/**
* @see [IotHubCertificate].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [IotHubCertificate].
*/
public suspend fun iotHubCertificate(
name: String,
block: suspend IotHubCertificateResourceBuilder.() -> Unit,
): IotHubCertificate {
val builder = IotHubCertificateResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [IotHubCertificate].
* @param name The _unique_ name of the resulting resource.
*/
public fun iotHubCertificate(name: String): IotHubCertificate {
val builder = IotHubCertificateResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy