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

com.pulumi.azure.iotcentral.kotlin.Application.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.iotcentral.kotlin

import com.pulumi.azure.iotcentral.kotlin.outputs.ApplicationIdentity
import com.pulumi.azure.iotcentral.kotlin.outputs.ApplicationIdentity.Companion.toKotlin
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
import kotlin.collections.Map

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

    public var args: ApplicationArgs = ApplicationArgs()

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

/**
 * Manages an IoT Central Application
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resource",
 *     location: "West Europe",
 * });
 * const exampleApplication = new azure.iotcentral.Application("example", {
 *     name: "example-iotcentral-app",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     subDomain: "example-iotcentral-app-subdomain",
 *     displayName: "example-iotcentral-app-display-name",
 *     sku: "ST1",
 *     template: "[email protected]",
 *     tags: {
 *         Foo: "Bar",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resource",
 *     location="West Europe")
 * example_application = azure.iotcentral.Application("example",
 *     name="example-iotcentral-app",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     sub_domain="example-iotcentral-app-subdomain",
 *     display_name="example-iotcentral-app-display-name",
 *     sku="ST1",
 *     template="[email protected]",
 *     tags={
 *         "Foo": "Bar",
 *     })
 * ```
 * ```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-resource",
 *         Location = "West Europe",
 *     });
 *     var exampleApplication = new Azure.IotCentral.Application("example", new()
 *     {
 *         Name = "example-iotcentral-app",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         SubDomain = "example-iotcentral-app-subdomain",
 *         DisplayName = "example-iotcentral-app-display-name",
 *         Sku = "ST1",
 *         Template = "[email protected]",
 *         Tags =
 *         {
 *             { "Foo", "Bar" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/iotcentral"
 * 	"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-resource"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = iotcentral.NewApplication(ctx, "example", &iotcentral.ApplicationArgs{
 * 			Name:              pulumi.String("example-iotcentral-app"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			SubDomain:         pulumi.String("example-iotcentral-app-subdomain"),
 * 			DisplayName:       pulumi.String("example-iotcentral-app-display-name"),
 * 			Sku:               pulumi.String("ST1"),
 * 			Template:          pulumi.String("[email protected]"),
 * 			Tags: pulumi.StringMap{
 * 				"Foo": pulumi.String("Bar"),
 * 			},
 * 		})
 * 		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.iotcentral.Application;
 * import com.pulumi.azure.iotcentral.ApplicationArgs;
 * 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-resource")
 *             .location("West Europe")
 *             .build());
 *         var exampleApplication = new Application("exampleApplication", ApplicationArgs.builder()
 *             .name("example-iotcentral-app")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .subDomain("example-iotcentral-app-subdomain")
 *             .displayName("example-iotcentral-app-display-name")
 *             .sku("ST1")
 *             .template("[email protected]")
 *             .tags(Map.of("Foo", "Bar"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resource
 *       location: West Europe
 *   exampleApplication:
 *     type: azure:iotcentral:Application
 *     name: example
 *     properties:
 *       name: example-iotcentral-app
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       subDomain: example-iotcentral-app-subdomain
 *       displayName: example-iotcentral-app-display-name
 *       sku: ST1
 *       template: [email protected]
 *       tags:
 *         Foo: Bar
 * ```
 * 
 * ## Import
 * The IoT Central Application can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:iotcentral/application:Application example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.IoTCentral/iotApps/app1
 * ```
 */
public class Application internal constructor(
    override val javaResource: com.pulumi.azure.iotcentral.Application,
) : KotlinCustomResource(javaResource, ApplicationMapper) {
    /**
     * A `display_name` name. Custom display name for the IoT Central application. Default is resource name.
     * > **NOTE:** Due to a bug in the provider, the default value of `display_name` of a newly created IoT Central App will be the Resource Group Name, it will be fixed and use resource name in 4.0. For an existing IoT Central App, this could be fixed by specifying the `display_name` explicitly.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * An `identity` block as defined below.
     */
    public val identity: Output?
        get() = javaResource.identity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * Specifies the supported Azure location where the resource has to be create. Changing this forces a new resource to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

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

    /**
     * Whether public network access is allowed for the IoT Central Application. Defaults to `true`.
     */
    public val publicNetworkAccessEnabled: Output?
        get() = javaResource.publicNetworkAccessEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the resource group under which the IotHub resource has to be created. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * A `sku` name. Possible values is `ST0`, `ST1`, `ST2`, Default value is `ST1`
     */
    public val sku: Output?
        get() = javaResource.sku().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * A `sub_domain` name. Subdomain for the IoT Central URL. Each application must have a unique subdomain.
     */
    public val subDomain: Output
        get() = javaResource.subDomain().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)
        })

    /**
     * A `template` name. IoT Central application template name. Default is a custom application. Changing this forces a new resource to be created.
     */
    public val template: Output
        get() = javaResource.template().applyValue({ args0 -> args0 })
}

public object ApplicationMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.iotcentral.Application::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy