Environment

class Environment : KotlinCustomResource

Manages a Container App Environment.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("example", {
name: "acctest-01",
location: example.location,
resourceGroupName: example.name,
sku: "PerGB2018",
retentionInDays: 30,
});
const exampleEnvironment = new azure.containerapp.Environment("example", {
name: "my-environment",
location: example.location,
resourceGroupName: example.name,
logsDestination: "log-analytics",
logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id,
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("example",
name="acctest-01",
location=example.location,
resource_group_name=example.name,
sku="PerGB2018",
retention_in_days=30)
example_environment = azure.containerapp.Environment("example",
name="my-environment",
location=example.location,
resource_group_name=example.name,
logs_destination="log-analytics",
log_analytics_workspace_id=example_analytics_workspace.id)
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 = "example-resources",
Location = "West Europe",
});
var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("example", new()
{
Name = "acctest-01",
Location = example.Location,
ResourceGroupName = example.Name,
Sku = "PerGB2018",
RetentionInDays = 30,
});
var exampleEnvironment = new Azure.ContainerApp.Environment("example", new()
{
Name = "my-environment",
Location = example.Location,
ResourceGroupName = example.Name,
LogsDestination = "log-analytics",
LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/containerapp"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/operationalinsights"
"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("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "example", &operationalinsights.AnalyticsWorkspaceArgs{
Name: pulumi.String("acctest-01"),
Location: example.Location,
ResourceGroupName: example.Name,
Sku: pulumi.String("PerGB2018"),
RetentionInDays: pulumi.Int(30),
})
if err != nil {
return err
}
_, err = containerapp.NewEnvironment(ctx, "example", &containerapp.EnvironmentArgs{
Name: pulumi.String("my-environment"),
Location: example.Location,
ResourceGroupName: example.Name,
LogsDestination: pulumi.String("log-analytics"),
LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(),
})
if err != nil {
return err
}
return nil
})
}
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.operationalinsights.AnalyticsWorkspace;
import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
import com.pulumi.azure.containerapp.Environment;
import com.pulumi.azure.containerapp.EnvironmentArgs;
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("example-resources")
.location("West Europe")
.build());
var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
.name("acctest-01")
.location(example.location())
.resourceGroupName(example.name())
.sku("PerGB2018")
.retentionInDays(30)
.build());
var exampleEnvironment = new Environment("exampleEnvironment", EnvironmentArgs.builder()
.name("my-environment")
.location(example.location())
.resourceGroupName(example.name())
.logsDestination("log-analytics")
.logAnalyticsWorkspaceId(exampleAnalyticsWorkspace.id())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleAnalyticsWorkspace:
type: azure:operationalinsights:AnalyticsWorkspace
name: example
properties:
name: acctest-01
location: ${example.location}
resourceGroupName: ${example.name}
sku: PerGB2018
retentionInDays: 30
exampleEnvironment:
type: azure:containerapp:Environment
name: example
properties:
name: my-environment
location: ${example.location}
resourceGroupName: ${example.name}
logsDestination: log-analytics
logAnalyticsWorkspaceId: ${exampleAnalyticsWorkspace.id}

Import

A Container App Environment can be imported using the resource id, e.g.

$ pulumi import azure:containerapp/environment:Environment example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.App/managedEnvironments/myEnvironment"

Properties

Link copied to clipboard

The ID of the Custom Domain Verification for this Container App Environment.

Link copied to clipboard

Application Insights connection string used by Dapr to export Service to Service communication telemetry. Changing this forces a new resource to be created.

Link copied to clipboard
val defaultDomain: Output<String>

The default, publicly resolvable, name of this Container App Environment.

Link copied to clipboard

The network addressing in which the Container Apps in this Container App Environment will reside in CIDR notation.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Name of the platform-managed resource group created for the Managed Environment to host infrastructure resources. Changing this forces a new resource to be created.

Link copied to clipboard

The existing Subnet to use for the Container Apps Control Plane. Changing this forces a new resource to be created.

Link copied to clipboard

Should the Container Environment operate in Internal Load Balancing Mode? Defaults to false. Changing this forces a new resource to be created.

Link copied to clipboard
val location: Output<String>

Specifies the supported Azure location where the Container App Environment is to exist. Changing this forces a new resource to be created.

Link copied to clipboard

The ID for the Log Analytics Workspace to link this Container Apps Managed Environment to.

Link copied to clipboard
val logsDestination: Output<String>

Where the application logs will be saved for this Container Apps Managed Environment. Possible values include log-analytics and azure-monitor. Omitting this value will result in logs being streamed only.

Link copied to clipboard

Should mutual transport layer security (mTLS) be enabled? Defaults to false.

Link copied to clipboard
val name: Output<String>

The name of the Container Apps Managed Environment. Changing this forces a new resource to be created.

Link copied to clipboard

The IP range, in CIDR notation, that is reserved for environment infrastructure IP addresses.

Link copied to clipboard

The IP address from the IP range defined by platform_reserved_cidr that is reserved for the internal DNS server.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The name of the resource group in which the Container App Environment is to be created. Changing this forces a new resource to be created.

Link copied to clipboard
val staticIpAddress: Output<String>

The Static IP address of the Environment.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

One or more workload_profile blocks as defined below.

Link copied to clipboard

Should the Container App Environment be created with Zone Redundancy enabled? Defaults to false. Changing this forces a new resource to be created.