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

com.pulumi.azure.appservice.Slot 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.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> appSettings; /** * @return A key-value pair of App Settings. * */ public Output> appSettings() { return this.appSettings; } /** * A `auth_settings` block as defined below. * */ @Export(name="authSettings", refs={SlotAuthSettings.class}, tree="[0]") private Output authSettings; /** * @return A `auth_settings` block as defined below. * */ public Output authSettings() { return this.authSettings; } /** * Should the App Service Slot send session affinity cookies, which route client requests in the same session to the same instance? * */ @Export(name="clientAffinityEnabled", refs={Boolean.class}, tree="[0]") private Output clientAffinityEnabled; /** * @return Should the App Service Slot send session affinity cookies, which route client requests in the same session to the same instance? * */ public Output clientAffinityEnabled() { return this.clientAffinityEnabled; } /** * An `connection_string` block as defined below. * */ @Export(name="connectionStrings", refs={List.class,SlotConnectionString.class}, tree="[0,1]") private Output> connectionStrings; /** * @return An `connection_string` block as defined below. * */ public Output> connectionStrings() { return this.connectionStrings; } /** * The Default Hostname associated with the App Service Slot - such as `mysite.azurewebsites.net` * */ @Export(name="defaultSiteHostname", refs={String.class}, tree="[0]") private Output defaultSiteHostname; /** * @return The Default Hostname associated with the App Service Slot - such as `mysite.azurewebsites.net` * */ public Output defaultSiteHostname() { return this.defaultSiteHostname; } /** * Is the App Service Slot Enabled? Defaults to `true`. * */ @Export(name="enabled", refs={Boolean.class}, tree="[0]") private Output enabled; /** * @return Is the App Service Slot Enabled? Defaults to `true`. * */ public Output> enabled() { return Codegen.optional(this.enabled); } /** * Can the App Service Slot only be accessed via HTTPS? Defaults to `false`. * */ @Export(name="httpsOnly", refs={Boolean.class}, tree="[0]") private Output httpsOnly; /** * @return Can the App Service Slot only be accessed via HTTPS? Defaults to `false`. * */ public Output> httpsOnly() { return Codegen.optional(this.httpsOnly); } /** * An `identity` block as defined below. * */ @Export(name="identity", refs={SlotIdentity.class}, tree="[0]") private Output identity; /** * @return An `identity` block as defined below. * */ public Output> identity() { return Codegen.optional(this.identity); } /** * 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. * */ @Export(name="keyVaultReferenceIdentityId", refs={String.class}, tree="[0]") private Output keyVaultReferenceIdentityId; /** * @return 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 Output keyVaultReferenceIdentityId() { return this.keyVaultReferenceIdentityId; } /** * 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; } /** * A `logs` block as defined below. * */ @Export(name="logs", refs={SlotLogs.class}, tree="[0]") private Output logs; /** * @return A `logs` block as defined below. * */ public Output logs() { return this.logs; } /** * Specifies the name of the App Service Slot 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 Slot component. Changing this forces a new resource to be created. * */ public Output name() { return this.name; } /** * The name of the resource group in which to create the App Service Slot 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 Slot component. Changing this forces a new resource to be created. * */ public Output resourceGroupName() { return this.resourceGroupName; } /** * A `site_config` object as defined below. * */ @Export(name="siteConfig", refs={SlotSiteConfig.class}, tree="[0]") private Output siteConfig; /** * @return A `site_config` object as defined below. * */ public Output siteConfig() { return this.siteConfig; } /** * A `site_credential` block as defined below, which contains the site-level credentials used to publish to this App Service slot. * */ @Export(name="siteCredentials", refs={List.class,SlotSiteCredential.class}, tree="[0,1]") private Output> siteCredentials; /** * @return A `site_credential` block as defined below, which contains the site-level credentials used to publish to this App Service slot. * */ public Output> siteCredentials() { return this.siteCredentials; } /** * One or more `storage_account` blocks as defined below. * */ @Export(name="storageAccounts", refs={List.class,SlotStorageAccount.class}, tree="[0,1]") private Output> storageAccounts; /** * @return One or more `storage_account` blocks as defined below. * */ public Output> storageAccounts() { return this.storageAccounts; } /** * 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); } /** * * @param name The _unique_ name of the resulting resource. */ public Slot(java.lang.String name) { this(name, SlotArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Slot(java.lang.String name, SlotArgs 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 Slot(java.lang.String name, SlotArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:appservice/slot:Slot", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Slot(java.lang.String name, Output id, @Nullable SlotState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:appservice/slot:Slot", name, state, makeResourceOptions(options, id), false); } private static SlotArgs makeArgs(SlotArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? SlotArgs.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 Slot get(java.lang.String name, Output id, @Nullable SlotState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Slot(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy