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

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

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.appservice.kotlin

import com.pulumi.azure.appservice.ServicePlanArgs.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.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages an App Service: Service Plan.
 * ## 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 exampleServicePlan = new azure.appservice.ServicePlan("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     osType: "Linux",
 *     skuName: "P1v2",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_service_plan = azure.appservice.ServicePlan("example",
 *     name="example",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     os_type="Linux",
 *     sku_name="P1v2")
 * ```
 * ```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 exampleServicePlan = new Azure.AppService.ServicePlan("example", new()
 *     {
 *         Name = "example",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         OsType = "Linux",
 *         SkuName = "P1v2",
 *     });
 * });
 * ```
 * ```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/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
 * 		}
 * 		_, err = appservice.NewServicePlan(ctx, "example", &appservice.ServicePlanArgs{
 * 			Name:              pulumi.String("example"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			OsType:            pulumi.String("Linux"),
 * 			SkuName:           pulumi.String("P1v2"),
 * 		})
 * 		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.appservice.ServicePlan;
 * import com.pulumi.azure.appservice.ServicePlanArgs;
 * 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 exampleServicePlan = new ServicePlan("exampleServicePlan", ServicePlanArgs.builder()
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .osType("Linux")
 *             .skuName("P1v2")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleServicePlan:
 *     type: azure:appservice:ServicePlan
 *     name: example
 *     properties:
 *       name: example
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       osType: Linux
 *       skuName: P1v2
 * ```
 * 
 * ## Import
 * AppServices can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appservice/servicePlan:ServicePlan example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Web/serverFarms/farm1
 * ```
 * @property appServiceEnvironmentId The ID of the App Service Environment to create this Service Plan in.
 * > **NOTE:** Requires an Isolated SKU. Use one of `I1`, `I2`, `I3` for `azure.appservice.Environment`, or `I1v2`, `I2v2`, `I3v2` for `azure.appservice.EnvironmentV3`
 * @property location The Azure Region where the Service Plan should exist. Changing this forces a new Service Plan to be created.
 * @property maximumElasticWorkerCount The maximum number of workers to use in an Elastic SKU Plan. Cannot be set unless using an Elastic SKU.
 * @property name The name which should be used for this Service Plan. Changing this forces a new Service Plan to be created.
 * @property osType The O/S type for the App Services to be hosted in this plan. Possible values include `Windows`, `Linux`, and `WindowsContainer`. Changing this forces a new resource to be created.
 * @property perSiteScalingEnabled Should Per Site Scaling be enabled. Defaults to `false`.
 * @property resourceGroupName The name of the Resource Group where the Service Plan should exist. Changing this forces a new Service Plan to be created.
 * @property skuName The SKU for the plan. Possible values include `B1`, `B2`, `B3`, `D1`, `F1`, `I1`, `I2`, `I3`, `I1v2`, `I2v2`, `I3v2`, `I4v2`, `I5v2`, `I6v2`, `P1v2`, `P2v2`, `P3v2`, `P0v3`, `P1v3`, `P2v3`, `P3v3`, `P1mv3`, `P2mv3`, `P3mv3`, `P4mv3`, `P5mv3`, `S1`, `S2`, `S3`, `SHARED`, `EP1`, `EP2`, `EP3`, `FC1`, `WS1`, `WS2`, `WS3`, and `Y1`.
 * > **NOTE:** Isolated SKUs (`I1`, `I2`, `I3`, `I1v2`, `I2v2`, and `I3v2`) can only be used with App Service Environments
 * > **NOTE:** Elastic and Consumption SKUs (`Y1`, `FC1`, `EP1`, `EP2`, and `EP3`) are for use with Function Apps.
 * @property tags A mapping of tags which should be assigned to the AppService.
 * @property workerCount The number of Workers (instances) to be allocated.
 * @property zoneBalancingEnabled Should the Service Plan balance across Availability Zones in the region. Changing this forces a new resource to be created.
 * > **NOTE:** If this setting is set to `true` and the `worker_count` value is specified, it should be set to a multiple of the number of availability zones in the region. Please see the Azure documentation for the number of Availability Zones in your region.
 */
public data class ServicePlanArgs(
    public val appServiceEnvironmentId: Output? = null,
    public val location: Output? = null,
    public val maximumElasticWorkerCount: Output? = null,
    public val name: Output? = null,
    public val osType: Output? = null,
    public val perSiteScalingEnabled: Output? = null,
    public val resourceGroupName: Output? = null,
    public val skuName: Output? = null,
    public val tags: Output>? = null,
    public val workerCount: Output? = null,
    public val zoneBalancingEnabled: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.appservice.ServicePlanArgs =
        com.pulumi.azure.appservice.ServicePlanArgs.builder()
            .appServiceEnvironmentId(appServiceEnvironmentId?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .maximumElasticWorkerCount(maximumElasticWorkerCount?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .osType(osType?.applyValue({ args0 -> args0 }))
            .perSiteScalingEnabled(perSiteScalingEnabled?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .skuName(skuName?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .workerCount(workerCount?.applyValue({ args0 -> args0 }))
            .zoneBalancingEnabled(zoneBalancingEnabled?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ServicePlanArgs].
 */
@PulumiTagMarker
public class ServicePlanArgsBuilder internal constructor() {
    private var appServiceEnvironmentId: Output? = null

    private var location: Output? = null

    private var maximumElasticWorkerCount: Output? = null

    private var name: Output? = null

    private var osType: Output? = null

    private var perSiteScalingEnabled: Output? = null

    private var resourceGroupName: Output? = null

    private var skuName: Output? = null

    private var tags: Output>? = null

    private var workerCount: Output? = null

    private var zoneBalancingEnabled: Output? = null

    /**
     * @param value The ID of the App Service Environment to create this Service Plan in.
     * > **NOTE:** Requires an Isolated SKU. Use one of `I1`, `I2`, `I3` for `azure.appservice.Environment`, or `I1v2`, `I2v2`, `I3v2` for `azure.appservice.EnvironmentV3`
     */
    @JvmName("spwxofmckpoatjwc")
    public suspend fun appServiceEnvironmentId(`value`: Output) {
        this.appServiceEnvironmentId = value
    }

    /**
     * @param value The Azure Region where the Service Plan should exist. Changing this forces a new Service Plan to be created.
     */
    @JvmName("pklxwbcubkmcqtya")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The maximum number of workers to use in an Elastic SKU Plan. Cannot be set unless using an Elastic SKU.
     */
    @JvmName("iitaktxgthyqljpt")
    public suspend fun maximumElasticWorkerCount(`value`: Output) {
        this.maximumElasticWorkerCount = value
    }

    /**
     * @param value The name which should be used for this Service Plan. Changing this forces a new Service Plan to be created.
     */
    @JvmName("qxjlouvhdelepmru")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The O/S type for the App Services to be hosted in this plan. Possible values include `Windows`, `Linux`, and `WindowsContainer`. Changing this forces a new resource to be created.
     */
    @JvmName("xbpnfdbtjoktcueu")
    public suspend fun osType(`value`: Output) {
        this.osType = value
    }

    /**
     * @param value Should Per Site Scaling be enabled. Defaults to `false`.
     */
    @JvmName("qonhhscmmnurhvik")
    public suspend fun perSiteScalingEnabled(`value`: Output) {
        this.perSiteScalingEnabled = value
    }

    /**
     * @param value The name of the Resource Group where the Service Plan should exist. Changing this forces a new Service Plan to be created.
     */
    @JvmName("uatemblyymrxbpbi")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The SKU for the plan. Possible values include `B1`, `B2`, `B3`, `D1`, `F1`, `I1`, `I2`, `I3`, `I1v2`, `I2v2`, `I3v2`, `I4v2`, `I5v2`, `I6v2`, `P1v2`, `P2v2`, `P3v2`, `P0v3`, `P1v3`, `P2v3`, `P3v3`, `P1mv3`, `P2mv3`, `P3mv3`, `P4mv3`, `P5mv3`, `S1`, `S2`, `S3`, `SHARED`, `EP1`, `EP2`, `EP3`, `FC1`, `WS1`, `WS2`, `WS3`, and `Y1`.
     * > **NOTE:** Isolated SKUs (`I1`, `I2`, `I3`, `I1v2`, `I2v2`, and `I3v2`) can only be used with App Service Environments
     * > **NOTE:** Elastic and Consumption SKUs (`Y1`, `FC1`, `EP1`, `EP2`, and `EP3`) are for use with Function Apps.
     */
    @JvmName("ngpsdhcmukqminfx")
    public suspend fun skuName(`value`: Output) {
        this.skuName = value
    }

    /**
     * @param value A mapping of tags which should be assigned to the AppService.
     */
    @JvmName("ybfjlmfpbkpxfmcd")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The number of Workers (instances) to be allocated.
     */
    @JvmName("gaefskcwchwichax")
    public suspend fun workerCount(`value`: Output) {
        this.workerCount = value
    }

    /**
     * @param value Should the Service Plan balance across Availability Zones in the region. Changing this forces a new resource to be created.
     * > **NOTE:** If this setting is set to `true` and the `worker_count` value is specified, it should be set to a multiple of the number of availability zones in the region. Please see the Azure documentation for the number of Availability Zones in your region.
     */
    @JvmName("mvktmaxvrdkqobcd")
    public suspend fun zoneBalancingEnabled(`value`: Output) {
        this.zoneBalancingEnabled = value
    }

    /**
     * @param value The ID of the App Service Environment to create this Service Plan in.
     * > **NOTE:** Requires an Isolated SKU. Use one of `I1`, `I2`, `I3` for `azure.appservice.Environment`, or `I1v2`, `I2v2`, `I3v2` for `azure.appservice.EnvironmentV3`
     */
    @JvmName("mtxvlckefcfdtgfj")
    public suspend fun appServiceEnvironmentId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.appServiceEnvironmentId = mapped
    }

    /**
     * @param value The Azure Region where the Service Plan should exist. Changing this forces a new Service Plan to be created.
     */
    @JvmName("udfsvlbotidkpmkv")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The maximum number of workers to use in an Elastic SKU Plan. Cannot be set unless using an Elastic SKU.
     */
    @JvmName("hotekilaqkeigpwu")
    public suspend fun maximumElasticWorkerCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maximumElasticWorkerCount = mapped
    }

    /**
     * @param value The name which should be used for this Service Plan. Changing this forces a new Service Plan to be created.
     */
    @JvmName("clsryiepimpqbwfe")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The O/S type for the App Services to be hosted in this plan. Possible values include `Windows`, `Linux`, and `WindowsContainer`. Changing this forces a new resource to be created.
     */
    @JvmName("csioodwkgujhbcux")
    public suspend fun osType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.osType = mapped
    }

    /**
     * @param value Should Per Site Scaling be enabled. Defaults to `false`.
     */
    @JvmName("chdgpcuuoeasyvak")
    public suspend fun perSiteScalingEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.perSiteScalingEnabled = mapped
    }

    /**
     * @param value The name of the Resource Group where the Service Plan should exist. Changing this forces a new Service Plan to be created.
     */
    @JvmName("rgjcwewtcldtbgmu")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The SKU for the plan. Possible values include `B1`, `B2`, `B3`, `D1`, `F1`, `I1`, `I2`, `I3`, `I1v2`, `I2v2`, `I3v2`, `I4v2`, `I5v2`, `I6v2`, `P1v2`, `P2v2`, `P3v2`, `P0v3`, `P1v3`, `P2v3`, `P3v3`, `P1mv3`, `P2mv3`, `P3mv3`, `P4mv3`, `P5mv3`, `S1`, `S2`, `S3`, `SHARED`, `EP1`, `EP2`, `EP3`, `FC1`, `WS1`, `WS2`, `WS3`, and `Y1`.
     * > **NOTE:** Isolated SKUs (`I1`, `I2`, `I3`, `I1v2`, `I2v2`, and `I3v2`) can only be used with App Service Environments
     * > **NOTE:** Elastic and Consumption SKUs (`Y1`, `FC1`, `EP1`, `EP2`, and `EP3`) are for use with Function Apps.
     */
    @JvmName("dgdmfvggojybevgf")
    public suspend fun skuName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.skuName = mapped
    }

    /**
     * @param value A mapping of tags which should be assigned to the AppService.
     */
    @JvmName("evdpodsuwtordufo")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags which should be assigned to the AppService.
     */
    @JvmName("ehsbpvywutflngiq")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The number of Workers (instances) to be allocated.
     */
    @JvmName("tbogmqleuqejgtee")
    public suspend fun workerCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.workerCount = mapped
    }

    /**
     * @param value Should the Service Plan balance across Availability Zones in the region. Changing this forces a new resource to be created.
     * > **NOTE:** If this setting is set to `true` and the `worker_count` value is specified, it should be set to a multiple of the number of availability zones in the region. Please see the Azure documentation for the number of Availability Zones in your region.
     */
    @JvmName("tyglbqivqiulbptf")
    public suspend fun zoneBalancingEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zoneBalancingEnabled = mapped
    }

    internal fun build(): ServicePlanArgs = ServicePlanArgs(
        appServiceEnvironmentId = appServiceEnvironmentId,
        location = location,
        maximumElasticWorkerCount = maximumElasticWorkerCount,
        name = name,
        osType = osType,
        perSiteScalingEnabled = perSiteScalingEnabled,
        resourceGroupName = resourceGroupName,
        skuName = skuName,
        tags = tags,
        workerCount = workerCount,
        zoneBalancingEnabled = zoneBalancingEnabled,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy