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

com.pulumi.azure.appservice.kotlin.Slot.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.appservice.kotlin

import com.pulumi.azure.appservice.kotlin.outputs.SlotAuthSettings
import com.pulumi.azure.appservice.kotlin.outputs.SlotConnectionString
import com.pulumi.azure.appservice.kotlin.outputs.SlotIdentity
import com.pulumi.azure.appservice.kotlin.outputs.SlotLogs
import com.pulumi.azure.appservice.kotlin.outputs.SlotSiteConfig
import com.pulumi.azure.appservice.kotlin.outputs.SlotSiteCredential
import com.pulumi.azure.appservice.kotlin.outputs.SlotStorageAccount
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 kotlin.collections.Map
import com.pulumi.azure.appservice.kotlin.outputs.SlotAuthSettings.Companion.toKotlin as slotAuthSettingsToKotlin
import com.pulumi.azure.appservice.kotlin.outputs.SlotConnectionString.Companion.toKotlin as slotConnectionStringToKotlin
import com.pulumi.azure.appservice.kotlin.outputs.SlotIdentity.Companion.toKotlin as slotIdentityToKotlin
import com.pulumi.azure.appservice.kotlin.outputs.SlotLogs.Companion.toKotlin as slotLogsToKotlin
import com.pulumi.azure.appservice.kotlin.outputs.SlotSiteConfig.Companion.toKotlin as slotSiteConfigToKotlin
import com.pulumi.azure.appservice.kotlin.outputs.SlotSiteCredential.Companion.toKotlin as slotSiteCredentialToKotlin
import com.pulumi.azure.appservice.kotlin.outputs.SlotStorageAccount.Companion.toKotlin as slotStorageAccountToKotlin

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

    public var args: SlotArgs = SlotArgs()

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

