Environment
Manages an App Service Environment.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "westeurope",
});
var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new Azure.Network.VirtualNetworkArgs
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
AddressSpaces =
{
"10.0.0.0/16",
},
});
var ase = new Azure.Network.Subnet("ase", new Azure.Network.SubnetArgs
{
ResourceGroupName = exampleResourceGroup.Name,
VirtualNetworkName = exampleVirtualNetwork.Name,
AddressPrefix = "10.0.1.0/24",
});
var gateway = new Azure.Network.Subnet("gateway", new Azure.Network.SubnetArgs
{
ResourceGroupName = exampleResourceGroup.Name,
VirtualNetworkName = exampleVirtualNetwork.Name,
AddressPrefix = "10.0.2.0/24",
});
var exampleEnvironment = new Azure.AppService.Environment("exampleEnvironment", new Azure.AppService.EnvironmentArgs
{
SubnetId = ase.Id,
PricingTier = "I2",
FrontEndScaleFactor = 10,
InternalLoadBalancingMode = "Web, Publishing",
UserWhitelistedIpRanges =
{
"11.22.33.44/32",
"55.66.77.0/24",
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/appservice"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/network"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("westeurope"),
})
if err != nil {
return err
}
exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
AddressSpaces: pulumi.StringArray{
pulumi.String("10.0.0.0/16"),
},
})
if err != nil {
return err
}
ase, err := network.NewSubnet(ctx, "ase", &network.SubnetArgs{
ResourceGroupName: exampleResourceGroup.Name,
VirtualNetworkName: exampleVirtualNetwork.Name,
AddressPrefix: pulumi.String("10.0.1.0/24"),
})
if err != nil {
return err
}
_, err = network.NewSubnet(ctx, "gateway", &network.SubnetArgs{
ResourceGroupName: exampleResourceGroup.Name,
VirtualNetworkName: exampleVirtualNetwork.Name,
AddressPrefix: pulumi.String("10.0.2.0/24"),
})
if err != nil {
return err
}
_, err = appservice.NewEnvironment(ctx, "exampleEnvironment", &appservice.EnvironmentArgs{
SubnetId: ase.ID(),
PricingTier: pulumi.String("I2"),
FrontEndScaleFactor: pulumi.Int(10),
InternalLoadBalancingMode: pulumi.String("Web, Publishing"),
UserWhitelistedIpRanges: pulumi.StringArray{
pulumi.String("11.22.33.44/32"),
pulumi.String("55.66.77.0/24"),
},
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westeurope")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
address_spaces=["10.0.0.0/16"])
ase = azure.network.Subnet("ase",
resource_group_name=example_resource_group.name,
virtual_network_name=example_virtual_network.name,
address_prefix="10.0.1.0/24")
gateway = azure.network.Subnet("gateway",
resource_group_name=example_resource_group.name,
virtual_network_name=example_virtual_network.name,
address_prefix="10.0.2.0/24")
example_environment = azure.appservice.Environment("exampleEnvironment",
subnet_id=ase.id,
pricing_tier="I2",
front_end_scale_factor=10,
internal_load_balancing_mode="Web, Publishing",
user_whitelisted_ip_ranges=[
"11.22.33.44/32",
"55.66.77.0/24",
])import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "westeurope"});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
addressSpaces: ["10.0.0.0/16"],
});
const ase = new azure.network.Subnet("ase", {
resourceGroupName: exampleResourceGroup.name,
virtualNetworkName: exampleVirtualNetwork.name,
addressPrefix: "10.0.1.0/24",
});
const gateway = new azure.network.Subnet("gateway", {
resourceGroupName: exampleResourceGroup.name,
virtualNetworkName: exampleVirtualNetwork.name,
addressPrefix: "10.0.2.0/24",
});
const exampleEnvironment = new azure.appservice.Environment("exampleEnvironment", {
subnetId: ase.id,
pricingTier: "I2",
frontEndScaleFactor: 10,
internalLoadBalancingMode: "Web, Publishing",
userWhitelistedIpRanges: [
"11.22.33.44/32",
"55.66.77.0/24",
],
});Create a Environment Resource
new Environment(name: string, args: EnvironmentArgs, opts?: CustomResourceOptions);def Environment(resource_name, opts=None, front_end_scale_factor=None, internal_load_balancing_mode=None, name=None, pricing_tier=None, resource_group_name=None, subnet_id=None, tags=None, user_whitelisted_ip_ranges=None, __props__=None);func NewEnvironment(ctx *Context, name string, args EnvironmentArgs, opts ...ResourceOption) (*Environment, error)public Environment(string name, EnvironmentArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args EnvironmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args EnvironmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnvironmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Environment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Environment resource accepts the following input properties:
- Subnet
Id string The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.
- Front
End intScale Factor Scale factor for front end instances. Possible values are between
5and15. Defaults to15.- Internal
Load stringBalancing Mode Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are
None,Web,Publishingand combined value"Web, Publishing". Defaults toNone.- Name string
The name of the App Service Environment. Changing this forces a new resource to be created.
- Pricing
Tier string Pricing tier for the front end instances. Possible values are
I1,I2andI3. Defaults toI1.- Resource
Group stringName The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by
subnet_id).- Dictionary<string, string>
A mapping of tags to assign to the resource. Changing this forces a new resource to be created.
- User
Whitelisted List<string>Ip Ranges User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.
- Subnet
Id string The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.
- Front
End intScale Factor Scale factor for front end instances. Possible values are between
5and15. Defaults to15.- Internal
Load stringBalancing Mode Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are
None,Web,Publishingand combined value"Web, Publishing". Defaults toNone.- Name string
The name of the App Service Environment. Changing this forces a new resource to be created.
- Pricing
Tier string Pricing tier for the front end instances. Possible values are
I1,I2andI3. Defaults toI1.- Resource
Group stringName The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by
subnet_id).- map[string]string
A mapping of tags to assign to the resource. Changing this forces a new resource to be created.
- User
Whitelisted []stringIp Ranges User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.
- subnet
Id string The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.
- front
End numberScale Factor Scale factor for front end instances. Possible values are between
5and15. Defaults to15.- internal
Load stringBalancing Mode Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are
None,Web,Publishingand combined value"Web, Publishing". Defaults toNone.- name string
The name of the App Service Environment. Changing this forces a new resource to be created.
- pricing
Tier string Pricing tier for the front end instances. Possible values are
I1,I2andI3. Defaults toI1.- resource
Group stringName The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by
subnet_id).- {[key: string]: string}
A mapping of tags to assign to the resource. Changing this forces a new resource to be created.
- user
Whitelisted string[]Ip Ranges User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.
- subnet_
id str The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.
- front_
end_ floatscale_ factor Scale factor for front end instances. Possible values are between
5and15. Defaults to15.- internal_
load_ strbalancing_ mode Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are
None,Web,Publishingand combined value"Web, Publishing". Defaults toNone.- name str
The name of the App Service Environment. Changing this forces a new resource to be created.
- pricing_
tier str Pricing tier for the front end instances. Possible values are
I1,I2andI3. Defaults toI1.- resource_
group_ strname The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by
subnet_id).- Dict[str, str]
A mapping of tags to assign to the resource. Changing this forces a new resource to be created.
- user_
whitelisted_ List[str]ip_ ranges User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.
Outputs
All input properties are implicitly available as output properties. Additionally, the Environment resource produces the following output properties:
Look up an Existing Environment Resource
Get an existing Environment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: EnvironmentState, opts?: CustomResourceOptions): Environmentstatic get(resource_name, id, opts=None, front_end_scale_factor=None, internal_load_balancing_mode=None, location=None, name=None, pricing_tier=None, resource_group_name=None, subnet_id=None, tags=None, user_whitelisted_ip_ranges=None, __props__=None);func GetEnvironment(ctx *Context, name string, id IDInput, state *EnvironmentState, opts ...ResourceOption) (*Environment, error)public static Environment Get(string name, Input<string> id, EnvironmentState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Front
End intScale Factor Scale factor for front end instances. Possible values are between
5and15. Defaults to15.- Internal
Load stringBalancing Mode Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are
None,Web,Publishingand combined value"Web, Publishing". Defaults toNone.- Location string
The location where the App Service Environment exists.
- Name string
The name of the App Service Environment. Changing this forces a new resource to be created.
- Pricing
Tier string Pricing tier for the front end instances. Possible values are
I1,I2andI3. Defaults toI1.- Resource
Group stringName The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by
subnet_id).- Subnet
Id string The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.
- Dictionary<string, string>
A mapping of tags to assign to the resource. Changing this forces a new resource to be created.
- User
Whitelisted List<string>Ip Ranges User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.
- Front
End intScale Factor Scale factor for front end instances. Possible values are between
5and15. Defaults to15.- Internal
Load stringBalancing Mode Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are
None,Web,Publishingand combined value"Web, Publishing". Defaults toNone.- Location string
The location where the App Service Environment exists.
- Name string
The name of the App Service Environment. Changing this forces a new resource to be created.
- Pricing
Tier string Pricing tier for the front end instances. Possible values are
I1,I2andI3. Defaults toI1.- Resource
Group stringName The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by
subnet_id).- Subnet
Id string The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.
- map[string]string
A mapping of tags to assign to the resource. Changing this forces a new resource to be created.
- User
Whitelisted []stringIp Ranges User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.
- front
End numberScale Factor Scale factor for front end instances. Possible values are between
5and15. Defaults to15.- internal
Load stringBalancing Mode Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are
None,Web,Publishingand combined value"Web, Publishing". Defaults toNone.- location string
The location where the App Service Environment exists.
- name string
The name of the App Service Environment. Changing this forces a new resource to be created.
- pricing
Tier string Pricing tier for the front end instances. Possible values are
I1,I2andI3. Defaults toI1.- resource
Group stringName The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by
subnet_id).- subnet
Id string The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.
- {[key: string]: string}
A mapping of tags to assign to the resource. Changing this forces a new resource to be created.
- user
Whitelisted string[]Ip Ranges User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.
- front_
end_ floatscale_ factor Scale factor for front end instances. Possible values are between
5and15. Defaults to15.- internal_
load_ strbalancing_ mode Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are
None,Web,Publishingand combined value"Web, Publishing". Defaults toNone.- location str
The location where the App Service Environment exists.
- name str
The name of the App Service Environment. Changing this forces a new resource to be created.
- pricing_
tier str Pricing tier for the front end instances. Possible values are
I1,I2andI3. Defaults toI1.- resource_
group_ strname The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by
subnet_id).- subnet_
id str The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.
- Dict[str, str]
A mapping of tags to assign to the resource. Changing this forces a new resource to be created.
- user_
whitelisted_ List[str]ip_ ranges User added IP ranges to whitelist on ASE db. Use the addresses you want to set as the explicit egress address ranges. Use CIDR format.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.