azurermAppServiceSlotVirtualNetworkSwiftConnection
Manages an App Service Slot's Virtual Network Association (this is for the Regional VNet Integration which is still in preview).
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermVirtualNetworkExample = new azurerm.virtualNetwork.VirtualNetwork(
this,
"example_1",
{
address_space: ["10.0.0.0/16"],
location: azurermResourceGroupExample.location,
name: "example-virtual-network",
resource_group_name: azurermResourceGroupExample.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermVirtualNetworkExample.overrideLogicalId("example");
const azurermAppServicePlanExample = new azurerm.appServicePlan.AppServicePlan(
this,
"example_2",
{
location: azurermResourceGroupExample.location,
name: "example-service-plan",
resource_group_name: azurermResourceGroupExample.name,
sku: [
{
size: "S1",
tier: "Standard",
},
],
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAppServicePlanExample.overrideLogicalId("example");
const azurermSubnetExample = new azurerm.subnet.Subnet(this, "example_3", {
address_prefixes: ["10.0.1.0/24"],
delegation: [
{
name: "example-delegation",
service_delegation: [
{
actions: ["Microsoft.Network/virtualNetworks/subnets/action"],
name: "Microsoft.Web/serverFarms",
},
],
},
],
name: "example-subnet",
resource_group_name: azurermResourceGroupExample.name,
virtual_network_name: azurermVirtualNetworkExample.name,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSubnetExample.overrideLogicalId("example");
const azurermAppServiceExample = new azurerm.appService.AppService(
this,
"example_4",
{
app_service_plan_id: azurermAppServicePlanExample.id,
location: azurermResourceGroupExample.location,
name: "example-app-service",
resource_group_name: azurermResourceGroupExample.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAppServiceExample.overrideLogicalId("example");
const azurermAppServiceSlotExampleStaging =
new azurerm.appServiceSlot.AppServiceSlot(this, "example-staging", {
app_service_name: azurermAppServiceExample.name,
app_service_plan_id: azurermAppServicePlanExample.id,
location: azurermResourceGroupExample.location,
name: "staging",
resource_group_name: azurermResourceGroupExample.name,
});
const azurermAppServiceSlotVirtualNetworkSwiftConnectionExample =
new azurerm.appServiceSlotVirtualNetworkSwiftConnection.AppServiceSlotVirtualNetworkSwiftConnection(
this,
"example_6",
{
app_service_id: azurermAppServiceExample.id,
slot_name: azurermAppServiceSlotExampleStaging.name,
subnet_id: azurermSubnetExample.id,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAppServiceSlotVirtualNetworkSwiftConnectionExample.overrideLogicalId(
"example"
);
Argument Reference
The following arguments are supported:
-
appServiceId
- (Required) The ID of the App Service or Function App to associate to the VNet. Changing this forces a new resource to be created. -
slotName
- (Required) The name of the App Service Slot or Function App Slot. Changing this forces a new resource to be created. -
subnetId
- (Required) The ID of the subnet the app service will be associated to (the subnet must have aserviceDelegation
configured formicrosoftWeb/serverFarms
).
Attributes Reference
The following attributes are exported:
id
- The ID of the App Service Slot Virtual Network Association
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the App Service Virtual Network Association.update
- (Defaults to 30 minutes) Used when updating the App Service Virtual Network Association.read
- (Defaults to 5 minutes) Used when retrieving the App Service Virtual Network Association.delete
- (Defaults to 30 minutes) Used when deleting the App Service Virtual Network Association.
Import
App Service Slot Virtual Network Associations can be imported using the resourceId
, e.g.