/**
 * Manages an App Service Slot (within an App Service).
 * !> **NOTE:** This resource has been deprecated in version 5.0 of the provider and will be removed in version 6.0. Please use `azure.appservice.LinuxWebAppSlot` resources instead.
 * > **Note:** When using Slots - the `app_settings`, `connection_string` and `site_config` blocks on the `azure.appservice.AppService` resource will be overwritten when promoting a Slot using the `azure.appservice.ActiveSlot` resource.
 * ## Example Usage
 * ### NET 4.X)
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as random from "@pulumi/random";
 * const server = new random.RandomId("server", {
 *     keepers: {
 *         azi_id: "1",
 *     },
 *     byteLength: 8,
 * });
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "some-resource-group",
 *     location: "West Europe",
 * });
 * const examplePlan = new azure.appservice.Plan("example", {
 *     name: "some-app-service-plan",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: {
 *         tier: "Standard",
 *         size: "S1",
 *     },
 * });
 * const exampleAppService = new azure.appservice.AppService("example", {
 *     name: server.hex,
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     appServicePlanId: examplePlan.id,
 *     siteConfig: {
 *         dotnetFrameworkVersion: "v4.0",
 *     },
 *     appSettings: {
 *         SOME_KEY: "some-value",
 *     },
 *     connectionStrings: [{
 *         name: "Database",
 *         type: "SQLServer",
 *         value: "Server=some-server.mydomain.com;Integrated Security=SSPI",
 *     }],
 * });
 * const exampleSlot = new azure.appservice.Slot("example", {
 *     name: server.hex,
 *     appServiceName: exampleAppService.name,
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     appServicePlanId: examplePlan.id,
 *     siteConfig: {
 *         dotnetFrameworkVersion: "v4.0",
 *     },
 *     appSettings: {
 *         SOME_KEY: "some-value",
 *     },
 *     connectionStrings: [{
 *         name: "Database",
 *         type: "SQLServer",
 *         value: "Server=some-server.mydomain.com;Integrated Security=SSPI",
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_random as random
 * server = random.RandomId("server",
 *     keepers={
 *         "azi_id": "1",
 *     },
 *     byte_length=8)
 * example = azure.core.ResourceGroup("example",
 *     name="some-resource-group",
 *     location="West Europe")
 * example_plan = azure.appservice.Plan("example",
 *     name="some-app-service-plan",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku={
 *         "tier": "Standard",
 *         "size": "S1",
 *     })
 * example_app_service = azure.appservice.AppService("example",
 *     name=server.hex,
 *     location=example.location,
 *     resource_group_name=example.name,
 *     app_service_plan_id=example_plan.id,
 *     site_config={
 *         "dotnet_framework_version": "v4.0",
 *     },
 *     app_settings={
 *         "SOME_KEY": "some-value",
 *     },
 *     connection_strings=[{
 *         "name": "Database",
 *         "type": "SQLServer",
 *         "value": "Server=some-server.mydomain.com;Integrated Security=SSPI",
 *     }])
 * example_slot = azure.appservice.Slot("example",
 *     name=server.hex,
 *     app_service_name=example_app_service.name,
 *     location=example.location,
 *     resource_group_name=example.name,
 *     app_service_plan_id=example_plan.id,
 *     site_config={
 *         "dotnet_framework_version": "v4.0",
 *     },
 *     app_settings={
 *         "SOME_KEY": "some-value",
 *     },
 *     connection_strings=[{
 *         "name": "Database",
 *         "type": "SQLServer",
 *         "value": "Server=some-server.mydomain.com;Integrated Security=SSPI",
 *     }])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Random = Pulumi.Random;
 * return await Deployment.RunAsync(() =>
 * {
 *     var server = new Random.RandomId("server", new()
 *     {
 *         Keepers =
 *         {
 *             { "azi_id", "1" },
 *         },
 *         ByteLength = 8,
 *     });
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "some-resource-group",
 *         Location = "West Europe",
 *     });
 *     var examplePlan = new Azure.AppService.Plan("example", new()
 *     {
 *         Name = "some-app-service-plan",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Sku = new Azure.AppService.Inputs.PlanSkuArgs
 *         {
 *             Tier = "Standard",
 *             Size = "S1",
 *         },
 *     });
 *     var exampleAppService = new Azure.AppService.AppService("example", new()
 *     {
 *         Name = server.Hex,
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AppServicePlanId = examplePlan.Id,
 *         SiteConfig = new Azure.AppService.Inputs.AppServiceSiteConfigArgs
 *         {
 *             DotnetFrameworkVersion = "v4.0",
 *         },
 *         AppSettings =
 *         {
 *             { "SOME_KEY", "some-value" },
 *         },
 *         ConnectionStrings = new[]
 *         {
 *             new Azure.AppService.Inputs.AppServiceConnectionStringArgs
 *             {
 *                 Name = "Database",
 *                 Type = "SQLServer",
 *                 Value = "Server=some-server.mydomain.com;Integrated Security=SSPI",
 *             },
 *         },
 *     });
 *     var exampleSlot = new Azure.AppService.Slot("example", new()
 *     {
 *         Name = server.Hex,
 *         AppServiceName = exampleAppService.Name,
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AppServicePlanId = examplePlan.Id,
 *         SiteConfig = new Azure.AppService.Inputs.SlotSiteConfigArgs
 *         {
 *             DotnetFrameworkVersion = "v4.0",
 *         },
 *         AppSettings =
 *         {
 *             { "SOME_KEY", "some-value" },
 *         },
 *         ConnectionStrings = new[]
 *         {
 *             new Azure.AppService.Inputs.SlotConnectionStringArgs
 *             {
 *                 Name = "Database",
 *                 Type = "SQLServer",
 *                 Value = "Server=some-server.mydomain.com;Integrated Security=SSPI",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		server, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{
 * 			Keepers: pulumi.StringMap{
 * 				"azi_id": pulumi.String("1"),
 * 			},
 * 			ByteLength: pulumi.Int(8),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("some-resource-group"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		examplePlan, err := appservice.NewPlan(ctx, "example", &appservice.PlanArgs{
 * 			Name:              pulumi.String("some-app-service-plan"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Sku: &appservice.PlanSkuArgs{
 * 				Tier: pulumi.String("Standard"),
 * 				Size: pulumi.String("S1"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAppService, err := appservice.NewAppService(ctx, "example", &appservice.AppServiceArgs{
 * 			Name:              server.Hex,
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			AppServicePlanId:  examplePlan.ID(),
 * 			SiteConfig: &appservice.AppServiceSiteConfigArgs{
 * 				DotnetFrameworkVersion: pulumi.String("v4.0"),
 * 			},
 * 			AppSettings: pulumi.StringMap{
 * 				"SOME_KEY": pulumi.String("some-value"),
 * 			},
 * 			ConnectionStrings: appservice.AppServiceConnectionStringArray{
 * 				&appservice.AppServiceConnectionStringArgs{
 * 					Name:  pulumi.String("Database"),
 * 					Type:  pulumi.String("SQLServer"),
 * 					Value: pulumi.String("Server=some-server.mydomain.com;Integrated Security=SSPI"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appservice.NewSlot(ctx, "example", &appservice.SlotArgs{
 * 			Name:              server.Hex,
 * 			AppServiceName:    exampleAppService.Name,
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			AppServicePlanId:  examplePlan.ID(),
 * 			SiteConfig: &appservice.SlotSiteConfigArgs{
 * 				DotnetFrameworkVersion: pulumi.String("v4.0"),
 * 			},
 * 			AppSettings: pulumi.StringMap{
 * 				"SOME_KEY": pulumi.String("some-value"),
 * 			},
 * 			ConnectionStrings: appservice.SlotConnectionStringArray{
 * 				&appservice.SlotConnectionStringArgs{
 * 					Name:  pulumi.String("Database"),
 * 					Type:  pulumi.String("SQLServer"),
 * 					Value: pulumi.String("Server=some-server.mydomain.com;Integrated Security=SSPI"),
 * 				},
 * 			},
 * 		})
 * 		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.random.RandomId;
 * import com.pulumi.random.RandomIdArgs;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.appservice.Plan;
 * import com.pulumi.azure.appservice.PlanArgs;
 * import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
 * import com.pulumi.azure.appservice.AppService;
 * import com.pulumi.azure.appservice.AppServiceArgs;
 * import com.pulumi.azure.appservice.inputs.AppServiceSiteConfigArgs;
 * import com.pulumi.azure.appservice.inputs.AppServiceConnectionStringArgs;
 * import com.pulumi.azure.appservice.Slot;
 * import com.pulumi.azure.appservice.SlotArgs;
 * import com.pulumi.azure.appservice.inputs.SlotSiteConfigArgs;
 * import com.pulumi.azure.appservice.inputs.SlotConnectionStringArgs;
 * 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 server = new RandomId("server", RandomIdArgs.builder()
 *             .keepers(Map.of("azi_id", 1))
 *             .byteLength(8)
 *             .build());
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("some-resource-group")
 *             .location("West Europe")
 *             .build());
 *         var examplePlan = new Plan("examplePlan", PlanArgs.builder()
 *             .name("some-app-service-plan")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku(PlanSkuArgs.builder()
 *                 .tier("Standard")
 *                 .size("S1")
 *                 .build())
 *             .build());
 *         var exampleAppService = new AppService("exampleAppService", AppServiceArgs.builder()
 *             .name(server.hex())
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .appServicePlanId(examplePlan.id())
 *             .siteConfig(AppServiceSiteConfigArgs.builder()
 *                 .dotnetFrameworkVersion("v4.0")
 *                 .build())
 *             .appSettings(Map.of("SOME_KEY", "some-value"))
 *             .connectionStrings(AppServiceConnectionStringArgs.builder()
 *                 .name("Database")
 *                 .type("SQLServer")
 *                 .value("Server=some-server.mydomain.com;Integrated Security=SSPI")
 *                 .build())
 *             .build());
 *         var exampleSlot = new Slot("exampleSlot", SlotArgs.builder()
 *             .name(server.hex())
 *             .appServiceName(exampleAppService.name())
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .appServicePlanId(examplePlan.id())
 *             .siteConfig(SlotSiteConfigArgs.builder()
 *                 .dotnetFrameworkVersion("v4.0")
 *                 .build())
 *             .appSettings(Map.of("SOME_KEY", "some-value"))
 *             .connectionStrings(SlotConnectionStringArgs.builder()
 *                 .name("Database")
 *                 .type("SQLServer")
 *                 .value("Server=some-server.mydomain.com;Integrated Security=SSPI")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   server:
 *     type: random:RandomId
 *     properties:
 *       keepers:
 *         azi_id: 1
 *       byteLength: 8
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: some-resource-group
 *       location: West Europe
 *   examplePlan:
 *     type: azure:appservice:Plan
 *     name: example
 *     properties:
 *       name: some-app-service-plan
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       sku:
 *         tier: Standard
 *         size: S1
 *   exampleAppService:
 *     type: azure:appservice:AppService
 *     name: example
 *     properties:
 *       name: ${server.hex}
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       appServicePlanId: ${examplePlan.id}
 *       siteConfig:
 *         dotnetFrameworkVersion: v4.0
 *       appSettings:
 *         SOME_KEY: some-value
 *       connectionStrings:
 *         - name: Database
 *           type: SQLServer
 *           value: Server=some-server.mydomain.com;Integrated Security=SSPI
 *   exampleSlot:
 *     type: azure:appservice:Slot
 *     name: example
 *     properties:
 *       name: ${server.hex}
 *       appServiceName: ${exampleAppService.name}
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       appServicePlanId: ${examplePlan.id}
 *       siteConfig:
 *         dotnetFrameworkVersion: v4.0
 *       appSettings:
 *         SOME_KEY: some-value
 *       connectionStrings:
 *         - name: Database
 *           type: SQLServer
 *           value: Server=some-server.mydomain.com;Integrated Security=SSPI
 * ```
 * 
 * ### Java 1.8)
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as random from "@pulumi/random";
 * const server = new random.RandomId("server", {
 *     keepers: {
 *         azi_id: "1",
 *     },
 *     byteLength: 8,
 * });
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "some-resource-group",
 *     location: "West Europe",
 * });
 * const examplePlan = new azure.appservice.Plan("example", {
 *     name: "some-app-service-plan",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: {
 *         tier: "Standard",
 *         size: "S1",
 *     },
 * });
 * const exampleAppService = new azure.appservice.AppService("example", {
 *     name: server.hex,
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     appServicePlanId: examplePlan.id,
 *     siteConfig: {
 *         javaVersion: "1.8",
 *         javaContainer: "JETTY",
 *         javaContainerVersion: "9.3",
 *     },
 * });
 * const exampleSlot = new azure.appservice.Slot("example", {
 *     name: server.hex,
 *     appServiceName: exampleAppService.name,
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     appServicePlanId: examplePlan.id,
 *     siteConfig: {
 *         javaVersion: "1.8",
 *         javaContainer: "JETTY",
 *         javaContainerVersion: "9.3",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_random as random
 * server = random.RandomId("server",
 *     keepers={
 *         "azi_id": "1",
 *     },
 *     byte_length=8)
 * example = azure.core.ResourceGroup("example",
 *     name="some-resource-group",
 *     location="West Europe")
 * example_plan = azure.appservice.Plan("example",
 *     name="some-app-service-plan",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku={
 *         "tier": "Standard",
 *         "size": "S1",
 *     })
 * example_app_service = azure.appservice.AppService("example",
 *     name=server.hex,
 *     location=example.location,
 *     resource_group_name=example.name,
 *     app_service_plan_id=example_plan.id,
 *     site_config={
 *         "java_version": "1.8",
 *         "java_container": "JETTY",
 *         "java_container_version": "9.3",
 *     })
 * example_slot = azure.appservice.Slot("example",
 *     name=server.hex,
 *     app_service_name=example_app_service.name,
 *     location=example.location,
 *     resource_group_name=example.name,
 *     app_service_plan_id=example_plan.id,
 *     site_config={
 *         "java_version": "1.8",
 *         "java_container": "JETTY",
 *         "java_container_version": "9.3",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Random = Pulumi.Random;
 * return await Deployment.RunAsync(() =>
 * {
 *     var server = new Random.RandomId("server", new()
 *     {
 *         Keepers =
 *         {
 *             { "azi_id", "1" },
 *         },
 *         ByteLength = 8,
 *     });
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "some-resource-group",
 *         Location = "West Europe",
 *     });
 *     var examplePlan = new Azure.AppService.Plan("example", new()
 *     {
 *         Name = "some-app-service-plan",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Sku = new Azure.AppService.Inputs.PlanSkuArgs
 *         {
 *             Tier = "Standard",
 *             Size = "S1",
 *         },
 *     });
 *     var exampleAppService = new Azure.AppService.AppService("example", new()
 *     {
 *         Name = server.Hex,
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AppServicePlanId = examplePlan.Id,
 *         SiteConfig = new Azure.AppService.Inputs.AppServiceSiteConfigArgs
 *         {
 *             JavaVersion = "1.8",
 *             JavaContainer = "JETTY",
 *             JavaContainerVersion = "9.3",
 *         },
 *     });
 *     var exampleSlot = new Azure.AppService.Slot("example", new()
 *     {
 *         Name = server.Hex,
 *         AppServiceName = exampleAppService.Name,
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AppServicePlanId = examplePlan.Id,
 *         SiteConfig = new Azure.AppService.Inputs.SlotSiteConfigArgs
 *         {
 *             JavaVersion = "1.8",
 *             JavaContainer = "JETTY",
 *             JavaContainerVersion = "9.3",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		server, err := random.NewRandomId(ctx, "server", &random.RandomIdArgs{
 * 			Keepers: pulumi.StringMap{
 * 				"azi_id": pulumi.String("1"),
 * 			},
 * 			ByteLength: pulumi.Int(8),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("some-resource-group"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		examplePlan, err := appservice.NewPlan(ctx, "example", &appservice.PlanArgs{
 * 			Name:              pulumi.String("some-app-service-plan"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Sku: &appservice.PlanSkuArgs{
 * 				Tier: pulumi.String("Standard"),
 * 				Size: pulumi.String("S1"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAppService, err := appservice.NewAppService(ctx, "example", &appservice.AppServiceArgs{
 * 			Name:              server.Hex,
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			AppServicePlanId:  examplePlan.ID(),
 * 			SiteConfig: &appservice.AppServiceSiteConfigArgs{
 * 				JavaVersion:          pulumi.String("1.8"),
 * 				JavaContainer:        pulumi.String("JETTY"),
 * 				JavaContainerVersion: pulumi.String("9.3"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appservice.NewSlot(ctx, "example", &appservice.SlotArgs{
 * 			Name:              server.Hex,
 * 			AppServiceName:    exampleAppService.Name,
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			AppServicePlanId:  examplePlan.ID(),
 * 			SiteConfig: &appservice.SlotSiteConfigArgs{
 * 				JavaVersion:          pulumi.String("1.8"),
 * 				JavaContainer:        pulumi.String("JETTY"),
 * 				JavaContainerVersion: pulumi.String("9.3"),
 * 			},
 * 		})
 * 		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.random.RandomId;
 * import com.pulumi.random.RandomIdArgs;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.appservice.Plan;
 * import com.pulumi.azure.appservice.PlanArgs;
 * import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
 * import com.pulumi.azure.appservice.AppService;
 * import com.pulumi.azure.appservice.AppServiceArgs;
 * import com.pulumi.azure.appservice.inputs.AppServiceSiteConfigArgs;
 * import com.pulumi.azure.appservice.Slot;
 * import com.pulumi.azure.appservice.SlotArgs;
 * import com.pulumi.azure.appservice.inputs.SlotSiteConfigArgs;
 * 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 server = new RandomId("server", RandomIdArgs.builder()
 *             .keepers(Map.of("azi_id", 1))
 *             .byteLength(8)
 *             .build());
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("some-resource-group")
 *             .location("West Europe")
 *             .build());
 *         var examplePlan = new Plan("examplePlan", PlanArgs.builder()
 *             .name("some-app-service-plan")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku(PlanSkuArgs.builder()
 *                 .tier("Standard")
 *                 .size("S1")
 *                 .build())
 *             .build());
 *         var exampleAppService = new AppService("exampleAppService", AppServiceArgs.builder()
 *             .name(server.hex())
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .appServicePlanId(examplePlan.id())
 *             .siteConfig(AppServiceSiteConfigArgs.builder()
 *                 .javaVersion("1.8")
 *                 .javaContainer("JETTY")
 *                 .javaContainerVersion("9.3")
 *                 .build())
 *             .build());
 *         var exampleSlot = new Slot("exampleSlot", SlotArgs.builder()
 *             .name(server.hex())
 *             .appServiceName(exampleAppService.name())
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .appServicePlanId(examplePlan.id())
 *             .siteConfig(SlotSiteConfigArgs.builder()
 *                 .javaVersion("1.8")
 *                 .javaContainer("JETTY")
 *                 .javaContainerVersion("9.3")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   server:
 *     type: random:RandomId
 *     properties:
 *       keepers:
 *         azi_id: 1
 *       byteLength: 8
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: some-resource-group
 *       location: West Europe
 *   examplePlan:
 *     type: azure:appservice:Plan
 *     name: example
 *     properties:
 *       name: some-app-service-plan
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       sku:
 *         tier: Standard
 *         size: S1
 *   exampleAppService:
 *     type: azure:appservice:AppService
 *     name: example
 *     properties:
 *       name: ${server.hex}
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       appServicePlanId: ${examplePlan.id}
 *       siteConfig:
 *         javaVersion: '1.8'
 *         javaContainer: JETTY
 *         javaContainerVersion: '9.3'
 *   exampleSlot:
 *     type: azure:appservice:Slot
 *     name: example
 *     properties:
 *       name: ${server.hex}
 *       appServiceName: ${exampleAppService.name}
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       appServicePlanId: ${examplePlan.id}
 *       siteConfig:
 *         javaVersion: '1.8'
 *         javaContainer: JETTY
 *         javaContainerVersion: '9.3'
 * ```
 * 
 * ## Import
 * App Service Slots can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appservice/slot:Slot instance1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/website1/slots/instance1
 * ```
 */
public class Slot internal constructor(
    override val javaResource: com.pulumi.azure.appservice.Slot,
) : KotlinCustomResource(javaResource, SlotMapper) {
    /**
     * The name of the App Service within which to create the App Service Slot. Changing this forces a new resource to be created.
     */
    public val appServiceName: Output
        get() = javaResource.appServiceName().applyValue({ args0 -> args0 })

    /**
     * The ID of the App Service Plan within which to create this App Service Slot. Changing this forces a new resource to be created.
     */
    public val appServicePlanId: Output
        get() = javaResource.appServicePlanId().applyValue({ args0 -> args0 })

    /**
     * A key-value pair of App Settings.
     */
    public val appSettings: Output>
        get() = javaResource.appSettings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * A `auth_settings` block as defined below.
     */
    public val authSettings: Output
        get() = javaResource.authSettings().applyValue({ args0 ->
            args0.let({ args0 ->
                slotAuthSettingsToKotlin(args0)
            })
        })

    /**
     * Should the App Service Slot send session affinity cookies, which route client requests in the same session to the same instance?
     */
    public val clientAffinityEnabled: Output
        get() = javaResource.clientAffinityEnabled().applyValue({ args0 -> args0 })

    /**
     * An `connection_string` block as defined below.
     */
    public val connectionStrings: Output>
        get() = javaResource.connectionStrings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> slotConnectionStringToKotlin(args0) })
            })
        })

    /**
     * The Default Hostname associated with the App Service Slot - such as `mysite.azurewebsites.net`
     */
    public val defaultSiteHostname: Output
        get() = javaResource.defaultSiteHostname().applyValue({ args0 -> args0 })

    /**
     * Is the App Service Slot Enabled? Defaults to `true`.
     */
    public val enabled: Output?
        get() = javaResource.enabled().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Can the App Service Slot only be accessed via HTTPS? 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 ->
                    slotIdentityToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The User Assigned Identity Id used for looking up KeyVault secrets. The identity must be assigned to the application. See [Access vaults with a user-assigned identity](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references#access-vaults-with-a-user-assigned-identity) for more information.
     */
    public val keyVaultReferenceIdentityId: Output
        get() = javaResource.keyVaultReferenceIdentityId().applyValue({ args0 -> args0 })

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

    /**
     * A `logs` block as defined below.
     */
    public val logs: Output
        get() = javaResource.logs().applyValue({ args0 -> args0.let({ args0 -> slotLogsToKotlin(args0) }) })

    /**
     * Specifies the name of the App Service Slot component. 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 in which to create the App Service Slot component. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * A `site_config` object as defined below.
     */
    public val siteConfig: Output
        get() = javaResource.siteConfig().applyValue({ args0 ->
            args0.let({ args0 ->
                slotSiteConfigToKotlin(args0)
            })
        })

    /**
     * A `site_credential` block as defined below, which contains the site-level credentials used to publish to this App Service slot.
     */
    public val siteCredentials: Output>
        get() = javaResource.siteCredentials().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> slotSiteCredentialToKotlin(args0) })
            })
        })

    /**
     * One or more `storage_account` blocks as defined below.
     */
    public val storageAccounts: Output>
        get() = javaResource.storageAccounts().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> slotStorageAccountToKotlin(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)
        })
}

public object SlotMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.appservice.Slot::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy