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

com.pulumi.azure.appplatform.kotlin.SpringCloudApp.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.appplatform.kotlin

import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudAppCustomPersistentDisk
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudAppIdentity
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudAppIngressSettings
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudAppPersistentDisk
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.List
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudAppCustomPersistentDisk.Companion.toKotlin as springCloudAppCustomPersistentDiskToKotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudAppIdentity.Companion.toKotlin as springCloudAppIdentityToKotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudAppIngressSettings.Companion.toKotlin as springCloudAppIngressSettingsToKotlin
import com.pulumi.azure.appplatform.kotlin.outputs.SpringCloudAppPersistentDisk.Companion.toKotlin as springCloudAppPersistentDiskToKotlin

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

    public var args: SpringCloudAppArgs = SpringCloudAppArgs()

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

/**
 * Manage an Azure Spring Cloud 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-resources",
 *     location: "West Europe",
 * });
 * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("example", {
 *     name: "example-springcloud",
 *     resourceGroupName: example.name,
 *     location: example.location,
 * });
 * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("example", {
 *     name: "example-springcloudapp",
 *     resourceGroupName: example.name,
 *     serviceName: exampleSpringCloudService.name,
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_spring_cloud_service = azure.appplatform.SpringCloudService("example",
 *     name="example-springcloud",
 *     resource_group_name=example.name,
 *     location=example.location)
 * example_spring_cloud_app = azure.appplatform.SpringCloudApp("example",
 *     name="example-springcloudapp",
 *     resource_group_name=example.name,
 *     service_name=example_spring_cloud_service.name,
 *     identity={
 *         "type": "SystemAssigned",
 *     })
 * ```
 * ```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 exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("example", new()
 *     {
 *         Name = "example-springcloud",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *     });
 *     var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("example", new()
 *     {
 *         Name = "example-springcloudapp",
 *         ResourceGroupName = example.Name,
 *         ServiceName = exampleSpringCloudService.Name,
 *         Identity = new Azure.AppPlatform.Inputs.SpringCloudAppIdentityArgs
 *         {
 *             Type = "SystemAssigned",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"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
 * 		}
 * 		exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "example", &appplatform.SpringCloudServiceArgs{
 * 			Name:              pulumi.String("example-springcloud"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appplatform.NewSpringCloudApp(ctx, "example", &appplatform.SpringCloudAppArgs{
 * 			Name:              pulumi.String("example-springcloudapp"),
 * 			ResourceGroupName: example.Name,
 * 			ServiceName:       exampleSpringCloudService.Name,
 * 			Identity: &appplatform.SpringCloudAppIdentityArgs{
 * 				Type: pulumi.String("SystemAssigned"),
 * 			},
 * 		})
 * 		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.appplatform.SpringCloudService;
 * import com.pulumi.azure.appplatform.SpringCloudServiceArgs;
 * import com.pulumi.azure.appplatform.SpringCloudApp;
 * import com.pulumi.azure.appplatform.SpringCloudAppArgs;
 * import com.pulumi.azure.appplatform.inputs.SpringCloudAppIdentityArgs;
 * 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 exampleSpringCloudService = new SpringCloudService("exampleSpringCloudService", SpringCloudServiceArgs.builder()
 *             .name("example-springcloud")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .build());
 *         var exampleSpringCloudApp = new SpringCloudApp("exampleSpringCloudApp", SpringCloudAppArgs.builder()
 *             .name("example-springcloudapp")
 *             .resourceGroupName(example.name())
 *             .serviceName(exampleSpringCloudService.name())
 *             .identity(SpringCloudAppIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleSpringCloudService:
 *     type: azure:appplatform:SpringCloudService
 *     name: example
 *     properties:
 *       name: example-springcloud
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *   exampleSpringCloudApp:
 *     type: azure:appplatform:SpringCloudApp
 *     name: example
 *     properties:
 *       name: example-springcloudapp
 *       resourceGroupName: ${example.name}
 *       serviceName: ${exampleSpringCloudService.name}
 *       identity:
 *         type: SystemAssigned
 * ```
 * 
 * ## Import
 * Spring Cloud Application can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appplatform/springCloudApp:SpringCloudApp example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.AppPlatform/spring/myservice/apps/myapp
 * ```
 */
public class SpringCloudApp internal constructor(
    override val javaResource: com.pulumi.azure.appplatform.SpringCloudApp,
) : KotlinCustomResource(javaResource, SpringCloudAppMapper) {
    /**
     * A JSON object that contains the addon configurations of the Spring Cloud Service.
     */
    public val addonJson: Output
        get() = javaResource.addonJson().applyValue({ args0 -> args0 })

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

    /**
     * The Fully Qualified DNS Name of the Spring Application in the service.
     */
    public val fqdn: Output
        get() = javaResource.fqdn().applyValue({ args0 -> args0 })

    /**
     * Is only HTTPS allowed? Defaults to `false`.
     */
    public val httpsOnly: Output?
        get() = javaResource.httpsOnly().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

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

    /**
     * An `ingress_settings` block as defined below.
     */
    public val ingressSettings: Output
        get() = javaResource.ingressSettings().applyValue({ args0 ->
            args0.let({ args0 ->
                springCloudAppIngressSettingsToKotlin(args0)
            })
        })

    /**
     * Does the Spring Cloud Application have public endpoint? Defaults to `false`.
     */
    public val isPublic: Output?
        get() = javaResource.isPublic().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

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

    /**
     * An `persistent_disk` block as defined below.
     */
    public val persistentDisk: Output
        get() = javaResource.persistentDisk().applyValue({ args0 ->
            args0.let({ args0 ->
                springCloudAppPersistentDiskToKotlin(args0)
            })
        })

    /**
     * Should the App in vnet injection instance exposes endpoint which could be accessed from Internet?
     */
    public val publicEndpointEnabled: Output?
        get() = javaResource.publicEndpointEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the name of the resource group in which to create the Spring Cloud Application. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

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

    /**
     * Is End to End TLS Enabled? Defaults to `false`.
     */
    public val tlsEnabled: Output?
        get() = javaResource.tlsEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The public endpoint of the Spring Cloud Application.
     */
    public val url: Output
        get() = javaResource.url().applyValue({ args0 -> args0 })
}

public object SpringCloudAppMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.appplatform.SpringCloudApp::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy