EnvironmentArgs

data class EnvironmentArgs(val daprApplicationInsightsConnectionString: Output<String>? = null, val infrastructureResourceGroupName: Output<String>? = null, val infrastructureSubnetId: Output<String>? = null, val internalLoadBalancerEnabled: Output<Boolean>? = null, val location: Output<String>? = null, val logAnalyticsWorkspaceId: Output<String>? = null, val logsDestination: Output<String>? = null, val mutualTlsEnabled: Output<Boolean>? = null, val name: Output<String>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val workloadProfiles: Output<List<EnvironmentWorkloadProfileArgs>>? = null, val zoneRedundancyEnabled: Output<Boolean>? = null) : ConvertibleToJava<EnvironmentArgs>

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: "example-workspace",
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="example-workspace",
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 = "example-workspace",
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("example-workspace"),
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("example-workspace")
.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: example-workspace
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}

API Providers

This resource uses the following Azure API Providers:

  • Microsoft.App: 2025-01-01

  • Microsoft.OperationalInsights: 2020-08-01

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"

Constructors

Link copied to clipboard
constructor(daprApplicationInsightsConnectionString: Output<String>? = null, infrastructureResourceGroupName: Output<String>? = null, infrastructureSubnetId: Output<String>? = null, internalLoadBalancerEnabled: Output<Boolean>? = null, location: Output<String>? = null, logAnalyticsWorkspaceId: Output<String>? = null, logsDestination: Output<String>? = null, mutualTlsEnabled: Output<Boolean>? = null, name: Output<String>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null, workloadProfiles: Output<List<EnvironmentWorkloadProfileArgs>>? = null, zoneRedundancyEnabled: Output<Boolean>? = null)

Properties

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

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
val infrastructureSubnetId: Output<String>? = null

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>? = null

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
val logAnalyticsWorkspaceId: Output<String>? = null

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

Link copied to clipboard
val logsDestination: Output<String>? = null

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
val mutualTlsEnabled: Output<Boolean>? = null

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

Link copied to clipboard
val name: Output<String>? = null

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

Link copied to clipboard
val resourceGroupName: Output<String>? = null

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 tags: Output<Map<String, String>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard

One or more workload_profile blocks as defined below.

Link copied to clipboard
val zoneRedundancyEnabled: Output<Boolean>? = null

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

Functions

Link copied to clipboard
open override fun toJava(): EnvironmentArgs