ContainerAppArgs

data class ContainerAppArgs(val configuration: Output<ConfigurationArgs>? = null, val containerAppName: Output<String>? = null, val identity: Output<ManagedServiceIdentityArgs>? = null, val location: Output<String>? = null, val managedEnvironmentId: Output<String>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val template: Output<TemplateArgs>? = null) : ConvertibleToJava<ContainerAppArgs>

Container App. API Version: 2022-03-01.

Example Usage

Create or Update Container App

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var containerApp = new AzureNative.App.ContainerApp("containerApp", new()
{
Configuration = new AzureNative.App.Inputs.ConfigurationArgs
{
Dapr = new AzureNative.App.Inputs.DaprArgs
{
AppPort = 3000,
AppProtocol = "http",
Enabled = true,
},
Ingress = new AzureNative.App.Inputs.IngressArgs
{
CustomDomains = new[]
{
new AzureNative.App.Inputs.CustomDomainArgs
{
BindingType = "SniEnabled",
CertificateId = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com",
Name = "www.my-name.com",
},
new AzureNative.App.Inputs.CustomDomainArgs
{
BindingType = "SniEnabled",
CertificateId = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com",
Name = "www.my-other-name.com",
},
},
External = true,
TargetPort = 3000,
Traffic = new[]
{
new AzureNative.App.Inputs.TrafficWeightArgs
{
Label = "production",
RevisionName = "testcontainerApp0-ab1234",
Weight = 100,
},
},
},
},
ContainerAppName = "testcontainerApp0",
Location = "East US",
ManagedEnvironmentId = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
ResourceGroupName = "rg",
Template = new AzureNative.App.Inputs.TemplateArgs
{
Containers = new[]
{
new AzureNative.App.Inputs.ContainerArgs
{
Image = "repo/testcontainerApp0:v1",
Name = "testcontainerApp0",
Probes = new[]
{
new AzureNative.App.Inputs.ContainerAppProbeArgs
{
HttpGet = new AzureNative.App.Inputs.ContainerAppProbeHttpGetArgs
{
HttpHeaders = new[]
{
new AzureNative.App.Inputs.ContainerAppProbeHttpHeadersArgs
{
Name = "Custom-Header",
Value = "Awesome",
},
},
Path = "/health",
Port = 8080,
},
InitialDelaySeconds = 3,
PeriodSeconds = 3,
Type = "Liveness",
},
},
},
},
Scale = new AzureNative.App.Inputs.ScaleArgs
{
MaxReplicas = 5,
MinReplicas = 1,
Rules = new[]
{
new AzureNative.App.Inputs.ScaleRuleArgs
{
Custom = new AzureNative.App.Inputs.CustomScaleRuleArgs
{
Metadata =
{
{ "concurrentRequests", "50" },
},
Type = "http",
},
Name = "httpscalingrule",
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.app.ContainerApp;
import com.pulumi.azurenative.app.ContainerAppArgs;
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 containerApp = new ContainerApp("containerApp", ContainerAppArgs.builder()
.configuration(Map.ofEntries(
Map.entry("dapr", Map.ofEntries(
Map.entry("appPort", 3000),
Map.entry("appProtocol", "http"),
Map.entry("enabled", true)
)),
Map.entry("ingress", Map.ofEntries(
Map.entry("customDomains",
Map.ofEntries(
Map.entry("bindingType", "SniEnabled"),
Map.entry("certificateId", "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"),
Map.entry("name", "www.my-name.com")
),
Map.ofEntries(
Map.entry("bindingType", "SniEnabled"),
Map.entry("certificateId", "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"),
Map.entry("name", "www.my-other-name.com")
)),
Map.entry("external", true),
Map.entry("targetPort", 3000),
Map.entry("traffic", Map.ofEntries(
Map.entry("label", "production"),
Map.entry("revisionName", "testcontainerApp0-ab1234"),
Map.entry("weight", 100)
))
))
))
.containerAppName("testcontainerApp0")
.location("East US")
.managedEnvironmentId("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube")
.resourceGroupName("rg")
.template(Map.ofEntries(
Map.entry("containers", Map.ofEntries(
Map.entry("image", "repo/testcontainerApp0:v1"),
Map.entry("name", "testcontainerApp0"),
Map.entry("probes", Map.ofEntries(
Map.entry("httpGet", Map.ofEntries(
Map.entry("httpHeaders", Map.ofEntries(
Map.entry("name", "Custom-Header"),
Map.entry("value", "Awesome")
)),
Map.entry("path", "/health"),
Map.entry("port", 8080)
)),
Map.entry("initialDelaySeconds", 3),
Map.entry("periodSeconds", 3),
Map.entry("type", "Liveness")
))
)),
Map.entry("scale", Map.ofEntries(
Map.entry("maxReplicas", 5),
Map.entry("minReplicas", 1),
Map.entry("rules", Map.ofEntries(
Map.entry("custom", Map.ofEntries(
Map.entry("metadata", Map.of("concurrentRequests", "50")),
Map.entry("type", "http")
)),
Map.entry("name", "httpscalingrule")
))
))
))
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:app:ContainerApp testcontainerApp0 /subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0

Constructors

Link copied to clipboard
constructor(configuration: Output<ConfigurationArgs>? = null, containerAppName: Output<String>? = null, identity: Output<ManagedServiceIdentityArgs>? = null, location: Output<String>? = null, managedEnvironmentId: Output<String>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null, template: Output<TemplateArgs>? = null)

Properties

Link copied to clipboard
val configuration: Output<ConfigurationArgs>? = null

Non versioned Container App configuration properties.

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

Name of the Container App.

Link copied to clipboard

managed identities for the Container App to interact with other Azure services without maintaining any secrets or credentials in code.

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

The geo-location where the resource lives

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

Resource ID of the Container App's environment.

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

The name of the resource group. The name is case insensitive.

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

Resource tags.

Link copied to clipboard
val template: Output<TemplateArgs>? = null

Container App versioned application definition.

Functions

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