AWS Classic v5.41.0, May 15 23
AWS Classic v5.41.0, May 15 23
aws.ecs.TaskDefinition
Explore with Pulumi AI
Manages a revision of an ECS task definition to be used in aws.ecs.Service
.
Example Usage
Basic Example
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var service = new Aws.Ecs.TaskDefinition("service", new()
{
Family = "service",
ContainerDefinitions = JsonSerializer.Serialize(new[]
{
new Dictionary<string, object?>
{
["name"] = "first",
["image"] = "service-first",
["cpu"] = 10,
["memory"] = 512,
["essential"] = true,
["portMappings"] = new[]
{
new Dictionary<string, object?>
{
["containerPort"] = 80,
["hostPort"] = 80,
},
},
},
new Dictionary<string, object?>
{
["name"] = "second",
["image"] = "service-second",
["cpu"] = 10,
["memory"] = 256,
["essential"] = true,
["portMappings"] = new[]
{
new Dictionary<string, object?>
{
["containerPort"] = 443,
["hostPort"] = 443,
},
},
},
}),
Volumes = new[]
{
new Aws.Ecs.Inputs.TaskDefinitionVolumeArgs
{
Name = "service-storage",
HostPath = "/ecs/service-storage",
},
},
PlacementConstraints = new[]
{
new Aws.Ecs.Inputs.TaskDefinitionPlacementConstraintArgs
{
Type = "memberOf",
Expression = "attribute:ecs.availability-zone in [us-west-2a, us-west-2b]",
},
},
});
});
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal([]interface{}{
map[string]interface{}{
"name": "first",
"image": "service-first",
"cpu": 10,
"memory": 512,
"essential": true,
"portMappings": []map[string]interface{}{
map[string]interface{}{
"containerPort": 80,
"hostPort": 80,
},
},
},
map[string]interface{}{
"name": "second",
"image": "service-second",
"cpu": 10,
"memory": 256,
"essential": true,
"portMappings": []map[string]interface{}{
map[string]interface{}{
"containerPort": 443,
"hostPort": 443,
},
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = ecs.NewTaskDefinition(ctx, "service", &ecs.TaskDefinitionArgs{
Family: pulumi.String("service"),
ContainerDefinitions: pulumi.String(json0),
Volumes: ecs.TaskDefinitionVolumeArray{
&ecs.TaskDefinitionVolumeArgs{
Name: pulumi.String("service-storage"),
HostPath: pulumi.String("/ecs/service-storage"),
},
},
PlacementConstraints: ecs.TaskDefinitionPlacementConstraintArray{
&ecs.TaskDefinitionPlacementConstraintArgs{
Type: pulumi.String("memberOf"),
Expression: pulumi.String("attribute:ecs.availability-zone in [us-west-2a, us-west-2b]"),
},
},
})
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.aws.ecs.TaskDefinition;
import com.pulumi.aws.ecs.TaskDefinitionArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionVolumeArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionPlacementConstraintArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 service = new TaskDefinition("service", TaskDefinitionArgs.builder()
.family("service")
.containerDefinitions(serializeJson(
jsonArray(
jsonObject(
jsonProperty("name", "first"),
jsonProperty("image", "service-first"),
jsonProperty("cpu", 10),
jsonProperty("memory", 512),
jsonProperty("essential", true),
jsonProperty("portMappings", jsonArray(jsonObject(
jsonProperty("containerPort", 80),
jsonProperty("hostPort", 80)
)))
),
jsonObject(
jsonProperty("name", "second"),
jsonProperty("image", "service-second"),
jsonProperty("cpu", 10),
jsonProperty("memory", 256),
jsonProperty("essential", true),
jsonProperty("portMappings", jsonArray(jsonObject(
jsonProperty("containerPort", 443),
jsonProperty("hostPort", 443)
)))
)
)))
.volumes(TaskDefinitionVolumeArgs.builder()
.name("service-storage")
.hostPath("/ecs/service-storage")
.build())
.placementConstraints(TaskDefinitionPlacementConstraintArgs.builder()
.type("memberOf")
.expression("attribute:ecs.availability-zone in [us-west-2a, us-west-2b]")
.build())
.build());
}
}
import pulumi
import json
import pulumi_aws as aws
service = aws.ecs.TaskDefinition("service",
family="service",
container_definitions=json.dumps([
{
"name": "first",
"image": "service-first",
"cpu": 10,
"memory": 512,
"essential": True,
"portMappings": [{
"containerPort": 80,
"hostPort": 80,
}],
},
{
"name": "second",
"image": "service-second",
"cpu": 10,
"memory": 256,
"essential": True,
"portMappings": [{
"containerPort": 443,
"hostPort": 443,
}],
},
]),
volumes=[aws.ecs.TaskDefinitionVolumeArgs(
name="service-storage",
host_path="/ecs/service-storage",
)],
placement_constraints=[aws.ecs.TaskDefinitionPlacementConstraintArgs(
type="memberOf",
expression="attribute:ecs.availability-zone in [us-west-2a, us-west-2b]",
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const service = new aws.ecs.TaskDefinition("service", {
family: "service",
containerDefinitions: JSON.stringify([
{
name: "first",
image: "service-first",
cpu: 10,
memory: 512,
essential: true,
portMappings: [{
containerPort: 80,
hostPort: 80,
}],
},
{
name: "second",
image: "service-second",
cpu: 10,
memory: 256,
essential: true,
portMappings: [{
containerPort: 443,
hostPort: 443,
}],
},
]),
volumes: [{
name: "service-storage",
hostPath: "/ecs/service-storage",
}],
placementConstraints: [{
type: "memberOf",
expression: "attribute:ecs.availability-zone in [us-west-2a, us-west-2b]",
}],
});
resources:
service:
type: aws:ecs:TaskDefinition
properties:
family: service
containerDefinitions:
fn::toJSON:
- name: first
image: service-first
cpu: 10
memory: 512
essential: true
portMappings:
- containerPort: 80
hostPort: 80
- name: second
image: service-second
cpu: 10
memory: 256
essential: true
portMappings:
- containerPort: 443
hostPort: 443
volumes:
- name: service-storage
hostPath: /ecs/service-storage
placementConstraints:
- type: memberOf
expression: attribute:ecs.availability-zone in [us-west-2a, us-west-2b]
With AppMesh Proxy
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var service = new Aws.Ecs.TaskDefinition("service", new()
{
Family = "service",
ContainerDefinitions = File.ReadAllText("task-definitions/service.json"),
ProxyConfiguration = new Aws.Ecs.Inputs.TaskDefinitionProxyConfigurationArgs
{
Type = "APPMESH",
ContainerName = "applicationContainerName",
Properties =
{
{ "AppPorts", "8080" },
{ "EgressIgnoredIPs", "169.254.170.2,169.254.169.254" },
{ "IgnoredUID", "1337" },
{ "ProxyEgressPort", "15001" },
{ "ProxyIngressPort", "15000" },
},
},
});
});
package main
import (
"os"
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ecs.NewTaskDefinition(ctx, "service", &ecs.TaskDefinitionArgs{
Family: pulumi.String("service"),
ContainerDefinitions: readFileOrPanic("task-definitions/service.json"),
ProxyConfiguration: &ecs.TaskDefinitionProxyConfigurationArgs{
Type: pulumi.String("APPMESH"),
ContainerName: pulumi.String("applicationContainerName"),
Properties: pulumi.StringMap{
"AppPorts": pulumi.String("8080"),
"EgressIgnoredIPs": pulumi.String("169.254.170.2,169.254.169.254"),
"IgnoredUID": pulumi.String("1337"),
"ProxyEgressPort": pulumi.String("15001"),
"ProxyIngressPort": pulumi.String("15000"),
},
},
})
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.aws.ecs.TaskDefinition;
import com.pulumi.aws.ecs.TaskDefinitionArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionProxyConfigurationArgs;
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 service = new TaskDefinition("service", TaskDefinitionArgs.builder()
.family("service")
.containerDefinitions(Files.readString(Paths.get("task-definitions/service.json")))
.proxyConfiguration(TaskDefinitionProxyConfigurationArgs.builder()
.type("APPMESH")
.containerName("applicationContainerName")
.properties(Map.ofEntries(
Map.entry("AppPorts", "8080"),
Map.entry("EgressIgnoredIPs", "169.254.170.2,169.254.169.254"),
Map.entry("IgnoredUID", "1337"),
Map.entry("ProxyEgressPort", 15001),
Map.entry("ProxyIngressPort", 15000)
))
.build())
.build());
}
}
import pulumi
import pulumi_aws as aws
service = aws.ecs.TaskDefinition("service",
family="service",
container_definitions=(lambda path: open(path).read())("task-definitions/service.json"),
proxy_configuration=aws.ecs.TaskDefinitionProxyConfigurationArgs(
type="APPMESH",
container_name="applicationContainerName",
properties={
"AppPorts": "8080",
"EgressIgnoredIPs": "169.254.170.2,169.254.169.254",
"IgnoredUID": "1337",
"ProxyEgressPort": "15001",
"ProxyIngressPort": "15000",
},
))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as fs from "fs";
const service = new aws.ecs.TaskDefinition("service", {
family: "service",
containerDefinitions: fs.readFileSync("task-definitions/service.json"),
proxyConfiguration: {
type: "APPMESH",
containerName: "applicationContainerName",
properties: {
AppPorts: "8080",
EgressIgnoredIPs: "169.254.170.2,169.254.169.254",
IgnoredUID: "1337",
ProxyEgressPort: "15001",
ProxyIngressPort: "15000",
},
},
});
resources:
service:
type: aws:ecs:TaskDefinition
properties:
family: service
containerDefinitions:
fn::readFile: task-definitions/service.json
proxyConfiguration:
type: APPMESH
containerName: applicationContainerName
properties:
AppPorts: '8080'
EgressIgnoredIPs: 169.254.170.2,169.254.169.254
IgnoredUID: '1337'
ProxyEgressPort: 15001
ProxyIngressPort: 15000
Example Using docker_volume_configuration
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var service = new Aws.Ecs.TaskDefinition("service", new()
{
Family = "service",
ContainerDefinitions = File.ReadAllText("task-definitions/service.json"),
Volumes = new[]
{
new Aws.Ecs.Inputs.TaskDefinitionVolumeArgs
{
Name = "service-storage",
DockerVolumeConfiguration = new Aws.Ecs.Inputs.TaskDefinitionVolumeDockerVolumeConfigurationArgs
{
Scope = "shared",
Autoprovision = true,
Driver = "local",
DriverOpts =
{
{ "type", "nfs" },
{ "device", $"{aws_efs_file_system.Fs.Dns_name}:/" },
{ "o", $"addr={aws_efs_file_system.Fs.Dns_name},rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport" },
},
},
},
},
});
});
package main
import (
"fmt"
"os"
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ecs.NewTaskDefinition(ctx, "service", &ecs.TaskDefinitionArgs{
Family: pulumi.String("service"),
ContainerDefinitions: readFileOrPanic("task-definitions/service.json"),
Volumes: ecs.TaskDefinitionVolumeArray{
&ecs.TaskDefinitionVolumeArgs{
Name: pulumi.String("service-storage"),
DockerVolumeConfiguration: &ecs.TaskDefinitionVolumeDockerVolumeConfigurationArgs{
Scope: pulumi.String("shared"),
Autoprovision: pulumi.Bool(true),
Driver: pulumi.String("local"),
DriverOpts: pulumi.StringMap{
"type": pulumi.String("nfs"),
"device": pulumi.String(fmt.Sprintf("%v:/", aws_efs_file_system.Fs.Dns_name)),
"o": pulumi.String(fmt.Sprintf("addr=%v,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport", aws_efs_file_system.Fs.Dns_name)),
},
},
},
},
})
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.aws.ecs.TaskDefinition;
import com.pulumi.aws.ecs.TaskDefinitionArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionVolumeArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionVolumeDockerVolumeConfigurationArgs;
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 service = new TaskDefinition("service", TaskDefinitionArgs.builder()
.family("service")
.containerDefinitions(Files.readString(Paths.get("task-definitions/service.json")))
.volumes(TaskDefinitionVolumeArgs.builder()
.name("service-storage")
.dockerVolumeConfiguration(TaskDefinitionVolumeDockerVolumeConfigurationArgs.builder()
.scope("shared")
.autoprovision(true)
.driver("local")
.driverOpts(Map.ofEntries(
Map.entry("type", "nfs"),
Map.entry("device", String.format("%s:/", aws_efs_file_system.fs().dns_name())),
Map.entry("o", String.format("addr=%s,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport", aws_efs_file_system.fs().dns_name()))
))
.build())
.build())
.build());
}
}
import pulumi
import pulumi_aws as aws
service = aws.ecs.TaskDefinition("service",
family="service",
container_definitions=(lambda path: open(path).read())("task-definitions/service.json"),
volumes=[aws.ecs.TaskDefinitionVolumeArgs(
name="service-storage",
docker_volume_configuration=aws.ecs.TaskDefinitionVolumeDockerVolumeConfigurationArgs(
scope="shared",
autoprovision=True,
driver="local",
driver_opts={
"type": "nfs",
"device": f"{aws_efs_file_system['fs']['dns_name']}:/",
"o": f"addr={aws_efs_file_system['fs']['dns_name']},rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport",
},
),
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as fs from "fs";
const service = new aws.ecs.TaskDefinition("service", {
family: "service",
containerDefinitions: fs.readFileSync("task-definitions/service.json"),
volumes: [{
name: "service-storage",
dockerVolumeConfiguration: {
scope: "shared",
autoprovision: true,
driver: "local",
driverOpts: {
type: "nfs",
device: `${aws_efs_file_system.fs.dns_name}:/`,
o: `addr=${aws_efs_file_system.fs.dns_name},rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport`,
},
},
}],
});
resources:
service:
type: aws:ecs:TaskDefinition
properties:
family: service
containerDefinitions:
fn::readFile: task-definitions/service.json
volumes:
- name: service-storage
dockerVolumeConfiguration:
scope: shared
autoprovision: true
driver: local
driverOpts:
type: nfs
device: ${aws_efs_file_system.fs.dns_name}:/
o: addr=${aws_efs_file_system.fs.dns_name},rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport
Example Using efs_volume_configuration
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var service = new Aws.Ecs.TaskDefinition("service", new()
{
Family = "service",
ContainerDefinitions = File.ReadAllText("task-definitions/service.json"),
Volumes = new[]
{
new Aws.Ecs.Inputs.TaskDefinitionVolumeArgs
{
Name = "service-storage",
EfsVolumeConfiguration = new Aws.Ecs.Inputs.TaskDefinitionVolumeEfsVolumeConfigurationArgs
{
FileSystemId = aws_efs_file_system.Fs.Id,
RootDirectory = "/opt/data",
TransitEncryption = "ENABLED",
TransitEncryptionPort = 2999,
AuthorizationConfig = new Aws.Ecs.Inputs.TaskDefinitionVolumeEfsVolumeConfigurationAuthorizationConfigArgs
{
AccessPointId = aws_efs_access_point.Test.Id,
Iam = "ENABLED",
},
},
},
},
});
});
package main
import (
"os"
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ecs.NewTaskDefinition(ctx, "service", &ecs.TaskDefinitionArgs{
Family: pulumi.String("service"),
ContainerDefinitions: readFileOrPanic("task-definitions/service.json"),
Volumes: ecs.TaskDefinitionVolumeArray{
&ecs.TaskDefinitionVolumeArgs{
Name: pulumi.String("service-storage"),
EfsVolumeConfiguration: &ecs.TaskDefinitionVolumeEfsVolumeConfigurationArgs{
FileSystemId: pulumi.Any(aws_efs_file_system.Fs.Id),
RootDirectory: pulumi.String("/opt/data"),
TransitEncryption: pulumi.String("ENABLED"),
TransitEncryptionPort: pulumi.Int(2999),
AuthorizationConfig: &ecs.TaskDefinitionVolumeEfsVolumeConfigurationAuthorizationConfigArgs{
AccessPointId: pulumi.Any(aws_efs_access_point.Test.Id),
Iam: pulumi.String("ENABLED"),
},
},
},
},
})
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.aws.ecs.TaskDefinition;
import com.pulumi.aws.ecs.TaskDefinitionArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionVolumeArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionVolumeEfsVolumeConfigurationArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionVolumeEfsVolumeConfigurationAuthorizationConfigArgs;
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 service = new TaskDefinition("service", TaskDefinitionArgs.builder()
.family("service")
.containerDefinitions(Files.readString(Paths.get("task-definitions/service.json")))
.volumes(TaskDefinitionVolumeArgs.builder()
.name("service-storage")
.efsVolumeConfiguration(TaskDefinitionVolumeEfsVolumeConfigurationArgs.builder()
.fileSystemId(aws_efs_file_system.fs().id())
.rootDirectory("/opt/data")
.transitEncryption("ENABLED")
.transitEncryptionPort(2999)
.authorizationConfig(TaskDefinitionVolumeEfsVolumeConfigurationAuthorizationConfigArgs.builder()
.accessPointId(aws_efs_access_point.test().id())
.iam("ENABLED")
.build())
.build())
.build())
.build());
}
}
import pulumi
import pulumi_aws as aws
service = aws.ecs.TaskDefinition("service",
family="service",
container_definitions=(lambda path: open(path).read())("task-definitions/service.json"),
volumes=[aws.ecs.TaskDefinitionVolumeArgs(
name="service-storage",
efs_volume_configuration=aws.ecs.TaskDefinitionVolumeEfsVolumeConfigurationArgs(
file_system_id=aws_efs_file_system["fs"]["id"],
root_directory="/opt/data",
transit_encryption="ENABLED",
transit_encryption_port=2999,
authorization_config=aws.ecs.TaskDefinitionVolumeEfsVolumeConfigurationAuthorizationConfigArgs(
access_point_id=aws_efs_access_point["test"]["id"],
iam="ENABLED",
),
),
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as fs from "fs";
const service = new aws.ecs.TaskDefinition("service", {
family: "service",
containerDefinitions: fs.readFileSync("task-definitions/service.json"),
volumes: [{
name: "service-storage",
efsVolumeConfiguration: {
fileSystemId: aws_efs_file_system.fs.id,
rootDirectory: "/opt/data",
transitEncryption: "ENABLED",
transitEncryptionPort: 2999,
authorizationConfig: {
accessPointId: aws_efs_access_point.test.id,
iam: "ENABLED",
},
},
}],
});
resources:
service:
type: aws:ecs:TaskDefinition
properties:
family: service
containerDefinitions:
fn::readFile: task-definitions/service.json
volumes:
- name: service-storage
efsVolumeConfiguration:
fileSystemId: ${aws_efs_file_system.fs.id}
rootDirectory: /opt/data
transitEncryption: ENABLED
transitEncryptionPort: 2999
authorizationConfig:
accessPointId: ${aws_efs_access_point.test.id}
iam: ENABLED
Example Using fsx_windows_file_server_volume_configuration
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.SecretsManager.SecretVersion("test", new()
{
SecretId = aws_secretsmanager_secret.Test.Id,
SecretString = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["username"] = "admin",
["password"] = aws_directory_service_directory.Test.Password,
}),
});
var service = new Aws.Ecs.TaskDefinition("service", new()
{
Family = "service",
ContainerDefinitions = File.ReadAllText("task-definitions/service.json"),
Volumes = new[]
{
new Aws.Ecs.Inputs.TaskDefinitionVolumeArgs
{
Name = "service-storage",
FsxWindowsFileServerVolumeConfiguration = new Aws.Ecs.Inputs.TaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationArgs
{
FileSystemId = aws_fsx_windows_file_system.Test.Id,
RootDirectory = "\\data",
AuthorizationConfig = new Aws.Ecs.Inputs.TaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationAuthorizationConfigArgs
{
CredentialsParameter = test.Arn,
Domain = aws_directory_service_directory.Test.Name,
},
},
},
},
});
});
package main
import (
"encoding/json"
"os"
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ecs"
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/secretsmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"username": "admin",
"password": aws_directory_service_directory.Test.Password,
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
test, err := secretsmanager.NewSecretVersion(ctx, "test", &secretsmanager.SecretVersionArgs{
SecretId: pulumi.Any(aws_secretsmanager_secret.Test.Id),
SecretString: pulumi.String(json0),
})
if err != nil {
return err
}
_, err = ecs.NewTaskDefinition(ctx, "service", &ecs.TaskDefinitionArgs{
Family: pulumi.String("service"),
ContainerDefinitions: readFileOrPanic("task-definitions/service.json"),
Volumes: ecs.TaskDefinitionVolumeArray{
&ecs.TaskDefinitionVolumeArgs{
Name: pulumi.String("service-storage"),
FsxWindowsFileServerVolumeConfiguration: &ecs.TaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationArgs{
FileSystemId: pulumi.Any(aws_fsx_windows_file_system.Test.Id),
RootDirectory: pulumi.String("\\data"),
AuthorizationConfig: &ecs.TaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationAuthorizationConfigArgs{
CredentialsParameter: test.Arn,
Domain: pulumi.Any(aws_directory_service_directory.Test.Name),
},
},
},
},
})
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.aws.secretsmanager.SecretVersion;
import com.pulumi.aws.secretsmanager.SecretVersionArgs;
import com.pulumi.aws.ecs.TaskDefinition;
import com.pulumi.aws.ecs.TaskDefinitionArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionVolumeArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationAuthorizationConfigArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 test = new SecretVersion("test", SecretVersionArgs.builder()
.secretId(aws_secretsmanager_secret.test().id())
.secretString(serializeJson(
jsonObject(
jsonProperty("username", "admin"),
jsonProperty("password", aws_directory_service_directory.test().password())
)))
.build());
var service = new TaskDefinition("service", TaskDefinitionArgs.builder()
.family("service")
.containerDefinitions(Files.readString(Paths.get("task-definitions/service.json")))
.volumes(TaskDefinitionVolumeArgs.builder()
.name("service-storage")
.fsxWindowsFileServerVolumeConfiguration(TaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationArgs.builder()
.fileSystemId(aws_fsx_windows_file_system.test().id())
.rootDirectory("\\data")
.authorizationConfig(TaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationAuthorizationConfigArgs.builder()
.credentialsParameter(test.arn())
.domain(aws_directory_service_directory.test().name())
.build())
.build())
.build())
.build());
}
}
import pulumi
import json
import pulumi_aws as aws
test = aws.secretsmanager.SecretVersion("test",
secret_id=aws_secretsmanager_secret["test"]["id"],
secret_string=json.dumps({
"username": "admin",
"password": aws_directory_service_directory["test"]["password"],
}))
service = aws.ecs.TaskDefinition("service",
family="service",
container_definitions=(lambda path: open(path).read())("task-definitions/service.json"),
volumes=[aws.ecs.TaskDefinitionVolumeArgs(
name="service-storage",
fsx_windows_file_server_volume_configuration=aws.ecs.TaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationArgs(
file_system_id=aws_fsx_windows_file_system["test"]["id"],
root_directory="\\data",
authorization_config=aws.ecs.TaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationAuthorizationConfigArgs(
credentials_parameter=test.arn,
domain=aws_directory_service_directory["test"]["name"],
),
),
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as fs from "fs";
const test = new aws.secretsmanager.SecretVersion("test", {
secretId: aws_secretsmanager_secret.test.id,
secretString: JSON.stringify({
username: "admin",
password: aws_directory_service_directory.test.password,
}),
});
const service = new aws.ecs.TaskDefinition("service", {
family: "service",
containerDefinitions: fs.readFileSync("task-definitions/service.json"),
volumes: [{
name: "service-storage",
fsxWindowsFileServerVolumeConfiguration: {
fileSystemId: aws_fsx_windows_file_system.test.id,
rootDirectory: "\\data",
authorizationConfig: {
credentialsParameter: test.arn,
domain: aws_directory_service_directory.test.name,
},
},
}],
});
resources:
service:
type: aws:ecs:TaskDefinition
properties:
family: service
containerDefinitions:
fn::readFile: task-definitions/service.json
volumes:
- name: service-storage
fsxWindowsFileServerVolumeConfiguration:
fileSystemId: ${aws_fsx_windows_file_system.test.id}
rootDirectory: \data
authorizationConfig:
credentialsParameter: ${test.arn}
domain: ${aws_directory_service_directory.test.name}
test:
type: aws:secretsmanager:SecretVersion
properties:
secretId: ${aws_secretsmanager_secret.test.id}
secretString:
fn::toJSON:
username: admin
password: ${aws_directory_service_directory.test.password}
Example Using container_definitions
and inference_accelerator
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.Ecs.TaskDefinition("test", new()
{
ContainerDefinitions = @"[
{
""cpu"": 10,
""command"": [""sleep"", ""10""],
""entryPoint"": [""/""],
""environment"": [
{""name"": ""VARNAME"", ""value"": ""VARVAL""}
],
""essential"": true,
""image"": ""jenkins"",
""memory"": 128,
""name"": ""jenkins"",
""portMappings"": [
{
""containerPort"": 80,
""hostPort"": 8080
}
],
""resourceRequirements"":[
{
""type"":""InferenceAccelerator"",
""value"":""device_1""
}
]
}
]
",
Family = "test",
InferenceAccelerators = new[]
{
new Aws.Ecs.Inputs.TaskDefinitionInferenceAcceleratorArgs
{
DeviceName = "device_1",
DeviceType = "eia1.medium",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ecs.NewTaskDefinition(ctx, "test", &ecs.TaskDefinitionArgs{
ContainerDefinitions: pulumi.String("[\n {\n \"cpu\": 10,\n \"command\": [\"sleep\", \"10\"],\n \"entryPoint\": [\"/\"],\n \"environment\": [\n {\"name\": \"VARNAME\", \"value\": \"VARVAL\"}\n ],\n \"essential\": true,\n \"image\": \"jenkins\",\n \"memory\": 128,\n \"name\": \"jenkins\",\n \"portMappings\": [\n {\n \"containerPort\": 80,\n \"hostPort\": 8080\n }\n ],\n \"resourceRequirements\":[\n {\n \"type\":\"InferenceAccelerator\",\n \"value\":\"device_1\"\n }\n ]\n }\n]\n\n"),
Family: pulumi.String("test"),
InferenceAccelerators: ecs.TaskDefinitionInferenceAcceleratorArray{
&ecs.TaskDefinitionInferenceAcceleratorArgs{
DeviceName: pulumi.String("device_1"),
DeviceType: pulumi.String("eia1.medium"),
},
},
})
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.aws.ecs.TaskDefinition;
import com.pulumi.aws.ecs.TaskDefinitionArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionInferenceAcceleratorArgs;
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 test = new TaskDefinition("test", TaskDefinitionArgs.builder()
.containerDefinitions("""
[
{
"cpu": 10,
"command": ["sleep", "10"],
"entryPoint": ["/"],
"environment": [
{"name": "VARNAME", "value": "VARVAL"}
],
"essential": true,
"image": "jenkins",
"memory": 128,
"name": "jenkins",
"portMappings": [
{
"containerPort": 80,
"hostPort": 8080
}
],
"resourceRequirements":[
{
"type":"InferenceAccelerator",
"value":"device_1"
}
]
}
]
""")
.family("test")
.inferenceAccelerators(TaskDefinitionInferenceAcceleratorArgs.builder()
.deviceName("device_1")
.deviceType("eia1.medium")
.build())
.build());
}
}
import pulumi
import pulumi_aws as aws
test = aws.ecs.TaskDefinition("test",
container_definitions="""[
{
"cpu": 10,
"command": ["sleep", "10"],
"entryPoint": ["/"],
"environment": [
{"name": "VARNAME", "value": "VARVAL"}
],
"essential": true,
"image": "jenkins",
"memory": 128,
"name": "jenkins",
"portMappings": [
{
"containerPort": 80,
"hostPort": 8080
}
],
"resourceRequirements":[
{
"type":"InferenceAccelerator",
"value":"device_1"
}
]
}
]
""",
family="test",
inference_accelerators=[aws.ecs.TaskDefinitionInferenceAcceleratorArgs(
device_name="device_1",
device_type="eia1.medium",
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.ecs.TaskDefinition("test", {
containerDefinitions: `[
{
"cpu": 10,
"command": ["sleep", "10"],
"entryPoint": ["/"],
"environment": [
{"name": "VARNAME", "value": "VARVAL"}
],
"essential": true,
"image": "jenkins",
"memory": 128,
"name": "jenkins",
"portMappings": [
{
"containerPort": 80,
"hostPort": 8080
}
],
"resourceRequirements":[
{
"type":"InferenceAccelerator",
"value":"device_1"
}
]
}
]
`,
family: "test",
inferenceAccelerators: [{
deviceName: "device_1",
deviceType: "eia1.medium",
}],
});
resources:
test:
type: aws:ecs:TaskDefinition
properties:
containerDefinitions: |+
[
{
"cpu": 10,
"command": ["sleep", "10"],
"entryPoint": ["/"],
"environment": [
{"name": "VARNAME", "value": "VARVAL"}
],
"essential": true,
"image": "jenkins",
"memory": 128,
"name": "jenkins",
"portMappings": [
{
"containerPort": 80,
"hostPort": 8080
}
],
"resourceRequirements":[
{
"type":"InferenceAccelerator",
"value":"device_1"
}
]
}
]
family: test
inferenceAccelerators:
- deviceName: device_1
deviceType: eia1.medium
Example Using runtime_platform
and fargate
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.Ecs.TaskDefinition("test", new()
{
ContainerDefinitions = @"[
{
""name"": ""iis"",
""image"": ""mcr.microsoft.com/windows/servercore/iis"",
""cpu"": 1024,
""memory"": 2048,
""essential"": true
}
]
",
Cpu = "1024",
Family = "test",
Memory = "2048",
NetworkMode = "awsvpc",
RequiresCompatibilities = new[]
{
"FARGATE",
},
RuntimePlatform = new Aws.Ecs.Inputs.TaskDefinitionRuntimePlatformArgs
{
CpuArchitecture = "X86_64",
OperatingSystemFamily = "WINDOWS_SERVER_2019_CORE",
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ecs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ecs.NewTaskDefinition(ctx, "test", &ecs.TaskDefinitionArgs{
ContainerDefinitions: pulumi.String("[\n {\n \"name\": \"iis\",\n \"image\": \"mcr.microsoft.com/windows/servercore/iis\",\n \"cpu\": 1024,\n \"memory\": 2048,\n \"essential\": true\n }\n]\n\n"),
Cpu: pulumi.String("1024"),
Family: pulumi.String("test"),
Memory: pulumi.String("2048"),
NetworkMode: pulumi.String("awsvpc"),
RequiresCompatibilities: pulumi.StringArray{
pulumi.String("FARGATE"),
},
RuntimePlatform: &ecs.TaskDefinitionRuntimePlatformArgs{
CpuArchitecture: pulumi.String("X86_64"),
OperatingSystemFamily: pulumi.String("WINDOWS_SERVER_2019_CORE"),
},
})
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.aws.ecs.TaskDefinition;
import com.pulumi.aws.ecs.TaskDefinitionArgs;
import com.pulumi.aws.ecs.inputs.TaskDefinitionRuntimePlatformArgs;
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 test = new TaskDefinition("test", TaskDefinitionArgs.builder()
.containerDefinitions("""
[
{
"name": "iis",
"image": "mcr.microsoft.com/windows/servercore/iis",
"cpu": 1024,
"memory": 2048,
"essential": true
}
]
""")
.cpu(1024)
.family("test")
.memory(2048)
.networkMode("awsvpc")
.requiresCompatibilities("FARGATE")
.runtimePlatform(TaskDefinitionRuntimePlatformArgs.builder()
.cpuArchitecture("X86_64")
.operatingSystemFamily("WINDOWS_SERVER_2019_CORE")
.build())
.build());
}
}
import pulumi
import pulumi_aws as aws
test = aws.ecs.TaskDefinition("test",
container_definitions="""[
{
"name": "iis",
"image": "mcr.microsoft.com/windows/servercore/iis",
"cpu": 1024,
"memory": 2048,
"essential": true
}
]
""",
cpu="1024",
family="test",
memory="2048",
network_mode="awsvpc",
requires_compatibilities=["FARGATE"],
runtime_platform=aws.ecs.TaskDefinitionRuntimePlatformArgs(
cpu_architecture="X86_64",
operating_system_family="WINDOWS_SERVER_2019_CORE",
))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.ecs.TaskDefinition("test", {
containerDefinitions: `[
{
"name": "iis",
"image": "mcr.microsoft.com/windows/servercore/iis",
"cpu": 1024,
"memory": 2048,
"essential": true
}
]
`,
cpu: "1024",
family: "test",
memory: "2048",
networkMode: "awsvpc",
requiresCompatibilities: ["FARGATE"],
runtimePlatform: {
cpuArchitecture: "X86_64",
operatingSystemFamily: "WINDOWS_SERVER_2019_CORE",
},
});
resources:
test:
type: aws:ecs:TaskDefinition
properties:
containerDefinitions: |+
[
{
"name": "iis",
"image": "mcr.microsoft.com/windows/servercore/iis",
"cpu": 1024,
"memory": 2048,
"essential": true
}
]
cpu: 1024
family: test
memory: 2048
networkMode: awsvpc
requiresCompatibilities:
- FARGATE
runtimePlatform:
cpuArchitecture: X86_64
operatingSystemFamily: WINDOWS_SERVER_2019_CORE
Create TaskDefinition Resource
new TaskDefinition(name: string, args: TaskDefinitionArgs, opts?: CustomResourceOptions);
@overload
def TaskDefinition(resource_name: str,
opts: Optional[ResourceOptions] = None,
container_definitions: Optional[str] = None,
cpu: Optional[str] = None,
ephemeral_storage: Optional[TaskDefinitionEphemeralStorageArgs] = None,
execution_role_arn: Optional[str] = None,
family: Optional[str] = None,
inference_accelerators: Optional[Sequence[TaskDefinitionInferenceAcceleratorArgs]] = None,
ipc_mode: Optional[str] = None,
memory: Optional[str] = None,
network_mode: Optional[str] = None,
pid_mode: Optional[str] = None,
placement_constraints: Optional[Sequence[TaskDefinitionPlacementConstraintArgs]] = None,
proxy_configuration: Optional[TaskDefinitionProxyConfigurationArgs] = None,
requires_compatibilities: Optional[Sequence[str]] = None,
runtime_platform: Optional[TaskDefinitionRuntimePlatformArgs] = None,
skip_destroy: Optional[bool] = None,
tags: Optional[Mapping[str, str]] = None,
task_role_arn: Optional[str] = None,
volumes: Optional[Sequence[TaskDefinitionVolumeArgs]] = None)
@overload
def TaskDefinition(resource_name: str,
args: TaskDefinitionArgs,
opts: Optional[ResourceOptions] = None)
func NewTaskDefinition(ctx *Context, name string, args TaskDefinitionArgs, opts ...ResourceOption) (*TaskDefinition, error)
public TaskDefinition(string name, TaskDefinitionArgs args, CustomResourceOptions? opts = null)
public TaskDefinition(String name, TaskDefinitionArgs args)
public TaskDefinition(String name, TaskDefinitionArgs args, CustomResourceOptions options)
type: aws:ecs:TaskDefinition
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TaskDefinitionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args TaskDefinitionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TaskDefinitionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TaskDefinitionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TaskDefinitionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
TaskDefinition Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The TaskDefinition resource accepts the following input properties:
- Container
Definitions string A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- Family string
A unique name for your task definition.
- Cpu string
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- Ephemeral
Storage TaskDefinition Ephemeral Storage Args The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- Execution
Role stringArn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- Inference
Accelerators List<TaskDefinition Inference Accelerator Args> Configuration block(s) with Inference Accelerators settings. Detailed below.
- Ipc
Mode string IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- Memory string
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- Network
Mode string Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- Pid
Mode string Process namespace to use for the containers in the task. The valid values are
host
andtask
.- Placement
Constraints List<TaskDefinition Placement Constraint Args> Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- Proxy
Configuration TaskDefinition Proxy Configuration Args Configuration block for the App Mesh proxy. Detailed below.
- Requires
Compatibilities List<string> Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- Runtime
Platform TaskDefinition Runtime Platform Args Configuration block for runtime_platform that containers in your task may use.
- Skip
Destroy bool Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- Dictionary<string, string>
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Task
Role stringArn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- Volumes
List<Task
Definition Volume Args> Configuration block for volumes that containers in your task may use. Detailed below.
- Container
Definitions string A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- Family string
A unique name for your task definition.
- Cpu string
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- Ephemeral
Storage TaskDefinition Ephemeral Storage Args The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- Execution
Role stringArn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- Inference
Accelerators []TaskDefinition Inference Accelerator Args Configuration block(s) with Inference Accelerators settings. Detailed below.
- Ipc
Mode string IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- Memory string
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- Network
Mode string Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- Pid
Mode string Process namespace to use for the containers in the task. The valid values are
host
andtask
.- Placement
Constraints []TaskDefinition Placement Constraint Args Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- Proxy
Configuration TaskDefinition Proxy Configuration Args Configuration block for the App Mesh proxy. Detailed below.
- Requires
Compatibilities []string Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- Runtime
Platform TaskDefinition Runtime Platform Args Configuration block for runtime_platform that containers in your task may use.
- Skip
Destroy bool Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- map[string]string
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Task
Role stringArn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- Volumes
[]Task
Definition Volume Args Configuration block for volumes that containers in your task may use. Detailed below.
- container
Definitions String A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- family String
A unique name for your task definition.
- cpu String
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- ephemeral
Storage TaskDefinition Ephemeral Storage Args The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- execution
Role StringArn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- inference
Accelerators List<TaskDefinition Inference Accelerator Args> Configuration block(s) with Inference Accelerators settings. Detailed below.
- ipc
Mode String IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- memory String
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- network
Mode String Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- pid
Mode String Process namespace to use for the containers in the task. The valid values are
host
andtask
.- placement
Constraints List<TaskDefinition Placement Constraint Args> Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- proxy
Configuration TaskDefinition Proxy Configuration Args Configuration block for the App Mesh proxy. Detailed below.
- requires
Compatibilities List<String> Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- runtime
Platform TaskDefinition Runtime Platform Args Configuration block for runtime_platform that containers in your task may use.
- skip
Destroy Boolean Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- Map<String,String>
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- task
Role StringArn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- volumes
List<Task
Definition Volume Args> Configuration block for volumes that containers in your task may use. Detailed below.
- container
Definitions string A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- family string
A unique name for your task definition.
- cpu string
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- ephemeral
Storage TaskDefinition Ephemeral Storage Args The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- execution
Role stringArn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- inference
Accelerators TaskDefinition Inference Accelerator Args[] Configuration block(s) with Inference Accelerators settings. Detailed below.
- ipc
Mode string IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- memory string
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- network
Mode string Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- pid
Mode string Process namespace to use for the containers in the task. The valid values are
host
andtask
.- placement
Constraints TaskDefinition Placement Constraint Args[] Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- proxy
Configuration TaskDefinition Proxy Configuration Args Configuration block for the App Mesh proxy. Detailed below.
- requires
Compatibilities string[] Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- runtime
Platform TaskDefinition Runtime Platform Args Configuration block for runtime_platform that containers in your task may use.
- skip
Destroy boolean Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- {[key: string]: string}
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- task
Role stringArn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- volumes
Task
Definition Volume Args[] Configuration block for volumes that containers in your task may use. Detailed below.
- container_
definitions str A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- family str
A unique name for your task definition.
- cpu str
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- ephemeral_
storage TaskDefinition Ephemeral Storage Args The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- execution_
role_ strarn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- inference_
accelerators Sequence[TaskDefinition Inference Accelerator Args] Configuration block(s) with Inference Accelerators settings. Detailed below.
- ipc_
mode str IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- memory str
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- network_
mode str Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- pid_
mode str Process namespace to use for the containers in the task. The valid values are
host
andtask
.- placement_
constraints Sequence[TaskDefinition Placement Constraint Args] Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- proxy_
configuration TaskDefinition Proxy Configuration Args Configuration block for the App Mesh proxy. Detailed below.
- requires_
compatibilities Sequence[str] Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- runtime_
platform TaskDefinition Runtime Platform Args Configuration block for runtime_platform that containers in your task may use.
- skip_
destroy bool Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- Mapping[str, str]
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- task_
role_ strarn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- volumes
Sequence[Task
Definition Volume Args] Configuration block for volumes that containers in your task may use. Detailed below.
- container
Definitions String A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- family String
A unique name for your task definition.
- cpu String
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- ephemeral
Storage Property Map The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- execution
Role StringArn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- inference
Accelerators List<Property Map> Configuration block(s) with Inference Accelerators settings. Detailed below.
- ipc
Mode String IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- memory String
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- network
Mode String Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- pid
Mode String Process namespace to use for the containers in the task. The valid values are
host
andtask
.- placement
Constraints List<Property Map> Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- proxy
Configuration Property Map Configuration block for the App Mesh proxy. Detailed below.
- requires
Compatibilities List<String> Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- runtime
Platform Property Map Configuration block for runtime_platform that containers in your task may use.
- skip
Destroy Boolean Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- Map<String>
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- task
Role StringArn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- volumes List<Property Map>
Configuration block for volumes that containers in your task may use. Detailed below.
Outputs
All input properties are implicitly available as output properties. Additionally, the TaskDefinition resource produces the following output properties:
- Arn string
Full ARN of the Task Definition (including both
family
andrevision
).- Arn
Without stringRevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- Id string
The provider-assigned unique ID for this managed resource.
- Revision int
Revision of the task in a particular family.
- Dictionary<string, string>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
Full ARN of the Task Definition (including both
family
andrevision
).- Arn
Without stringRevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- Id string
The provider-assigned unique ID for this managed resource.
- Revision int
Revision of the task in a particular family.
- map[string]string
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
Full ARN of the Task Definition (including both
family
andrevision
).- arn
Without StringRevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- id String
The provider-assigned unique ID for this managed resource.
- revision Integer
Revision of the task in a particular family.
- Map<String,String>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
Full ARN of the Task Definition (including both
family
andrevision
).- arn
Without stringRevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- id string
The provider-assigned unique ID for this managed resource.
- revision number
Revision of the task in a particular family.
- {[key: string]: string}
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
Full ARN of the Task Definition (including both
family
andrevision
).- arn_
without_ strrevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- id str
The provider-assigned unique ID for this managed resource.
- revision int
Revision of the task in a particular family.
- Mapping[str, str]
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
Full ARN of the Task Definition (including both
family
andrevision
).- arn
Without StringRevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- id String
The provider-assigned unique ID for this managed resource.
- revision Number
Revision of the task in a particular family.
- Map<String>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up Existing TaskDefinition Resource
Get an existing TaskDefinition resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: TaskDefinitionState, opts?: CustomResourceOptions): TaskDefinition
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
arn_without_revision: Optional[str] = None,
container_definitions: Optional[str] = None,
cpu: Optional[str] = None,
ephemeral_storage: Optional[TaskDefinitionEphemeralStorageArgs] = None,
execution_role_arn: Optional[str] = None,
family: Optional[str] = None,
inference_accelerators: Optional[Sequence[TaskDefinitionInferenceAcceleratorArgs]] = None,
ipc_mode: Optional[str] = None,
memory: Optional[str] = None,
network_mode: Optional[str] = None,
pid_mode: Optional[str] = None,
placement_constraints: Optional[Sequence[TaskDefinitionPlacementConstraintArgs]] = None,
proxy_configuration: Optional[TaskDefinitionProxyConfigurationArgs] = None,
requires_compatibilities: Optional[Sequence[str]] = None,
revision: Optional[int] = None,
runtime_platform: Optional[TaskDefinitionRuntimePlatformArgs] = None,
skip_destroy: Optional[bool] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
task_role_arn: Optional[str] = None,
volumes: Optional[Sequence[TaskDefinitionVolumeArgs]] = None) -> TaskDefinition
func GetTaskDefinition(ctx *Context, name string, id IDInput, state *TaskDefinitionState, opts ...ResourceOption) (*TaskDefinition, error)
public static TaskDefinition Get(string name, Input<string> id, TaskDefinitionState? state, CustomResourceOptions? opts = null)
public static TaskDefinition get(String name, Output<String> id, TaskDefinitionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
Full ARN of the Task Definition (including both
family
andrevision
).- Arn
Without stringRevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- Container
Definitions string A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- Cpu string
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- Ephemeral
Storage TaskDefinition Ephemeral Storage Args The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- Execution
Role stringArn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- Family string
A unique name for your task definition.
- Inference
Accelerators List<TaskDefinition Inference Accelerator Args> Configuration block(s) with Inference Accelerators settings. Detailed below.
- Ipc
Mode string IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- Memory string
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- Network
Mode string Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- Pid
Mode string Process namespace to use for the containers in the task. The valid values are
host
andtask
.- Placement
Constraints List<TaskDefinition Placement Constraint Args> Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- Proxy
Configuration TaskDefinition Proxy Configuration Args Configuration block for the App Mesh proxy. Detailed below.
- Requires
Compatibilities List<string> Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- Revision int
Revision of the task in a particular family.
- Runtime
Platform TaskDefinition Runtime Platform Args Configuration block for runtime_platform that containers in your task may use.
- Skip
Destroy bool Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- Dictionary<string, string>
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Dictionary<string, string>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- Task
Role stringArn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- Volumes
List<Task
Definition Volume Args> Configuration block for volumes that containers in your task may use. Detailed below.
- Arn string
Full ARN of the Task Definition (including both
family
andrevision
).- Arn
Without stringRevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- Container
Definitions string A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- Cpu string
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- Ephemeral
Storage TaskDefinition Ephemeral Storage Args The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- Execution
Role stringArn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- Family string
A unique name for your task definition.
- Inference
Accelerators []TaskDefinition Inference Accelerator Args Configuration block(s) with Inference Accelerators settings. Detailed below.
- Ipc
Mode string IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- Memory string
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- Network
Mode string Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- Pid
Mode string Process namespace to use for the containers in the task. The valid values are
host
andtask
.- Placement
Constraints []TaskDefinition Placement Constraint Args Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- Proxy
Configuration TaskDefinition Proxy Configuration Args Configuration block for the App Mesh proxy. Detailed below.
- Requires
Compatibilities []string Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- Revision int
Revision of the task in a particular family.
- Runtime
Platform TaskDefinition Runtime Platform Args Configuration block for runtime_platform that containers in your task may use.
- Skip
Destroy bool Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- map[string]string
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- map[string]string
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- Task
Role stringArn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- Volumes
[]Task
Definition Volume Args Configuration block for volumes that containers in your task may use. Detailed below.
- arn String
Full ARN of the Task Definition (including both
family
andrevision
).- arn
Without StringRevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- container
Definitions String A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- cpu String
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- ephemeral
Storage TaskDefinition Ephemeral Storage Args The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- execution
Role StringArn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- family String
A unique name for your task definition.
- inference
Accelerators List<TaskDefinition Inference Accelerator Args> Configuration block(s) with Inference Accelerators settings. Detailed below.
- ipc
Mode String IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- memory String
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- network
Mode String Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- pid
Mode String Process namespace to use for the containers in the task. The valid values are
host
andtask
.- placement
Constraints List<TaskDefinition Placement Constraint Args> Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- proxy
Configuration TaskDefinition Proxy Configuration Args Configuration block for the App Mesh proxy. Detailed below.
- requires
Compatibilities List<String> Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- revision Integer
Revision of the task in a particular family.
- runtime
Platform TaskDefinition Runtime Platform Args Configuration block for runtime_platform that containers in your task may use.
- skip
Destroy Boolean Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- Map<String,String>
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map<String,String>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- task
Role StringArn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- volumes
List<Task
Definition Volume Args> Configuration block for volumes that containers in your task may use. Detailed below.
- arn string
Full ARN of the Task Definition (including both
family
andrevision
).- arn
Without stringRevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- container
Definitions string A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- cpu string
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- ephemeral
Storage TaskDefinition Ephemeral Storage Args The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- execution
Role stringArn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- family string
A unique name for your task definition.
- inference
Accelerators TaskDefinition Inference Accelerator Args[] Configuration block(s) with Inference Accelerators settings. Detailed below.
- ipc
Mode string IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- memory string
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- network
Mode string Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- pid
Mode string Process namespace to use for the containers in the task. The valid values are
host
andtask
.- placement
Constraints TaskDefinition Placement Constraint Args[] Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- proxy
Configuration TaskDefinition Proxy Configuration Args Configuration block for the App Mesh proxy. Detailed below.
- requires
Compatibilities string[] Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- revision number
Revision of the task in a particular family.
- runtime
Platform TaskDefinition Runtime Platform Args Configuration block for runtime_platform that containers in your task may use.
- skip
Destroy boolean Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- {[key: string]: string}
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- {[key: string]: string}
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- task
Role stringArn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- volumes
Task
Definition Volume Args[] Configuration block for volumes that containers in your task may use. Detailed below.
- arn str
Full ARN of the Task Definition (including both
family
andrevision
).- arn_
without_ strrevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- container_
definitions str A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- cpu str
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- ephemeral_
storage TaskDefinition Ephemeral Storage Args The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- execution_
role_ strarn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- family str
A unique name for your task definition.
- inference_
accelerators Sequence[TaskDefinition Inference Accelerator Args] Configuration block(s) with Inference Accelerators settings. Detailed below.
- ipc_
mode str IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- memory str
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- network_
mode str Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- pid_
mode str Process namespace to use for the containers in the task. The valid values are
host
andtask
.- placement_
constraints Sequence[TaskDefinition Placement Constraint Args] Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- proxy_
configuration TaskDefinition Proxy Configuration Args Configuration block for the App Mesh proxy. Detailed below.
- requires_
compatibilities Sequence[str] Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- revision int
Revision of the task in a particular family.
- runtime_
platform TaskDefinition Runtime Platform Args Configuration block for runtime_platform that containers in your task may use.
- skip_
destroy bool Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- Mapping[str, str]
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Mapping[str, str]
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- task_
role_ strarn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- volumes
Sequence[Task
Definition Volume Args] Configuration block for volumes that containers in your task may use. Detailed below.
- arn String
Full ARN of the Task Definition (including both
family
andrevision
).- arn
Without StringRevision ARN of the Task Definition with the trailing
revision
removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the AWS documentation for details.- container
Definitions String A list of valid container definitions provided as a single valid JSON document. Please note that you should only provide values that are part of the container definition document. For a detailed description of what parameters are available, see the Task Definition Parameters section from the official Developer Guide.
- cpu String
Number of cpu units used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- ephemeral
Storage Property Map The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on AWS Fargate. See Ephemeral Storage.
- execution
Role StringArn ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
- family String
A unique name for your task definition.
- inference
Accelerators List<Property Map> Configuration block(s) with Inference Accelerators settings. Detailed below.
- ipc
Mode String IPC resource namespace to be used for the containers in the task The valid values are
host
,task
, andnone
.- memory String
Amount (in MiB) of memory used by the task. If the
requires_compatibilities
isFARGATE
this field is required.- network
Mode String Docker networking mode to use for the containers in the task. Valid values are
none
,bridge
,awsvpc
, andhost
.- pid
Mode String Process namespace to use for the containers in the task. The valid values are
host
andtask
.- placement
Constraints List<Property Map> Configuration block for rules that are taken into consideration during task placement. Maximum number of
placement_constraints
is10
. Detailed below.- proxy
Configuration Property Map Configuration block for the App Mesh proxy. Detailed below.
- requires
Compatibilities List<String> Set of launch types required by the task. The valid values are
EC2
andFARGATE
.- revision Number
Revision of the task in a particular family.
- runtime
Platform Property Map Configuration block for runtime_platform that containers in your task may use.
- skip
Destroy Boolean Whether to retain the old revision when the resource is destroyed or replacement is necessary. Default is
false
.- Map<String>
Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map<String>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.- task
Role StringArn ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
- volumes List<Property Map>
Configuration block for volumes that containers in your task may use. Detailed below.
Supporting Types
TaskDefinitionEphemeralStorage
- Size
In intGib The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is
21
GiB and the maximum supported value is200
GiB.
- Size
In intGib The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is
21
GiB and the maximum supported value is200
GiB.
- size
In IntegerGib The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is
21
GiB and the maximum supported value is200
GiB.
- size
In numberGib The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is
21
GiB and the maximum supported value is200
GiB.
- size_
in_ intgib The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is
21
GiB and the maximum supported value is200
GiB.
- size
In NumberGib The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is
21
GiB and the maximum supported value is200
GiB.
TaskDefinitionInferenceAccelerator
- Device
Name string Elastic Inference accelerator device name. The deviceName must also be referenced in a container definition as a ResourceRequirement.
- Device
Type string Elastic Inference accelerator type to use.
- Device
Name string Elastic Inference accelerator device name. The deviceName must also be referenced in a container definition as a ResourceRequirement.
- Device
Type string Elastic Inference accelerator type to use.
- device
Name String Elastic Inference accelerator device name. The deviceName must also be referenced in a container definition as a ResourceRequirement.
- device
Type String Elastic Inference accelerator type to use.
- device
Name string Elastic Inference accelerator device name. The deviceName must also be referenced in a container definition as a ResourceRequirement.
- device
Type string Elastic Inference accelerator type to use.
- device_
name str Elastic Inference accelerator device name. The deviceName must also be referenced in a container definition as a ResourceRequirement.
- device_
type str Elastic Inference accelerator type to use.
- device
Name String Elastic Inference accelerator device name. The deviceName must also be referenced in a container definition as a ResourceRequirement.
- device
Type String Elastic Inference accelerator type to use.
TaskDefinitionPlacementConstraint
- Type string
Type of constraint. Use
memberOf
to restrict selection to a group of valid candidates. Note thatdistinctInstance
is not supported in task definitions.- Expression string
Cluster Query Language expression to apply to the constraint. For more information, see Cluster Query Language in the Amazon EC2 Container Service Developer Guide.
- Type string
Type of constraint. Use
memberOf
to restrict selection to a group of valid candidates. Note thatdistinctInstance
is not supported in task definitions.- Expression string
Cluster Query Language expression to apply to the constraint. For more information, see Cluster Query Language in the Amazon EC2 Container Service Developer Guide.
- type String
Type of constraint. Use
memberOf
to restrict selection to a group of valid candidates. Note thatdistinctInstance
is not supported in task definitions.- expression String
Cluster Query Language expression to apply to the constraint. For more information, see Cluster Query Language in the Amazon EC2 Container Service Developer Guide.
- type string
Type of constraint. Use
memberOf
to restrict selection to a group of valid candidates. Note thatdistinctInstance
is not supported in task definitions.- expression string
Cluster Query Language expression to apply to the constraint. For more information, see Cluster Query Language in the Amazon EC2 Container Service Developer Guide.
- type str
Type of constraint. Use
memberOf
to restrict selection to a group of valid candidates. Note thatdistinctInstance
is not supported in task definitions.- expression str
Cluster Query Language expression to apply to the constraint. For more information, see Cluster Query Language in the Amazon EC2 Container Service Developer Guide.
- type String
Type of constraint. Use
memberOf
to restrict selection to a group of valid candidates. Note thatdistinctInstance
is not supported in task definitions.- expression String
Cluster Query Language expression to apply to the constraint. For more information, see Cluster Query Language in the Amazon EC2 Container Service Developer Guide.
TaskDefinitionProxyConfiguration
- Container
Name string Name of the container that will serve as the App Mesh proxy.
- Properties Dictionary<string, string>
Set of network configuration parameters to provide the Container Network Interface (CNI) plugin, specified a key-value mapping.
- Type string
Proxy type. The default value is
APPMESH
. The only supported value isAPPMESH
.
- Container
Name string Name of the container that will serve as the App Mesh proxy.
- Properties map[string]string
Set of network configuration parameters to provide the Container Network Interface (CNI) plugin, specified a key-value mapping.
- Type string
Proxy type. The default value is
APPMESH
. The only supported value isAPPMESH
.
- container
Name String Name of the container that will serve as the App Mesh proxy.
- properties Map<String,String>
Set of network configuration parameters to provide the Container Network Interface (CNI) plugin, specified a key-value mapping.
- type String
Proxy type. The default value is
APPMESH
. The only supported value isAPPMESH
.
- container
Name string Name of the container that will serve as the App Mesh proxy.
- properties {[key: string]: string}
Set of network configuration parameters to provide the Container Network Interface (CNI) plugin, specified a key-value mapping.
- type string
Proxy type. The default value is
APPMESH
. The only supported value isAPPMESH
.
- container_
name str Name of the container that will serve as the App Mesh proxy.
- properties Mapping[str, str]
Set of network configuration parameters to provide the Container Network Interface (CNI) plugin, specified a key-value mapping.
- type str
Proxy type. The default value is
APPMESH
. The only supported value isAPPMESH
.
- container
Name String Name of the container that will serve as the App Mesh proxy.
- properties Map<String>
Set of network configuration parameters to provide the Container Network Interface (CNI) plugin, specified a key-value mapping.
- type String
Proxy type. The default value is
APPMESH
. The only supported value isAPPMESH
.
TaskDefinitionRuntimePlatform
- Cpu
Architecture string Must be set to either
X86_64
orARM64
; see cpu architecture- Operating
System stringFamily If the
requires_compatibilities
isFARGATE
this field is required; must be set to a valid option from the operating system family in the runtime platform setting
- Cpu
Architecture string Must be set to either
X86_64
orARM64
; see cpu architecture- Operating
System stringFamily If the
requires_compatibilities
isFARGATE
this field is required; must be set to a valid option from the operating system family in the runtime platform setting
- cpu
Architecture String Must be set to either
X86_64
orARM64
; see cpu architecture- operating
System StringFamily If the
requires_compatibilities
isFARGATE
this field is required; must be set to a valid option from the operating system family in the runtime platform setting
- cpu
Architecture string Must be set to either
X86_64
orARM64
; see cpu architecture- operating
System stringFamily If the
requires_compatibilities
isFARGATE
this field is required; must be set to a valid option from the operating system family in the runtime platform setting
- cpu_
architecture str Must be set to either
X86_64
orARM64
; see cpu architecture- operating_
system_ strfamily If the
requires_compatibilities
isFARGATE
this field is required; must be set to a valid option from the operating system family in the runtime platform setting
- cpu
Architecture String Must be set to either
X86_64
orARM64
; see cpu architecture- operating
System StringFamily If the
requires_compatibilities
isFARGATE
this field is required; must be set to a valid option from the operating system family in the runtime platform setting
TaskDefinitionVolume
- Name string
Name of the volume. This name is referenced in the
sourceVolume
parameter of container definition in themountPoints
section.- Docker
Volume TaskConfiguration Definition Volume Docker Volume Configuration Configuration block to configure a docker volume. Detailed below.
- Efs
Volume TaskConfiguration Definition Volume Efs Volume Configuration Configuration block for an EFS volume. Detailed below.
- Fsx
Windows TaskFile Server Volume Configuration Definition Volume Fsx Windows File Server Volume Configuration Configuration block for an FSX Windows File Server volume. Detailed below.
- Host
Path string Path on the host container instance that is presented to the container. If not set, ECS will create a nonpersistent data volume that starts empty and is deleted after the task has finished.
- Name string
Name of the volume. This name is referenced in the
sourceVolume
parameter of container definition in themountPoints
section.- Docker
Volume TaskConfiguration Definition Volume Docker Volume Configuration Configuration block to configure a docker volume. Detailed below.
- Efs
Volume TaskConfiguration Definition Volume Efs Volume Configuration Configuration block for an EFS volume. Detailed below.
- Fsx
Windows TaskFile Server Volume Configuration Definition Volume Fsx Windows File Server Volume Configuration Configuration block for an FSX Windows File Server volume. Detailed below.
- Host
Path string Path on the host container instance that is presented to the container. If not set, ECS will create a nonpersistent data volume that starts empty and is deleted after the task has finished.
- name String
Name of the volume. This name is referenced in the
sourceVolume
parameter of container definition in themountPoints
section.- docker
Volume TaskConfiguration Definition Volume Docker Volume Configuration Configuration block to configure a docker volume. Detailed below.
- efs
Volume TaskConfiguration Definition Volume Efs Volume Configuration Configuration block for an EFS volume. Detailed below.
- fsx
Windows TaskFile Server Volume Configuration Definition Volume Fsx Windows File Server Volume Configuration Configuration block for an FSX Windows File Server volume. Detailed below.
- host
Path String Path on the host container instance that is presented to the container. If not set, ECS will create a nonpersistent data volume that starts empty and is deleted after the task has finished.
- name string
Name of the volume. This name is referenced in the
sourceVolume
parameter of container definition in themountPoints
section.- docker
Volume TaskConfiguration Definition Volume Docker Volume Configuration Configuration block to configure a docker volume. Detailed below.
- efs
Volume TaskConfiguration Definition Volume Efs Volume Configuration Configuration block for an EFS volume. Detailed below.
- fsx
Windows TaskFile Server Volume Configuration Definition Volume Fsx Windows File Server Volume Configuration Configuration block for an FSX Windows File Server volume. Detailed below.
- host
Path string Path on the host container instance that is presented to the container. If not set, ECS will create a nonpersistent data volume that starts empty and is deleted after the task has finished.
- name str
Name of the volume. This name is referenced in the
sourceVolume
parameter of container definition in themountPoints
section.- docker_
volume_ Taskconfiguration Definition Volume Docker Volume Configuration Configuration block to configure a docker volume. Detailed below.
- efs_
volume_ Taskconfiguration Definition Volume Efs Volume Configuration Configuration block for an EFS volume. Detailed below.
- fsx_
windows_ Taskfile_ server_ volume_ configuration Definition Volume Fsx Windows File Server Volume Configuration Configuration block for an FSX Windows File Server volume. Detailed below.
- host_
path str Path on the host container instance that is presented to the container. If not set, ECS will create a nonpersistent data volume that starts empty and is deleted after the task has finished.
- name String
Name of the volume. This name is referenced in the
sourceVolume
parameter of container definition in themountPoints
section.- docker
Volume Property MapConfiguration Configuration block to configure a docker volume. Detailed below.
- efs
Volume Property MapConfiguration Configuration block for an EFS volume. Detailed below.
- fsx
Windows Property MapFile Server Volume Configuration Configuration block for an FSX Windows File Server volume. Detailed below.
- host
Path String Path on the host container instance that is presented to the container. If not set, ECS will create a nonpersistent data volume that starts empty and is deleted after the task has finished.
TaskDefinitionVolumeDockerVolumeConfiguration
- Autoprovision bool
If this value is
true
, the Docker volume is created if it does not already exist. Note: This field is only used if the scope isshared
.- Driver string
Docker volume driver to use. The driver value must match the driver name provided by Docker because it is used for task placement.
- Driver
Opts Dictionary<string, string> Map of Docker driver specific options.
- Labels Dictionary<string, string>
Map of custom metadata to add to your Docker volume.
- Scope string
Scope for the Docker volume, which determines its lifecycle, either
task
orshared
. Docker volumes that are scoped to atask
are automatically provisioned when the task starts and destroyed when the task stops. Docker volumes that are scoped asshared
persist after the task stops.
- Autoprovision bool
If this value is
true
, the Docker volume is created if it does not already exist. Note: This field is only used if the scope isshared
.- Driver string
Docker volume driver to use. The driver value must match the driver name provided by Docker because it is used for task placement.
- Driver
Opts map[string]string Map of Docker driver specific options.
- Labels map[string]string
Map of custom metadata to add to your Docker volume.
- Scope string
Scope for the Docker volume, which determines its lifecycle, either
task
orshared
. Docker volumes that are scoped to atask
are automatically provisioned when the task starts and destroyed when the task stops. Docker volumes that are scoped asshared
persist after the task stops.
- autoprovision Boolean
If this value is
true
, the Docker volume is created if it does not already exist. Note: This field is only used if the scope isshared
.- driver String
Docker volume driver to use. The driver value must match the driver name provided by Docker because it is used for task placement.
- driver
Opts Map<String,String> Map of Docker driver specific options.
- labels Map<String,String>
Map of custom metadata to add to your Docker volume.
- scope String
Scope for the Docker volume, which determines its lifecycle, either
task
orshared
. Docker volumes that are scoped to atask
are automatically provisioned when the task starts and destroyed when the task stops. Docker volumes that are scoped asshared
persist after the task stops.
- autoprovision boolean
If this value is
true
, the Docker volume is created if it does not already exist. Note: This field is only used if the scope isshared
.- driver string
Docker volume driver to use. The driver value must match the driver name provided by Docker because it is used for task placement.
- driver
Opts {[key: string]: string} Map of Docker driver specific options.
- labels {[key: string]: string}
Map of custom metadata to add to your Docker volume.
- scope string
Scope for the Docker volume, which determines its lifecycle, either
task
orshared
. Docker volumes that are scoped to atask
are automatically provisioned when the task starts and destroyed when the task stops. Docker volumes that are scoped asshared
persist after the task stops.
- autoprovision bool
If this value is
true
, the Docker volume is created if it does not already exist. Note: This field is only used if the scope isshared
.- driver str
Docker volume driver to use. The driver value must match the driver name provided by Docker because it is used for task placement.
- driver_
opts Mapping[str, str] Map of Docker driver specific options.
- labels Mapping[str, str]
Map of custom metadata to add to your Docker volume.
- scope str
Scope for the Docker volume, which determines its lifecycle, either
task
orshared
. Docker volumes that are scoped to atask
are automatically provisioned when the task starts and destroyed when the task stops. Docker volumes that are scoped asshared
persist after the task stops.
- autoprovision Boolean
If this value is
true
, the Docker volume is created if it does not already exist. Note: This field is only used if the scope isshared
.- driver String
Docker volume driver to use. The driver value must match the driver name provided by Docker because it is used for task placement.
- driver
Opts Map<String> Map of Docker driver specific options.
- labels Map<String>
Map of custom metadata to add to your Docker volume.
- scope String
Scope for the Docker volume, which determines its lifecycle, either
task
orshared
. Docker volumes that are scoped to atask
are automatically provisioned when the task starts and destroyed when the task stops. Docker volumes that are scoped asshared
persist after the task stops.
TaskDefinitionVolumeEfsVolumeConfiguration
- File
System stringId ID of the EFS File System.
- Task
Definition Volume Efs Volume Configuration Authorization Config Configuration block for authorization for the Amazon EFS file system. Detailed below.
- Root
Directory string Directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying / will have the same effect as omitting this parameter. This argument is ignored when using
authorization_config
.- Transit
Encryption string Whether or not to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. Transit encryption must be enabled if Amazon EFS IAM authorization is used. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.- Transit
Encryption intPort Port to use for transit encryption. If you do not specify a transit encryption port, it will use the port selection strategy that the Amazon EFS mount helper uses.
- File
System stringId ID of the EFS File System.
- Task
Definition Volume Efs Volume Configuration Authorization Config Configuration block for authorization for the Amazon EFS file system. Detailed below.
- Root
Directory string Directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying / will have the same effect as omitting this parameter. This argument is ignored when using
authorization_config
.- Transit
Encryption string Whether or not to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. Transit encryption must be enabled if Amazon EFS IAM authorization is used. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.- Transit
Encryption intPort Port to use for transit encryption. If you do not specify a transit encryption port, it will use the port selection strategy that the Amazon EFS mount helper uses.
- file
System StringId ID of the EFS File System.
- Task
Definition Volume Efs Volume Configuration Authorization Config Configuration block for authorization for the Amazon EFS file system. Detailed below.
- root
Directory String Directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying / will have the same effect as omitting this parameter. This argument is ignored when using
authorization_config
.- transit
Encryption String Whether or not to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. Transit encryption must be enabled if Amazon EFS IAM authorization is used. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.- transit
Encryption IntegerPort Port to use for transit encryption. If you do not specify a transit encryption port, it will use the port selection strategy that the Amazon EFS mount helper uses.
- file
System stringId ID of the EFS File System.
- Task
Definition Volume Efs Volume Configuration Authorization Config Configuration block for authorization for the Amazon EFS file system. Detailed below.
- root
Directory string Directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying / will have the same effect as omitting this parameter. This argument is ignored when using
authorization_config
.- transit
Encryption string Whether or not to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. Transit encryption must be enabled if Amazon EFS IAM authorization is used. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.- transit
Encryption numberPort Port to use for transit encryption. If you do not specify a transit encryption port, it will use the port selection strategy that the Amazon EFS mount helper uses.
- file_
system_ strid ID of the EFS File System.
- Task
Definition Volume Efs Volume Configuration Authorization Config Configuration block for authorization for the Amazon EFS file system. Detailed below.
- root_
directory str Directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying / will have the same effect as omitting this parameter. This argument is ignored when using
authorization_config
.- transit_
encryption str Whether or not to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. Transit encryption must be enabled if Amazon EFS IAM authorization is used. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.- transit_
encryption_ intport Port to use for transit encryption. If you do not specify a transit encryption port, it will use the port selection strategy that the Amazon EFS mount helper uses.
- file
System StringId ID of the EFS File System.
- Property Map
Configuration block for authorization for the Amazon EFS file system. Detailed below.
- root
Directory String Directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying / will have the same effect as omitting this parameter. This argument is ignored when using
authorization_config
.- transit
Encryption String Whether or not to enable encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon EFS server. Transit encryption must be enabled if Amazon EFS IAM authorization is used. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.- transit
Encryption NumberPort Port to use for transit encryption. If you do not specify a transit encryption port, it will use the port selection strategy that the Amazon EFS mount helper uses.
TaskDefinitionVolumeEfsVolumeConfigurationAuthorizationConfig
- Access
Point stringId Access point ID to use. If an access point is specified, the root directory value will be relative to the directory set for the access point. If specified, transit encryption must be enabled in the EFSVolumeConfiguration.
- Iam string
Whether or not to use the Amazon ECS task IAM role defined in a task definition when mounting the Amazon EFS file system. If enabled, transit encryption must be enabled in the EFSVolumeConfiguration. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.
- Access
Point stringId Access point ID to use. If an access point is specified, the root directory value will be relative to the directory set for the access point. If specified, transit encryption must be enabled in the EFSVolumeConfiguration.
- Iam string
Whether or not to use the Amazon ECS task IAM role defined in a task definition when mounting the Amazon EFS file system. If enabled, transit encryption must be enabled in the EFSVolumeConfiguration. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.
- access
Point StringId Access point ID to use. If an access point is specified, the root directory value will be relative to the directory set for the access point. If specified, transit encryption must be enabled in the EFSVolumeConfiguration.
- iam String
Whether or not to use the Amazon ECS task IAM role defined in a task definition when mounting the Amazon EFS file system. If enabled, transit encryption must be enabled in the EFSVolumeConfiguration. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.
- access
Point stringId Access point ID to use. If an access point is specified, the root directory value will be relative to the directory set for the access point. If specified, transit encryption must be enabled in the EFSVolumeConfiguration.
- iam string
Whether or not to use the Amazon ECS task IAM role defined in a task definition when mounting the Amazon EFS file system. If enabled, transit encryption must be enabled in the EFSVolumeConfiguration. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.
- access_
point_ strid Access point ID to use. If an access point is specified, the root directory value will be relative to the directory set for the access point. If specified, transit encryption must be enabled in the EFSVolumeConfiguration.
- iam str
Whether or not to use the Amazon ECS task IAM role defined in a task definition when mounting the Amazon EFS file system. If enabled, transit encryption must be enabled in the EFSVolumeConfiguration. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.
- access
Point StringId Access point ID to use. If an access point is specified, the root directory value will be relative to the directory set for the access point. If specified, transit encryption must be enabled in the EFSVolumeConfiguration.
- iam String
Whether or not to use the Amazon ECS task IAM role defined in a task definition when mounting the Amazon EFS file system. If enabled, transit encryption must be enabled in the EFSVolumeConfiguration. Valid values:
ENABLED
,DISABLED
. If this parameter is omitted, the default value ofDISABLED
is used.
TaskDefinitionVolumeFsxWindowsFileServerVolumeConfiguration
- Task
Definition Volume Fsx Windows File Server Volume Configuration Authorization Config Configuration block for authorization for the Amazon FSx for Windows File Server file system detailed below.
- File
System stringId The Amazon FSx for Windows File Server file system ID to use.
- Root
Directory string The directory within the Amazon FSx for Windows File Server file system to mount as the root directory inside the host.
- Task
Definition Volume Fsx Windows File Server Volume Configuration Authorization Config Configuration block for authorization for the Amazon FSx for Windows File Server file system detailed below.
- File
System stringId The Amazon FSx for Windows File Server file system ID to use.
- Root
Directory string The directory within the Amazon FSx for Windows File Server file system to mount as the root directory inside the host.
- Task
Definition Volume Fsx Windows File Server Volume Configuration Authorization Config Configuration block for authorization for the Amazon FSx for Windows File Server file system detailed below.
- file
System StringId The Amazon FSx for Windows File Server file system ID to use.
- root
Directory String The directory within the Amazon FSx for Windows File Server file system to mount as the root directory inside the host.
- Task
Definition Volume Fsx Windows File Server Volume Configuration Authorization Config Configuration block for authorization for the Amazon FSx for Windows File Server file system detailed below.
- file
System stringId The Amazon FSx for Windows File Server file system ID to use.
- root
Directory string The directory within the Amazon FSx for Windows File Server file system to mount as the root directory inside the host.
- Task
Definition Volume Fsx Windows File Server Volume Configuration Authorization Config Configuration block for authorization for the Amazon FSx for Windows File Server file system detailed below.
- file_
system_ strid The Amazon FSx for Windows File Server file system ID to use.
- root_
directory str The directory within the Amazon FSx for Windows File Server file system to mount as the root directory inside the host.
- Property Map
Configuration block for authorization for the Amazon FSx for Windows File Server file system detailed below.
- file
System StringId The Amazon FSx for Windows File Server file system ID to use.
- root
Directory String The directory within the Amazon FSx for Windows File Server file system to mount as the root directory inside the host.
TaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationAuthorizationConfig
- Credentials
Parameter string The authorization credential option to use. The authorization credential options can be provided using either the Amazon Resource Name (ARN) of an AWS Secrets Manager secret or AWS Systems Manager Parameter Store parameter. The ARNs refer to the stored credentials.
- Domain string
A fully qualified domain name hosted by an AWS Directory Service Managed Microsoft AD (Active Directory) or self-hosted AD on Amazon EC2.
- Credentials
Parameter string The authorization credential option to use. The authorization credential options can be provided using either the Amazon Resource Name (ARN) of an AWS Secrets Manager secret or AWS Systems Manager Parameter Store parameter. The ARNs refer to the stored credentials.
- Domain string
A fully qualified domain name hosted by an AWS Directory Service Managed Microsoft AD (Active Directory) or self-hosted AD on Amazon EC2.
- credentials
Parameter String The authorization credential option to use. The authorization credential options can be provided using either the Amazon Resource Name (ARN) of an AWS Secrets Manager secret or AWS Systems Manager Parameter Store parameter. The ARNs refer to the stored credentials.
- domain String
A fully qualified domain name hosted by an AWS Directory Service Managed Microsoft AD (Active Directory) or self-hosted AD on Amazon EC2.
- credentials
Parameter string The authorization credential option to use. The authorization credential options can be provided using either the Amazon Resource Name (ARN) of an AWS Secrets Manager secret or AWS Systems Manager Parameter Store parameter. The ARNs refer to the stored credentials.
- domain string
A fully qualified domain name hosted by an AWS Directory Service Managed Microsoft AD (Active Directory) or self-hosted AD on Amazon EC2.
- credentials_
parameter str The authorization credential option to use. The authorization credential options can be provided using either the Amazon Resource Name (ARN) of an AWS Secrets Manager secret or AWS Systems Manager Parameter Store parameter. The ARNs refer to the stored credentials.
- domain str
A fully qualified domain name hosted by an AWS Directory Service Managed Microsoft AD (Active Directory) or self-hosted AD on Amazon EC2.
- credentials
Parameter String The authorization credential option to use. The authorization credential options can be provided using either the Amazon Resource Name (ARN) of an AWS Secrets Manager secret or AWS Systems Manager Parameter Store parameter. The ARNs refer to the stored credentials.
- domain String
A fully qualified domain name hosted by an AWS Directory Service Managed Microsoft AD (Active Directory) or self-hosted AD on Amazon EC2.
Import
ECS Task Definitions can be imported via their Amazon Resource Name (ARN)
$ pulumi import aws:ecs/taskDefinition:TaskDefinition example arn:aws:ecs:us-east-1:012345678910:task-definition/mytaskfamily:123
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.