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.FunctionAppSlot 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.
// *** 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.FunctionAppSlotArgs;
import com.pulumi.azure.appservice.inputs.FunctionAppSlotState;
import com.pulumi.azure.appservice.outputs.FunctionAppSlotAuthSettings;
import com.pulumi.azure.appservice.outputs.FunctionAppSlotConnectionString;
import com.pulumi.azure.appservice.outputs.FunctionAppSlotIdentity;
import com.pulumi.azure.appservice.outputs.FunctionAppSlotSiteConfig;
import com.pulumi.azure.appservice.outputs.FunctionAppSlotSiteCredential;
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.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages a Function App deployment Slot.
*
* !> **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.LinuxFunctionAppSlot` and `azure.appservice.WindowsFunctionAppSlot` resources instead.
*
* ## Example Usage
*
* ### With App Service 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.storage.Account;
* import com.pulumi.azure.storage.AccountArgs;
* import com.pulumi.azure.appservice.Plan;
* import com.pulumi.azure.appservice.PlanArgs;
* import com.pulumi.azure.appservice.inputs.PlanSkuArgs;
* import com.pulumi.azure.appservice.FunctionApp;
* import com.pulumi.azure.appservice.FunctionAppArgs;
* import com.pulumi.azure.appservice.FunctionAppSlot;
* import com.pulumi.azure.appservice.FunctionAppSlotArgs;
* 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("azure-functions-test-rg")
* .location("West Europe")
* .build());
*
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("functionsapptestsa")
* .resourceGroupName(example.name())
* .location(example.location())
* .accountTier("Standard")
* .accountReplicationType("LRS")
* .build());
*
* var examplePlan = new Plan("examplePlan", PlanArgs.builder()
* .name("azure-functions-test-service-plan")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku(PlanSkuArgs.builder()
* .tier("Standard")
* .size("S1")
* .build())
* .build());
*
* var exampleFunctionApp = new FunctionApp("exampleFunctionApp", FunctionAppArgs.builder()
* .name("test-azure-functions")
* .location(example.location())
* .resourceGroupName(example.name())
* .appServicePlanId(examplePlan.id())
* .storageAccountName(exampleAccount.name())
* .storageAccountAccessKey(exampleAccount.primaryAccessKey())
* .build());
*
* var exampleFunctionAppSlot = new FunctionAppSlot("exampleFunctionAppSlot", FunctionAppSlotArgs.builder()
* .name("test-azure-functions_slot")
* .location(example.location())
* .resourceGroupName(example.name())
* .appServicePlanId(examplePlan.id())
* .functionAppName(exampleFunctionApp.name())
* .storageAccountName(exampleAccount.name())
* .storageAccountAccessKey(exampleAccount.primaryAccessKey())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Function Apps Deployment Slots can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:appservice/functionAppSlot:FunctionAppSlot functionapp1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/functionapp1/slots/staging
* ```
*
*/
@ResourceType(type="azure:appservice/functionAppSlot:FunctionAppSlot")
public class FunctionAppSlot extends com.pulumi.resources.CustomResource {
/**
* The ID of the App Service Plan within which to create this Function App 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 Function App Slot. Changing this forces a new resource to be created.
*
*/
public Output appServicePlanId() {
return this.appServicePlanId;
}
/**
* A key-value pair of App Settings.
*
* > **Note:** When integrating a `CI/CD pipeline` and expecting to run from a deployed package in `Azure` you must seed your `app settings` as part of the application code for function app to be successfully deployed. `Important Default key pairs`: (`"WEBSITE_RUN_FROM_PACKAGE" = ""`, `"FUNCTIONS_WORKER_RUNTIME" = "node"` (or python, etc), `"WEBSITE_NODE_DEFAULT_VERSION" = "10.14.1"`, `"APPINSIGHTS_INSTRUMENTATIONKEY" = ""`).
*
* > **NOTE:** The values for `AzureWebJobsStorage` and `FUNCTIONS_EXTENSION_VERSION` will be filled by other input arguments and shouldn't be configured separately. `AzureWebJobsStorage` is filled based on `storage_account_name` and `storage_account_access_key`. `FUNCTIONS_EXTENSION_VERSION` is filled based on `version`.
*
* > **Note:** When using an App Service Plan in the `Free` or `Shared` Tiers `use_32_bit_worker_process` must be set to `true`.
*
*/
@Export(name="appSettings", refs={Map.class,String.class}, tree="[0,1,1]")
private Output> appSettings;
/**
* @return A key-value pair of App Settings.
*
* > **Note:** When integrating a `CI/CD pipeline` and expecting to run from a deployed package in `Azure` you must seed your `app settings` as part of the application code for function app to be successfully deployed. `Important Default key pairs`: (`"WEBSITE_RUN_FROM_PACKAGE" = ""`, `"FUNCTIONS_WORKER_RUNTIME" = "node"` (or python, etc), `"WEBSITE_NODE_DEFAULT_VERSION" = "10.14.1"`, `"APPINSIGHTS_INSTRUMENTATIONKEY" = ""`).
*
* > **NOTE:** The values for `AzureWebJobsStorage` and `FUNCTIONS_EXTENSION_VERSION` will be filled by other input arguments and shouldn't be configured separately. `AzureWebJobsStorage` is filled based on `storage_account_name` and `storage_account_access_key`. `FUNCTIONS_EXTENSION_VERSION` is filled based on `version`.
*
* > **Note:** When using an App Service Plan in the `Free` or `Shared` Tiers `use_32_bit_worker_process` must be set to `true`.
*
*/
public Output> appSettings() {
return this.appSettings;
}
/**
* An `auth_settings` block as defined below.
*
*/
@Export(name="authSettings", refs={FunctionAppSlotAuthSettings.class}, tree="[0]")
private Output authSettings;
/**
* @return An `auth_settings` block as defined below.
*
*/
public Output authSettings() {
return this.authSettings;
}
/**
* A `connection_string` block as defined below.
*
*/
@Export(name="connectionStrings", refs={List.class,FunctionAppSlotConnectionString.class}, tree="[0,1]")
private Output> connectionStrings;
/**
* @return A `connection_string` block as defined below.
*
*/
public Output> connectionStrings() {
return this.connectionStrings;
}
/**
* The amount of memory in gigabyte-seconds that your application is allowed to consume per day. Setting this value only affects function apps under the consumption plan.
*
*/
@Export(name="dailyMemoryTimeQuota", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> dailyMemoryTimeQuota;
/**
* @return The amount of memory in gigabyte-seconds that your application is allowed to consume per day. Setting this value only affects function apps under the consumption plan.
*
*/
public Output> dailyMemoryTimeQuota() {
return Codegen.optional(this.dailyMemoryTimeQuota);
}
/**
* The default hostname associated with the Function App - such as `mysite.azurewebsites.net`
*
*/
@Export(name="defaultHostname", refs={String.class}, tree="[0]")
private Output defaultHostname;
/**
* @return The default hostname associated with the Function App - such as `mysite.azurewebsites.net`
*
*/
public Output defaultHostname() {
return this.defaultHostname;
}
/**
* Should the built-in logging of the Function App be enabled? Defaults to `true`.
*
*/
@Export(name="enableBuiltinLogging", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enableBuiltinLogging;
/**
* @return Should the built-in logging of the Function App be enabled? Defaults to `true`.
*
*/
public Output> enableBuiltinLogging() {
return Codegen.optional(this.enableBuiltinLogging);
}
/**
* Is the Function App enabled? Defaults to `true`.
*
*/
@Export(name="enabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enabled;
/**
* @return Is the Function App enabled? Defaults to `true`.
*
*/
public Output> enabled() {
return Codegen.optional(this.enabled);
}
/**
* The name of the Function App within which to create the Function App Slot. Changing this forces a new resource to be created.
*
*/
@Export(name="functionAppName", refs={String.class}, tree="[0]")
private Output functionAppName;
/**
* @return The name of the Function App within which to create the Function App Slot. Changing this forces a new resource to be created.
*
*/
public Output functionAppName() {
return this.functionAppName;
}
/**
* Can the Function App only be accessed via HTTPS? Defaults to `false`.
*
*/
@Export(name="httpsOnly", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> httpsOnly;
/**
* @return Can the Function App 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={FunctionAppSlotIdentity.class}, tree="[0]")
private Output* @Nullable */ FunctionAppSlotIdentity> identity;
/**
* @return An `identity` block as defined below.
*
*/
public Output> identity() {
return Codegen.optional(this.identity);
}
/**
* The Function App kind - such as `functionapp,linux,container`
*
*/
@Export(name="kind", refs={String.class}, tree="[0]")
private Output kind;
/**
* @return The Function App kind - such as `functionapp,linux,container`
*
*/
public Output kind() {
return 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;
}
/**
* Specifies the name of the Function App. 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 Function App. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* A string indicating the Operating System type for this function app. The only possible value is `linux`. Changing this forces a new resource to be created.
*
* > **NOTE:** This value will be `linux` for Linux Derivatives or an empty string for Windows (default).
*
*/
@Export(name="osType", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> osType;
/**
* @return A string indicating the Operating System type for this function app. The only possible value is `linux`. Changing this forces a new resource to be created.
*
* > **NOTE:** This value will be `linux` for Linux Derivatives or an empty string for Windows (default).
*
*/
public Output> osType() {
return Codegen.optional(this.osType);
}
/**
* A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12`
*
*/
@Export(name="outboundIpAddresses", refs={String.class}, tree="[0]")
private Output outboundIpAddresses;
/**
* @return A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12`
*
*/
public Output outboundIpAddresses() {
return this.outboundIpAddresses;
}
/**
* A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12,52.143.43.17` - not all of which are necessarily in use. Superset of `outbound_ip_addresses`.
*
*/
@Export(name="possibleOutboundIpAddresses", refs={String.class}, tree="[0]")
private Output possibleOutboundIpAddresses;
/**
* @return A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12,52.143.43.17` - not all of which are necessarily in use. Superset of `outbound_ip_addresses`.
*
*/
public Output possibleOutboundIpAddresses() {
return this.possibleOutboundIpAddresses;
}
/**
* The name of the resource group in which to create the Function App Slot. 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 Function App Slot. 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={FunctionAppSlotSiteConfig.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 Function App Slot.
*
*/
@Export(name="siteCredentials", refs={List.class,FunctionAppSlotSiteCredential.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 Function App Slot.
*
*/
public Output> siteCredentials() {
return this.siteCredentials;
}
/**
* The access key which will be used to access the backend storage account for the Function App.
*
*/
@Export(name="storageAccountAccessKey", refs={String.class}, tree="[0]")
private Output storageAccountAccessKey;
/**
* @return The access key which will be used to access the backend storage account for the Function App.
*
*/
public Output storageAccountAccessKey() {
return this.storageAccountAccessKey;
}
/**
* The backend storage account name which will be used by the Function App (such as the dashboard, logs). Changing this forces a new resource to be created.
*
*/
@Export(name="storageAccountName", refs={String.class}, tree="[0]")
private Output storageAccountName;
/**
* @return The backend storage account name which will be used by the Function App (such as the dashboard, logs). Changing this forces a new resource to be created.
*
*/
public Output storageAccountName() {
return this.storageAccountName;
}
/**
* A mapping of tags to assign to the resource.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return A mapping of tags to assign to the resource.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* The runtime version associated with the Function App. Defaults to `~1`.
*
*/
@Export(name="version", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> version;
/**
* @return The runtime version associated with the Function App. Defaults to `~1`.
*
*/
public Output> version() {
return Codegen.optional(this.version);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public FunctionAppSlot(java.lang.String name) {
this(name, FunctionAppSlotArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public FunctionAppSlot(java.lang.String name, FunctionAppSlotArgs 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 FunctionAppSlot(java.lang.String name, FunctionAppSlotArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:appservice/functionAppSlot:FunctionAppSlot", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private FunctionAppSlot(java.lang.String name, Output id, @Nullable FunctionAppSlotState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:appservice/functionAppSlot:FunctionAppSlot", name, state, makeResourceOptions(options, id), false);
}
private static FunctionAppSlotArgs makeArgs(FunctionAppSlotArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? FunctionAppSlotArgs.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())
.additionalSecretOutputs(List.of(
"storageAccountAccessKey"
))
.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 FunctionAppSlot get(java.lang.String name, Output id, @Nullable FunctionAppSlotState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new FunctionAppSlot(name, id, state, options);
}
}