com.pulumi.azure.appservice.Slot Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
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.
// *** 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.SlotArgs;
import com.pulumi.azure.appservice.inputs.SlotState;
import com.pulumi.azure.appservice.outputs.SlotAuthSettings;
import com.pulumi.azure.appservice.outputs.SlotConnectionString;
import com.pulumi.azure.appservice.outputs.SlotIdentity;
import com.pulumi.azure.appservice.outputs.SlotLogs;
import com.pulumi.azure.appservice.outputs.SlotSiteConfig;
import com.pulumi.azure.appservice.outputs.SlotSiteCredential;
import com.pulumi.azure.appservice.outputs.SlotStorageAccount;
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.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* 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` and `azure.appservice.WindowsWebAppSlot` 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)
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ### Java 1.8)
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## 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
* ```
*
*/
@ResourceType(type="azure:appservice/slot:Slot")
public class Slot extends com.pulumi.resources.CustomResource {
/**
* The name of the App Service within which to create the App Service Slot. Changing this forces a new resource to be created.
*
*/
@Export(name="appServiceName", refs={String.class}, tree="[0]")
private Output appServiceName;
/**
* @return The name of the App Service within which to create the App Service Slot. Changing this forces a new resource to be created.
*
*/
public Output appServiceName() {
return this.appServiceName;
}
/**
* The ID of the App Service Plan within which to create this App Service Slot. Changing this forces a new resource to be created.
*
*/
@Export(name="appServicePlanId", refs={String.class}, tree="[0]")
private Output appServicePlanId;
/**
* @return 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 Output appServicePlanId() {
return this.appServicePlanId;
}
/**
* A key-value pair of App Settings.
*
*/
@Export(name="appSettings", refs={Map.class,String.class}, tree="[0,1,1]")
private Output