Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azure.appservice.kotlin.Plan.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.appservice.kotlin
import com.pulumi.azure.appservice.kotlin.outputs.PlanSku
import com.pulumi.azure.appservice.kotlin.outputs.PlanSku.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
/**
* Builder for [Plan].
*/
@PulumiTagMarker
public class PlanResourceBuilder internal constructor() {
public var name: String? = null
public var args: PlanArgs = PlanArgs()
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 PlanArgsBuilder.() -> Unit) {
val builder = PlanArgsBuilder()
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(): Plan {
val builtJavaResource = com.pulumi.azure.appservice.Plan(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Plan(builtJavaResource)
}
}
/**
* Manages an App Service Plan component.
* !> **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.ServicePlan` resource instead.
* ## Example Usage
* ### Dedicated)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "api-rg-pro",
* location: "West Europe",
* });
* const examplePlan = new azure.appservice.Plan("example", {
* name: "api-appserviceplan-pro",
* location: example.location,
* resourceGroupName: example.name,
* sku: {
* tier: "Standard",
* size: "S1",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="api-rg-pro",
* location="West Europe")
* example_plan = azure.appservice.Plan("example",
* name="api-appserviceplan-pro",
* location=example.location,
* resource_group_name=example.name,
* sku={
* "tier": "Standard",
* "size": "S1",
* })
* ```
* ```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 = "api-rg-pro",
* Location = "West Europe",
* });
* var examplePlan = new Azure.AppService.Plan("example", new()
* {
* Name = "api-appserviceplan-pro",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Sku = new Azure.AppService.Inputs.PlanSkuArgs
* {
* Tier = "Standard",
* Size = "S1",
* },
* });
* });
* ```
* ```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("api-rg-pro"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* _, err = appservice.NewPlan(ctx, "example", &appservice.PlanArgs{
* Name: pulumi.String("api-appserviceplan-pro"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Sku: &appservice.PlanSkuArgs{
* Tier: pulumi.String("Standard"),
* Size: pulumi.String("S1"),
* },
* })
* 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.Plan;
* import com.pulumi.azure.appservice.PlanArgs;
* import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
* 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("api-rg-pro")
* .location("West Europe")
* .build());
* var examplePlan = new Plan("examplePlan", PlanArgs.builder()
* .name("api-appserviceplan-pro")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku(PlanSkuArgs.builder()
* .tier("Standard")
* .size("S1")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: api-rg-pro
* location: West Europe
* examplePlan:
* type: azure:appservice:Plan
* name: example
* properties:
* name: api-appserviceplan-pro
* location: ${example.location}
* resourceGroupName: ${example.name}
* sku:
* tier: Standard
* size: S1
* ```
*
* ### Shared / Consumption Plan)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "api-rg-pro",
* location: "West Europe",
* });
* const examplePlan = new azure.appservice.Plan("example", {
* name: "api-appserviceplan-pro",
* location: example.location,
* resourceGroupName: example.name,
* kind: "FunctionApp",
* sku: {
* tier: "Dynamic",
* size: "Y1",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="api-rg-pro",
* location="West Europe")
* example_plan = azure.appservice.Plan("example",
* name="api-appserviceplan-pro",
* location=example.location,
* resource_group_name=example.name,
* kind="FunctionApp",
* sku={
* "tier": "Dynamic",
* "size": "Y1",
* })
* ```
* ```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 = "api-rg-pro",
* Location = "West Europe",
* });
* var examplePlan = new Azure.AppService.Plan("example", new()
* {
* Name = "api-appserviceplan-pro",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Kind = "FunctionApp",
* Sku = new Azure.AppService.Inputs.PlanSkuArgs
* {
* Tier = "Dynamic",
* Size = "Y1",
* },
* });
* });
* ```
* ```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("api-rg-pro"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* _, err = appservice.NewPlan(ctx, "example", &appservice.PlanArgs{
* Name: pulumi.String("api-appserviceplan-pro"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Kind: pulumi.Any("FunctionApp"),
* Sku: &appservice.PlanSkuArgs{
* Tier: pulumi.String("Dynamic"),
* Size: pulumi.String("Y1"),
* },
* })
* 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.Plan;
* import com.pulumi.azure.appservice.PlanArgs;
* import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
* 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("api-rg-pro")
* .location("West Europe")
* .build());
* var examplePlan = new Plan("examplePlan", PlanArgs.builder()
* .name("api-appserviceplan-pro")
* .location(example.location())
* .resourceGroupName(example.name())
* .kind("FunctionApp")
* .sku(PlanSkuArgs.builder()
* .tier("Dynamic")
* .size("Y1")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: api-rg-pro
* location: West Europe
* examplePlan:
* type: azure:appservice:Plan
* name: example
* properties:
* name: api-appserviceplan-pro
* location: ${example.location}
* resourceGroupName: ${example.name}
* kind: FunctionApp
* sku:
* tier: Dynamic
* size: Y1
* ```
*
* ### Linux)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "api-rg-pro",
* location: "West Europe",
* });
* const examplePlan = new azure.appservice.Plan("example", {
* name: "api-appserviceplan-pro",
* location: example.location,
* resourceGroupName: example.name,
* kind: "Linux",
* reserved: true,
* sku: {
* tier: "Standard",
* size: "S1",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="api-rg-pro",
* location="West Europe")
* example_plan = azure.appservice.Plan("example",
* name="api-appserviceplan-pro",
* location=example.location,
* resource_group_name=example.name,
* kind="Linux",
* reserved=True,
* sku={
* "tier": "Standard",
* "size": "S1",
* })
* ```
* ```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 = "api-rg-pro",
* Location = "West Europe",
* });
* var examplePlan = new Azure.AppService.Plan("example", new()
* {
* Name = "api-appserviceplan-pro",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Kind = "Linux",
* Reserved = true,
* Sku = new Azure.AppService.Inputs.PlanSkuArgs
* {
* Tier = "Standard",
* Size = "S1",
* },
* });
* });
* ```
* ```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("api-rg-pro"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* _, err = appservice.NewPlan(ctx, "example", &appservice.PlanArgs{
* Name: pulumi.String("api-appserviceplan-pro"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Kind: pulumi.Any("Linux"),
* Reserved: pulumi.Bool(true),
* Sku: &appservice.PlanSkuArgs{
* Tier: pulumi.String("Standard"),
* Size: pulumi.String("S1"),
* },
* })
* 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.Plan;
* import com.pulumi.azure.appservice.PlanArgs;
* import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
* 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("api-rg-pro")
* .location("West Europe")
* .build());
* var examplePlan = new Plan("examplePlan", PlanArgs.builder()
* .name("api-appserviceplan-pro")
* .location(example.location())
* .resourceGroupName(example.name())
* .kind("Linux")
* .reserved(true)
* .sku(PlanSkuArgs.builder()
* .tier("Standard")
* .size("S1")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: api-rg-pro
* location: West Europe
* examplePlan:
* type: azure:appservice:Plan
* name: example
* properties:
* name: api-appserviceplan-pro
* location: ${example.location}
* resourceGroupName: ${example.name}
* kind: Linux
* reserved: true
* sku:
* tier: Standard
* size: S1
* ```
*
* ### Windows Container)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "api-rg-pro",
* location: "West Europe",
* });
* const examplePlan = new azure.appservice.Plan("example", {
* name: "api-appserviceplan-pro",
* location: example.location,
* resourceGroupName: example.name,
* kind: "xenon",
* isXenon: true,
* sku: {
* tier: "PremiumContainer",
* size: "PC2",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="api-rg-pro",
* location="West Europe")
* example_plan = azure.appservice.Plan("example",
* name="api-appserviceplan-pro",
* location=example.location,
* resource_group_name=example.name,
* kind="xenon",
* is_xenon=True,
* sku={
* "tier": "PremiumContainer",
* "size": "PC2",
* })
* ```
* ```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 = "api-rg-pro",
* Location = "West Europe",
* });
* var examplePlan = new Azure.AppService.Plan("example", new()
* {
* Name = "api-appserviceplan-pro",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Kind = "xenon",
* IsXenon = true,
* Sku = new Azure.AppService.Inputs.PlanSkuArgs
* {
* Tier = "PremiumContainer",
* Size = "PC2",
* },
* });
* });
* ```
* ```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("api-rg-pro"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* _, err = appservice.NewPlan(ctx, "example", &appservice.PlanArgs{
* Name: pulumi.String("api-appserviceplan-pro"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Kind: pulumi.Any("xenon"),
* IsXenon: pulumi.Bool(true),
* Sku: &appservice.PlanSkuArgs{
* Tier: pulumi.String("PremiumContainer"),
* Size: pulumi.String("PC2"),
* },
* })
* 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.Plan;
* import com.pulumi.azure.appservice.PlanArgs;
* import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
* 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("api-rg-pro")
* .location("West Europe")
* .build());
* var examplePlan = new Plan("examplePlan", PlanArgs.builder()
* .name("api-appserviceplan-pro")
* .location(example.location())
* .resourceGroupName(example.name())
* .kind("xenon")
* .isXenon(true)
* .sku(PlanSkuArgs.builder()
* .tier("PremiumContainer")
* .size("PC2")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: api-rg-pro
* location: West Europe
* examplePlan:
* type: azure:appservice:Plan
* name: example
* properties:
* name: api-appserviceplan-pro
* location: ${example.location}
* resourceGroupName: ${example.name}
* kind: xenon
* isXenon: true
* sku:
* tier: PremiumContainer
* size: PC2
* ```
*
* ## Import
* App Service Plan instances can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:appservice/plan:Plan instance1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/serverFarms/instance1
* ```
*/
public class Plan internal constructor(
override val javaResource: com.pulumi.azure.appservice.Plan,
) : KotlinCustomResource(javaResource, PlanMapper) {
/**
* The ID of the App Service Environment where the App Service Plan should be located. Changing forces a new resource to be created.
* > **NOTE:** Attaching to an App Service Environment requires the App Service Plan use a `Premium` SKU (when using an ASEv1) and the `Isolated` SKU (for an ASEv2).
*/
public val appServiceEnvironmentId: Output?
get() = javaResource.appServiceEnvironmentId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Whether to create a xenon App Service Plan.
*/
public val isXenon: Output?
get() = javaResource.isXenon().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The kind of the App Service Plan to create. Possible values are `Windows` (also available as `App`), `Linux`, `elastic` (for Premium Consumption), `xenon` and `FunctionApp` (for a Consumption Plan). Defaults to `Windows`. Changing this forces a new resource to be created.
* > **NOTE:** When creating a `Linux` App Service Plan, the `reserved` field must be set to `true`, and when creating a `Windows`/`app` App Service Plan the `reserved` field must be set to `false`.
*/
public val kind: Output?
get() = javaResource.kind().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* 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 })
/**
* The maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan.
*/
public val maximumElasticWorkerCount: Output
get() = javaResource.maximumElasticWorkerCount().applyValue({ args0 -> args0 })
/**
* The maximum number of workers supported with the App Service Plan's sku.
*/
public val maximumNumberOfWorkers: Output
get() = javaResource.maximumNumberOfWorkers().applyValue({ args0 -> args0 })
/**
* Specifies the name of the App Service Plan component. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Can Apps assigned to this App Service Plan be scaled independently? If set to `false` apps assigned to this plan will scale to all instances of the plan.
*/
public val perSiteScaling: Output?
get() = javaResource.perSiteScaling().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Is this App Service Plan `Reserved`.
*/
public val reserved: Output?
get() = javaResource.reserved().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The name of the resource group in which to create the App Service Plan component. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* A `sku` block as documented below.
*/
public val sku: Output
get() = javaResource.sku().applyValue({ args0 -> args0.let({ args0 -> toKotlin(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)
})
/**
* Specifies if the App Service Plan should be Zone Redundant. Changing this forces a new resource to be created.
* > **NOTE:** Requires either `PremiumV2` or `PremiumV3` SKU and that at least 3 instances. For more information, please see the [App Service Team Blog](https://azure.github.io/AppService/2021/08/25/App-service-support-for-availability-zones.html).
*/
public val zoneRedundant: Output?
get() = javaResource.zoneRedundant().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object PlanMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.appservice.Plan::class == javaResource::class
override fun map(javaResource: Resource): Plan = Plan(
javaResource as
com.pulumi.azure.appservice.Plan,
)
}
/**
* @see [Plan].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Plan].
*/
public suspend fun plan(name: String, block: suspend PlanResourceBuilder.() -> Unit): Plan {
val builder = PlanResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Plan].
* @param name The _unique_ name of the resulting resource.
*/
public fun plan(name: String): Plan {
val builder = PlanResourceBuilder()
builder.name(name)
return builder.build()
}