
com.pulumi.azure.appservice.kotlin.Environment.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.appservice.kotlin
import com.pulumi.azure.appservice.kotlin.outputs.EnvironmentClusterSetting
import com.pulumi.azure.appservice.kotlin.outputs.EnvironmentClusterSetting.Companion.toKotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
/**
* Builder for [Environment].
*/
@PulumiTagMarker
public class EnvironmentResourceBuilder internal constructor() {
public var name: String? = null
public var args: EnvironmentArgs = EnvironmentArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend EnvironmentArgsBuilder.() -> Unit) {
val builder = EnvironmentArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): Environment {
val builtJavaResource = com.pulumi.azure.appservice.Environment(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Environment(builtJavaResource)
}
}
/**
* Manages an App Service Environment.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "exampleRG1",
* location: "West Europe",
* });
* const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
* name: "example-vnet1",
* location: example.location,
* resourceGroupName: example.name,
* addressSpaces: ["10.0.0.0/16"],
* });
* const ase = new azure.network.Subnet("ase", {
* name: "asesubnet",
* resourceGroupName: example.name,
* virtualNetworkName: exampleVirtualNetwork.name,
* addressPrefixes: ["10.0.1.0/24"],
* });
* const gateway = new azure.network.Subnet("gateway", {
* name: "gatewaysubnet",
* resourceGroupName: example.name,
* virtualNetworkName: exampleVirtualNetwork.name,
* addressPrefixes: ["10.0.2.0/24"],
* });
* const exampleEnvironment = new azure.appservice.Environment("example", {
* name: "example-ase",
* resourceGroupName: example.name,
* subnetId: ase.id,
* pricingTier: "I2",
* frontEndScaleFactor: 10,
* internalLoadBalancingMode: "Web, Publishing",
* allowedUserIpCidrs: [
* "11.22.33.44/32",
* "55.66.77.0/24",
* ],
* clusterSettings: [{
* name: "DisableTls1.0",
* value: "1",
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="exampleRG1",
* location="West Europe")
* example_virtual_network = azure.network.VirtualNetwork("example",
* name="example-vnet1",
* location=example.location,
* resource_group_name=example.name,
* address_spaces=["10.0.0.0/16"])
* ase = azure.network.Subnet("ase",
* name="asesubnet",
* resource_group_name=example.name,
* virtual_network_name=example_virtual_network.name,
* address_prefixes=["10.0.1.0/24"])
* gateway = azure.network.Subnet("gateway",
* name="gatewaysubnet",
* resource_group_name=example.name,
* virtual_network_name=example_virtual_network.name,
* address_prefixes=["10.0.2.0/24"])
* example_environment = azure.appservice.Environment("example",
* name="example-ase",
* resource_group_name=example.name,
* subnet_id=ase.id,
* pricing_tier="I2",
* front_end_scale_factor=10,
* internal_load_balancing_mode="Web, Publishing",
* allowed_user_ip_cidrs=[
* "11.22.33.44/32",
* "55.66.77.0/24",
* ],
* cluster_settings=[azure.appservice.EnvironmentClusterSettingArgs(
* name="DisableTls1.0",
* value="1",
* )])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "exampleRG1",
* Location = "West Europe",
* });
* var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
* {
* Name = "example-vnet1",
* Location = example.Location,
* ResourceGroupName = example.Name,
* AddressSpaces = new[]
* {
* "10.0.0.0/16",
* },
* });
* var ase = new Azure.Network.Subnet("ase", new()
* {
* Name = "asesubnet",
* ResourceGroupName = example.Name,
* VirtualNetworkName = exampleVirtualNetwork.Name,
* AddressPrefixes = new[]
* {
* "10.0.1.0/24",
* },
* });
* var gateway = new Azure.Network.Subnet("gateway", new()
* {
* Name = "gatewaysubnet",
* ResourceGroupName = example.Name,
* VirtualNetworkName = exampleVirtualNetwork.Name,
* AddressPrefixes = new[]
* {
* "10.0.2.0/24",
* },
* });
* var exampleEnvironment = new Azure.AppService.Environment("example", new()
* {
* Name = "example-ase",
* ResourceGroupName = example.Name,
* SubnetId = ase.Id,
* PricingTier = "I2",
* FrontEndScaleFactor = 10,
* InternalLoadBalancingMode = "Web, Publishing",
* AllowedUserIpCidrs = new[]
* {
* "11.22.33.44/32",
* "55.66.77.0/24",
* },
* ClusterSettings = new[]
* {
* new Azure.AppService.Inputs.EnvironmentClusterSettingArgs
* {
* Name = "DisableTls1.0",
* Value = "1",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appservice"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("exampleRG1"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
* Name: pulumi.String("example-vnet1"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* AddressSpaces: pulumi.StringArray{
* pulumi.String("10.0.0.0/16"),
* },
* })
* if err != nil {
* return err
* }
* ase, err := network.NewSubnet(ctx, "ase", &network.SubnetArgs{
* Name: pulumi.String("asesubnet"),
* ResourceGroupName: example.Name,
* VirtualNetworkName: exampleVirtualNetwork.Name,
* AddressPrefixes: pulumi.StringArray{
* pulumi.String("10.0.1.0/24"),
* },
* })
* if err != nil {
* return err
* }
* _, err = network.NewSubnet(ctx, "gateway", &network.SubnetArgs{
* Name: pulumi.String("gatewaysubnet"),
* ResourceGroupName: example.Name,
* VirtualNetworkName: exampleVirtualNetwork.Name,
* AddressPrefixes: pulumi.StringArray{
* pulumi.String("10.0.2.0/24"),
* },
* })
* if err != nil {
* return err
* }
* _, err = appservice.NewEnvironment(ctx, "example", &appservice.EnvironmentArgs{
* Name: pulumi.String("example-ase"),
* ResourceGroupName: example.Name,
* SubnetId: ase.ID(),
* PricingTier: pulumi.String("I2"),
* FrontEndScaleFactor: pulumi.Int(10),
* InternalLoadBalancingMode: pulumi.String("Web, Publishing"),
* AllowedUserIpCidrs: pulumi.StringArray{
* pulumi.String("11.22.33.44/32"),
* pulumi.String("55.66.77.0/24"),
* },
* ClusterSettings: appservice.EnvironmentClusterSettingArray{
* &appservice.EnvironmentClusterSettingArgs{
* Name: pulumi.String("DisableTls1.0"),
* Value: pulumi.String("1"),
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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.network.VirtualNetwork;
* import com.pulumi.azure.network.VirtualNetworkArgs;
* import com.pulumi.azure.network.Subnet;
* import com.pulumi.azure.network.SubnetArgs;
* import com.pulumi.azure.appservice.Environment;
* import com.pulumi.azure.appservice.EnvironmentArgs;
* import com.pulumi.azure.appservice.inputs.EnvironmentClusterSettingArgs;
* 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("exampleRG1")
* .location("West Europe")
* .build());
* var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
* .name("example-vnet1")
* .location(example.location())
* .resourceGroupName(example.name())
* .addressSpaces("10.0.0.0/16")
* .build());
* var ase = new Subnet("ase", SubnetArgs.builder()
* .name("asesubnet")
* .resourceGroupName(example.name())
* .virtualNetworkName(exampleVirtualNetwork.name())
* .addressPrefixes("10.0.1.0/24")
* .build());
* var gateway = new Subnet("gateway", SubnetArgs.builder()
* .name("gatewaysubnet")
* .resourceGroupName(example.name())
* .virtualNetworkName(exampleVirtualNetwork.name())
* .addressPrefixes("10.0.2.0/24")
* .build());
* var exampleEnvironment = new Environment("exampleEnvironment", EnvironmentArgs.builder()
* .name("example-ase")
* .resourceGroupName(example.name())
* .subnetId(ase.id())
* .pricingTier("I2")
* .frontEndScaleFactor(10)
* .internalLoadBalancingMode("Web, Publishing")
* .allowedUserIpCidrs(
* "11.22.33.44/32",
* "55.66.77.0/24")
* .clusterSettings(EnvironmentClusterSettingArgs.builder()
* .name("DisableTls1.0")
* .value("1")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: exampleRG1
* location: West Europe
* exampleVirtualNetwork:
* type: azure:network:VirtualNetwork
* name: example
* properties:
* name: example-vnet1
* location: ${example.location}
* resourceGroupName: ${example.name}
* addressSpaces:
* - 10.0.0.0/16
* ase:
* type: azure:network:Subnet
* properties:
* name: asesubnet
* resourceGroupName: ${example.name}
* virtualNetworkName: ${exampleVirtualNetwork.name}
* addressPrefixes:
* - 10.0.1.0/24
* gateway:
* type: azure:network:Subnet
* properties:
* name: gatewaysubnet
* resourceGroupName: ${example.name}
* virtualNetworkName: ${exampleVirtualNetwork.name}
* addressPrefixes:
* - 10.0.2.0/24
* exampleEnvironment:
* type: azure:appservice:Environment
* name: example
* properties:
* name: example-ase
* resourceGroupName: ${example.name}
* subnetId: ${ase.id}
* pricingTier: I2
* frontEndScaleFactor: 10
* internalLoadBalancingMode: Web, Publishing
* allowedUserIpCidrs:
* - 11.22.33.44/32
* - 55.66.77.0/24
* clusterSettings:
* - name: DisableTls1.0
* value: '1'
* ```
*
* ## Import
* The App Service Environment can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:appservice/environment:Environment myAppServiceEnv /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Web/hostingEnvironments/myAppServiceEnv
* ```
*/
public class Environment internal constructor(
override val javaResource: com.pulumi.azure.appservice.Environment,
) : KotlinCustomResource(javaResource, EnvironmentMapper) {
/**
* Allowed user added IP ranges on the ASE database. Use the addresses you want to set as the explicit egress address ranges.
* > **NOTE:** `allowed_user_ip_cidrs` The addresses that will be used for all outbound traffic from your App Service Environment to the internet to avoid asymmetric routing challenge. If you're routing the traffic on premises, these addresses are your NATs or gateway IPs. If you want to route the App Service Environment outbound traffic through an NVA, the egress address is the public IP of the NVA. Please visit [Create your ASE with the egress addresses](https://docs.microsoft.com/azure/app-service/environment/forced-tunnel-support#add-your-own-ips-to-the-ase-azure-sql-firewall)
*/
public val allowedUserIpCidrs: Output>?
get() = javaResource.allowedUserIpCidrs().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* Zero or more `cluster_setting` blocks as defined below.
*/
public val clusterSettings: Output>
get() = javaResource.clusterSettings().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
})
/**
* Scale factor for front end instances. Possible values are between `5` and `15`. Defaults to `15`.
*/
public val frontEndScaleFactor: Output?
get() = javaResource.frontEndScaleFactor().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* IP address of internal load balancer of the App Service Environment.
*/
public val internalIpAddress: Output
get() = javaResource.internalIpAddress().applyValue({ args0 -> args0 })
/**
* Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are `None`, `Web`, `Publishing` and combined value `"Web, Publishing"`. Defaults to `None`. Changing this forces a new resource to be created.
*/
public val internalLoadBalancingMode: Output?
get() = javaResource.internalLoadBalancingMode().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The location where the App Service Environment exists.
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* The name of the App Service Environment. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* List of outbound IP addresses of the App Service Environment.
*/
public val outboundIpAddresses: Output>
get() = javaResource.outboundIpAddresses().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* Pricing tier for the front end instances. Possible values are `I1`, `I2` and `I3`. Defaults to `I1`.
*/
public val pricingTier: Output?
get() = javaResource.pricingTier().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the Resource Group where the App Service Environment exists. Defaults to the Resource Group of the Subnet (specified by `subnet_id`).
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* IP address of service endpoint of the App Service Environment.
*/
public val serviceIpAddress: Output
get() = javaResource.serviceIpAddress().applyValue({ args0 -> args0 })
/**
* The ID of the Subnet which the App Service Environment should be connected to. Changing this forces a new resource to be created.
* > **NOTE** a /24 or larger CIDR is required. Once associated with an ASE this size cannot be changed.
*/
public val subnetId: Output
get() = javaResource.subnetId().applyValue({ args0 -> args0 })
/**
* A mapping of tags to assign to the resource. Changing this forces a new resource to be created.
*/
public val tags: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy