ContainerAppsSessionPoolArgs

data class ContainerAppsSessionPoolArgs(val containerType: Output<Either<String, ContainerType>>? = null, val customContainerTemplate: Output<CustomContainerTemplateArgs>? = null, val dynamicPoolConfiguration: Output<DynamicPoolConfigurationArgs>? = null, val environmentId: Output<String>? = null, val identity: Output<ManagedServiceIdentityArgs>? = null, val location: Output<String>? = null, val managedIdentitySettings: Output<List<ManagedIdentitySettingArgs>>? = null, val poolManagementType: Output<Either<String, PoolManagementType>>? = null, val resourceGroupName: Output<String>? = null, val scaleConfiguration: Output<ScaleConfigurationArgs>? = null, val secrets: Output<List<SessionPoolSecretArgs>>? = null, val sessionNetworkConfiguration: Output<SessionNetworkConfigurationArgs>? = null, val sessionPoolName: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<ContainerAppsSessionPoolArgs>

Container App session pool. Uses Azure REST API version 2024-10-02-preview. In version 2.x of the Azure Native provider, it used API version 2024-02-02-preview. Other available API versions: 2024-02-02-preview, 2024-08-02-preview, 2025-01-01, 2025-02-02-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native app [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create or Update Session Pool

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var containerAppsSessionPool = new AzureNative.App.ContainerAppsSessionPool("containerAppsSessionPool", new()
{
ContainerType = AzureNative.App.ContainerType.CustomContainer,
CustomContainerTemplate = new AzureNative.App.Inputs.CustomContainerTemplateArgs
{
Containers = new[]
{
new AzureNative.App.Inputs.SessionContainerArgs
{
Args = new[]
{
"-c",
"while true; do echo hello; sleep 10;done",
},
Command = new[]
{
"/bin/sh",
},
Image = "repo/testcontainer:v4",
Name = "testinitcontainer",
Resources = new AzureNative.App.Inputs.SessionContainerResourcesArgs
{
Cpu = 0.25,
Memory = "0.5Gi",
},
},
},
Ingress = new AzureNative.App.Inputs.SessionIngressArgs
{
TargetPort = 80,
},
RegistryCredentials = new AzureNative.App.Inputs.SessionRegistryCredentialsArgs
{
Identity = "/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP",
Server = "test.azurecr.io",
},
},
DynamicPoolConfiguration = new AzureNative.App.Inputs.DynamicPoolConfigurationArgs
{
CooldownPeriodInSeconds = 600,
ExecutionType = AzureNative.App.ExecutionType.Timed,
},
EnvironmentId = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
Identity = new AzureNative.App.Inputs.ManagedServiceIdentityArgs
{
Type = AzureNative.App.ManagedServiceIdentityType.SystemAssigned,
},
Location = "East US",
ManagedIdentitySettings = new[]
{
new AzureNative.App.Inputs.ManagedIdentitySettingArgs
{
Identity = "system",
Lifecycle = AzureNative.App.IdentitySettingsLifeCycle.Main,
},
},
PoolManagementType = AzureNative.App.PoolManagementType.Dynamic,
ResourceGroupName = "rg",
ScaleConfiguration = new AzureNative.App.Inputs.ScaleConfigurationArgs
{
MaxConcurrentSessions = 500,
ReadySessionInstances = 100,
},
SessionNetworkConfiguration = new AzureNative.App.Inputs.SessionNetworkConfigurationArgs
{
Status = AzureNative.App.SessionNetworkStatus.EgressEnabled,
},
SessionPoolName = "testsessionpool",
});
});
package main
import (
app "github.com/pulumi/pulumi-azure-native-sdk/app/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := app.NewContainerAppsSessionPool(ctx, "containerAppsSessionPool", &app.ContainerAppsSessionPoolArgs{
ContainerType: pulumi.String(app.ContainerTypeCustomContainer),
CustomContainerTemplate: &app.CustomContainerTemplateArgs{
Containers: app.SessionContainerArray{
&app.SessionContainerArgs{
Args: pulumi.StringArray{
pulumi.String("-c"),
pulumi.String("while true; do echo hello; sleep 10;done"),
},
Command: pulumi.StringArray{
pulumi.String("/bin/sh"),
},
Image: pulumi.String("repo/testcontainer:v4"),
Name: pulumi.String("testinitcontainer"),
Resources: &app.SessionContainerResourcesArgs{
Cpu: pulumi.Float64(0.25),
Memory: pulumi.String("0.5Gi"),
},
},
},
Ingress: &app.SessionIngressArgs{
TargetPort: pulumi.Int(80),
},
RegistryCredentials: &app.SessionRegistryCredentialsArgs{
Identity: pulumi.String("/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"),
Server: pulumi.String("test.azurecr.io"),
},
},
DynamicPoolConfiguration: &app.DynamicPoolConfigurationArgs{
CooldownPeriodInSeconds: pulumi.Int(600),
ExecutionType: pulumi.String(app.ExecutionTypeTimed),
},
EnvironmentId: pulumi.String("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"),
Identity: &app.ManagedServiceIdentityArgs{
Type: pulumi.String(app.ManagedServiceIdentityTypeSystemAssigned),
},
Location: pulumi.String("East US"),
ManagedIdentitySettings: app.ManagedIdentitySettingArray{
&app.ManagedIdentitySettingArgs{
Identity: pulumi.String("system"),
Lifecycle: pulumi.String(app.IdentitySettingsLifeCycleMain),
},
},
PoolManagementType: pulumi.String(app.PoolManagementTypeDynamic),
ResourceGroupName: pulumi.String("rg"),
ScaleConfiguration: &app.ScaleConfigurationArgs{
MaxConcurrentSessions: pulumi.Int(500),
ReadySessionInstances: pulumi.Int(100),
},
SessionNetworkConfiguration: &app.SessionNetworkConfigurationArgs{
Status: pulumi.String(app.SessionNetworkStatusEgressEnabled),
},
SessionPoolName: pulumi.String("testsessionpool"),
})
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.azurenative.app.ContainerAppsSessionPool;
import com.pulumi.azurenative.app.ContainerAppsSessionPoolArgs;
import com.pulumi.azurenative.app.inputs.CustomContainerTemplateArgs;
import com.pulumi.azurenative.app.inputs.SessionIngressArgs;
import com.pulumi.azurenative.app.inputs.SessionRegistryCredentialsArgs;
import com.pulumi.azurenative.app.inputs.DynamicPoolConfigurationArgs;
import com.pulumi.azurenative.app.inputs.ManagedServiceIdentityArgs;
import com.pulumi.azurenative.app.inputs.ManagedIdentitySettingArgs;
import com.pulumi.azurenative.app.inputs.ScaleConfigurationArgs;
import com.pulumi.azurenative.app.inputs.SessionNetworkConfigurationArgs;
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 containerAppsSessionPool = new ContainerAppsSessionPool("containerAppsSessionPool", ContainerAppsSessionPoolArgs.builder()
.containerType("CustomContainer")
.customContainerTemplate(CustomContainerTemplateArgs.builder()
.containers(SessionContainerArgs.builder()
.args(
"-c",
"while true; do echo hello; sleep 10;done")
.command("/bin/sh")
.image("repo/testcontainer:v4")
.name("testinitcontainer")
.resources(SessionContainerResourcesArgs.builder()
.cpu(0.25)
.memory("0.5Gi")
.build())
.build())
.ingress(SessionIngressArgs.builder()
.targetPort(80)
.build())
.registryCredentials(SessionRegistryCredentialsArgs.builder()
.identity("/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP")
.server("test.azurecr.io")
.build())
.build())
.dynamicPoolConfiguration(DynamicPoolConfigurationArgs.builder()
.cooldownPeriodInSeconds(600)
.executionType("Timed")
.build())
.environmentId("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube")
.identity(ManagedServiceIdentityArgs.builder()
.type("SystemAssigned")
.build())
.location("East US")
.managedIdentitySettings(ManagedIdentitySettingArgs.builder()
.identity("system")
.lifecycle("Main")
.build())
.poolManagementType("Dynamic")
.resourceGroupName("rg")
.scaleConfiguration(ScaleConfigurationArgs.builder()
.maxConcurrentSessions(500)
.readySessionInstances(100)
.build())
.sessionNetworkConfiguration(SessionNetworkConfigurationArgs.builder()
.status("EgressEnabled")
.build())
.sessionPoolName("testsessionpool")
.build());
}
}

Import

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

$ pulumi import azure-native:app:ContainerAppsSessionPool testsessionpool /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}

Constructors

Link copied to clipboard
constructor(containerType: Output<Either<String, ContainerType>>? = null, customContainerTemplate: Output<CustomContainerTemplateArgs>? = null, dynamicPoolConfiguration: Output<DynamicPoolConfigurationArgs>? = null, environmentId: Output<String>? = null, identity: Output<ManagedServiceIdentityArgs>? = null, location: Output<String>? = null, managedIdentitySettings: Output<List<ManagedIdentitySettingArgs>>? = null, poolManagementType: Output<Either<String, PoolManagementType>>? = null, resourceGroupName: Output<String>? = null, scaleConfiguration: Output<ScaleConfigurationArgs>? = null, secrets: Output<List<SessionPoolSecretArgs>>? = null, sessionNetworkConfiguration: Output<SessionNetworkConfigurationArgs>? = null, sessionPoolName: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val containerType: Output<Either<String, ContainerType>>? = null

The container type of the sessions.

Link copied to clipboard

The custom container configuration if the containerType is CustomContainer.

Link copied to clipboard

The pool configuration if the poolManagementType is dynamic.

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

Resource ID of the session pool's environment.

Link copied to clipboard

Managed identities needed by a session pool to interact with other Azure services to not maintain 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

Optional settings for a Managed Identity that is assigned to the Session pool.

Link copied to clipboard
val poolManagementType: Output<Either<String, PoolManagementType>>? = null

The pool management type of the session pool.

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

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

Link copied to clipboard

The scale configuration of the session pool.

Link copied to clipboard
val secrets: Output<List<SessionPoolSecretArgs>>? = null

The secrets of the session pool.

Link copied to clipboard

The network configuration of the sessions in the session pool.

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

Name of the session pool.

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

Resource tags.

Functions

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