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

com.pulumi.azure.appservice.Plan Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.

There is a newer version: 6.10.0-alpha.1731737215
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.appservice;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.appservice.PlanArgs;
import com.pulumi.azure.appservice.inputs.PlanState;
import com.pulumi.azure.appservice.outputs.PlanSku;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * 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)
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * 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());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ### Shared / Consumption Plan) * * <!--Start PulumiCodeChooser --> *
 * {@code
 * 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());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ### Linux) * * <!--Start PulumiCodeChooser --> *
 * {@code
 * 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());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ### Windows Container) * * <!--Start PulumiCodeChooser --> *
 * {@code
 * 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());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## 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 * ``` * */ @ResourceType(type="azure:appservice/plan:Plan") public class Plan extends com.pulumi.resources.CustomResource { /** * 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). * */ @Export(name="appServiceEnvironmentId", refs={String.class}, tree="[0]") private Output appServiceEnvironmentId; /** * @return 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 Output> appServiceEnvironmentId() { return Codegen.optional(this.appServiceEnvironmentId); } /** * Whether to create a xenon App Service Plan. * */ @Export(name="isXenon", refs={Boolean.class}, tree="[0]") private Output isXenon; /** * @return Whether to create a xenon App Service Plan. * */ public Output> isXenon() { return Codegen.optional(this.isXenon); } /** * 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`. * */ @Export(name="kind", refs={String.class}, tree="[0]") private Output kind; /** * @return 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 Output> kind() { return Codegen.optional(this.kind); } /** * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. * */ public Output location() { return this.location; } /** * The maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan. * */ @Export(name="maximumElasticWorkerCount", refs={Integer.class}, tree="[0]") private Output maximumElasticWorkerCount; /** * @return The maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan. * */ public Output maximumElasticWorkerCount() { return this.maximumElasticWorkerCount; } /** * The maximum number of workers supported with the App Service Plan's sku. * */ @Export(name="maximumNumberOfWorkers", refs={Integer.class}, tree="[0]") private Output maximumNumberOfWorkers; /** * @return The maximum number of workers supported with the App Service Plan's sku. * */ public Output maximumNumberOfWorkers() { return this.maximumNumberOfWorkers; } /** * Specifies the name of the App Service Plan component. Changing this forces a new resource to be created. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Specifies the name of the App Service Plan component. Changing this forces a new resource to be created. * */ public Output name() { return this.name; } /** * 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. * */ @Export(name="perSiteScaling", refs={Boolean.class}, tree="[0]") private Output perSiteScaling; /** * @return 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 Output> perSiteScaling() { return Codegen.optional(this.perSiteScaling); } /** * Is this App Service Plan `Reserved`. * */ @Export(name="reserved", refs={Boolean.class}, tree="[0]") private Output reserved; /** * @return Is this App Service Plan `Reserved`. * */ public Output> reserved() { return Codegen.optional(this.reserved); } /** * The name of the resource group in which to create the App Service Plan component. Changing this forces a new resource to be created. * */ @Export(name="resourceGroupName", refs={String.class}, tree="[0]") private Output resourceGroupName; /** * @return 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 Output resourceGroupName() { return this.resourceGroupName; } /** * A `sku` block as documented below. * */ @Export(name="sku", refs={PlanSku.class}, tree="[0]") private Output sku; /** * @return A `sku` block as documented below. * */ public Output sku() { return this.sku; } /** * A mapping of tags to assign to the resource. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return A mapping of tags to assign to the resource. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * 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). * */ @Export(name="zoneRedundant", refs={Boolean.class}, tree="[0]") private Output zoneRedundant; /** * @return 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 Output> zoneRedundant() { return Codegen.optional(this.zoneRedundant); } /** * * @param name The _unique_ name of the resulting resource. */ public Plan(java.lang.String name) { this(name, PlanArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Plan(java.lang.String name, PlanArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public Plan(java.lang.String name, PlanArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:appservice/plan:Plan", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Plan(java.lang.String name, Output id, @Nullable PlanState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:appservice/plan:Plan", name, state, makeResourceOptions(options, id), false); } private static PlanArgs makeArgs(PlanArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? PlanArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state * @param options Optional settings to control the behavior of the CustomResource. */ public static Plan get(java.lang.String name, Output id, @Nullable PlanState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Plan(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy