1. Packages
  2. Packages
  3. AWS
  4. API Docs
  5. ecs
  6. getTaskDefinition
Viewing docs for AWS v7.28.0
published on Thursday, Apr 30, 2026 by Pulumi
aws logo
Viewing docs for AWS v7.28.0
published on Thursday, Apr 30, 2026 by Pulumi

    The ECS task definition data source allows access to details of a specific AWS ECS task definition.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const mongoTaskDefinition = new aws.ecs.TaskDefinition("mongo", {
        family: "mongodb",
        containerDefinitions: `[
      {
        \\"cpu\\": 128,
        \\"environment\\": [{
          \\"name\\": \\"SECRET\\",
          \\"value\\": \\"KEY\\"
        }],
        \\"essential\\": true,
        \\"image\\": \\"mongo:latest\\",
        \\"memory\\": 128,
        \\"memoryReservation\\": 64,
        \\"name\\": \\"mongodb\\"
      }
    ]
    `,
    });
    // Simply specify the family to find the latest ACTIVE revision in that family.
    const mongo = aws.ecs.getTaskDefinitionOutput({
        taskDefinition: mongoTaskDefinition.family,
    });
    const foo = new aws.ecs.Cluster("foo", {name: "foo"});
    const mongoService = new aws.ecs.Service("mongo", {
        name: "mongo",
        cluster: foo.id,
        desiredCount: 2,
        taskDefinition: mongo.apply(mongo => mongo.arn),
    });
    
    import pulumi
    import pulumi_aws as aws
    
    mongo_task_definition = aws.ecs.TaskDefinition("mongo",
        family="mongodb",
        container_definitions="""[
      {
        \"cpu\": 128,
        \"environment\": [{
          \"name\": \"SECRET\",
          \"value\": \"KEY\"
        }],
        \"essential\": true,
        \"image\": \"mongo:latest\",
        \"memory\": 128,
        \"memoryReservation\": 64,
        \"name\": \"mongodb\"
      }
    ]
    """)
    # Simply specify the family to find the latest ACTIVE revision in that family.
    mongo = aws.ecs.get_task_definition_output(task_definition=mongo_task_definition.family)
    foo = aws.ecs.Cluster("foo", name="foo")
    mongo_service = aws.ecs.Service("mongo",
        name="mongo",
        cluster=foo.id,
        desired_count=2,
        task_definition=mongo.arn)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		mongoTaskDefinition, err := ecs.NewTaskDefinition(ctx, "mongo", &ecs.TaskDefinitionArgs{
    			Family: pulumi.String("mongodb"),
    			ContainerDefinitions: pulumi.String(`[
      {
        \"cpu\": 128,
        \"environment\": [{
          \"name\": \"SECRET\",
          \"value\": \"KEY\"
        }],
        \"essential\": true,
        \"image\": \"mongo:latest\",
        \"memory\": 128,
        \"memoryReservation\": 64,
        \"name\": \"mongodb\"
      }
    ]
    `),
    		})
    		if err != nil {
    			return err
    		}
    		// Simply specify the family to find the latest ACTIVE revision in that family.
    		mongo := ecs.LookupTaskDefinitionOutput(ctx, ecs.GetTaskDefinitionOutputArgs{
    			TaskDefinition: mongoTaskDefinition.Family,
    		}, nil)
    		foo, err := ecs.NewCluster(ctx, "foo", &ecs.ClusterArgs{
    			Name: pulumi.String("foo"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ecs.NewService(ctx, "mongo", &ecs.ServiceArgs{
    			Name:         pulumi.String("mongo"),
    			Cluster:      foo.ID(),
    			DesiredCount: pulumi.Int(2),
    			TaskDefinition: pulumi.String(mongo.ApplyT(func(mongo ecs.GetTaskDefinitionResult) (*string, error) {
    				return &mongo.Arn, nil
    			}).(pulumi.StringPtrOutput)),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var mongoTaskDefinition = new Aws.Ecs.TaskDefinition("mongo", new()
        {
            Family = "mongodb",
            ContainerDefinitions = @"[
      {
        \""cpu\"": 128,
        \""environment\"": [{
          \""name\"": \""SECRET\"",
          \""value\"": \""KEY\""
        }],
        \""essential\"": true,
        \""image\"": \""mongo:latest\"",
        \""memory\"": 128,
        \""memoryReservation\"": 64,
        \""name\"": \""mongodb\""
      }
    ]
    ",
        });
    
        // Simply specify the family to find the latest ACTIVE revision in that family.
        var mongo = Aws.Ecs.GetTaskDefinition.Invoke(new()
        {
            TaskDefinition = mongoTaskDefinition.Family,
        });
    
        var foo = new Aws.Ecs.Cluster("foo", new()
        {
            Name = "foo",
        });
    
        var mongoService = new Aws.Ecs.Service("mongo", new()
        {
            Name = "mongo",
            Cluster = foo.Id,
            DesiredCount = 2,
            TaskDefinition = mongo.Apply(getTaskDefinitionResult => getTaskDefinitionResult.Arn),
        });
    
    });
    
    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.EcsFunctions;
    import com.pulumi.aws.ecs.inputs.GetTaskDefinitionArgs;
    import com.pulumi.aws.ecs.Cluster;
    import com.pulumi.aws.ecs.ClusterArgs;
    import com.pulumi.aws.ecs.Service;
    import com.pulumi.aws.ecs.ServiceArgs;
    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 mongoTaskDefinition = new TaskDefinition("mongoTaskDefinition", TaskDefinitionArgs.builder()
                .family("mongodb")
                .containerDefinitions("""
    [
      {
        \"cpu\": 128,
        \"environment\": [{
          \"name\": \"SECRET\",
          \"value\": \"KEY\"
        }],
        \"essential\": true,
        \"image\": \"mongo:latest\",
        \"memory\": 128,
        \"memoryReservation\": 64,
        \"name\": \"mongodb\"
      }
    ]
                """)
                .build());
    
            // Simply specify the family to find the latest ACTIVE revision in that family.
            final var mongo = EcsFunctions.getTaskDefinition(GetTaskDefinitionArgs.builder()
                .taskDefinition(mongoTaskDefinition.family())
                .build());
    
            var foo = new Cluster("foo", ClusterArgs.builder()
                .name("foo")
                .build());
    
            var mongoService = new Service("mongoService", ServiceArgs.builder()
                .name("mongo")
                .cluster(foo.id())
                .desiredCount(2)
                .taskDefinition(mongo.applyValue(_mongo -> _mongo.arn()))
                .build());
    
        }
    }
    
    resources:
      foo:
        type: aws:ecs:Cluster
        properties:
          name: foo
      mongoTaskDefinition:
        type: aws:ecs:TaskDefinition
        name: mongo
        properties:
          family: mongodb
          containerDefinitions: |
            [
              {
                \"cpu\": 128,
                \"environment\": [{
                  \"name\": \"SECRET\",
                  \"value\": \"KEY\"
                }],
                \"essential\": true,
                \"image\": \"mongo:latest\",
                \"memory\": 128,
                \"memoryReservation\": 64,
                \"name\": \"mongodb\"
              }
            ]
      mongoService:
        type: aws:ecs:Service
        name: mongo
        properties:
          name: mongo
          cluster: ${foo.id}
          desiredCount: 2 # Track the latest ACTIVE revision
          taskDefinition: ${mongo.arn}
    variables:
      # Simply specify the family to find the latest ACTIVE revision in that family.
      mongo:
        fn::invoke:
          function: aws:ecs:getTaskDefinition
          arguments:
            taskDefinition: ${mongoTaskDefinition.family}
    

    Using getTaskDefinition

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getTaskDefinition(args: GetTaskDefinitionArgs, opts?: InvokeOptions): Promise<GetTaskDefinitionResult>
    function getTaskDefinitionOutput(args: GetTaskDefinitionOutputArgs, opts?: InvokeOptions): Output<GetTaskDefinitionResult>
    def get_task_definition(region: Optional[str] = None,
                            task_definition: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetTaskDefinitionResult
    def get_task_definition_output(region: pulumi.Input[Optional[str]] = None,
                            task_definition: pulumi.Input[Optional[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetTaskDefinitionResult]
    func LookupTaskDefinition(ctx *Context, args *LookupTaskDefinitionArgs, opts ...InvokeOption) (*LookupTaskDefinitionResult, error)
    func LookupTaskDefinitionOutput(ctx *Context, args *LookupTaskDefinitionOutputArgs, opts ...InvokeOption) LookupTaskDefinitionResultOutput

    > Note: This function is named LookupTaskDefinition in the Go SDK.

    public static class GetTaskDefinition 
    {
        public static Task<GetTaskDefinitionResult> InvokeAsync(GetTaskDefinitionArgs args, InvokeOptions? opts = null)
        public static Output<GetTaskDefinitionResult> Invoke(GetTaskDefinitionInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTaskDefinitionResult> getTaskDefinition(GetTaskDefinitionArgs args, InvokeOptions options)
    public static Output<GetTaskDefinitionResult> getTaskDefinition(GetTaskDefinitionArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:ecs/getTaskDefinition:getTaskDefinition
      arguments:
        # arguments dictionary

    The following arguments are supported:

    TaskDefinition string
    Family for the latest ACTIVE revision, family and revision (family:revision) for a specific revision in the family, the ARN of the task definition to access to.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    TaskDefinition string
    Family for the latest ACTIVE revision, family and revision (family:revision) for a specific revision in the family, the ARN of the task definition to access to.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    taskDefinition String
    Family for the latest ACTIVE revision, family and revision (family:revision) for a specific revision in the family, the ARN of the task definition to access to.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    taskDefinition string
    Family for the latest ACTIVE revision, family and revision (family:revision) for a specific revision in the family, the ARN of the task definition to access to.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    task_definition str
    Family for the latest ACTIVE revision, family and revision (family:revision) for a specific revision in the family, the ARN of the task definition to access to.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    taskDefinition String
    Family for the latest ACTIVE revision, family and revision (family:revision) for a specific revision in the family, the ARN of the task definition to access to.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.

    getTaskDefinition Result

    The following output properties are available:

    Arn string
    ARN of the task definition.
    ArnWithoutRevision string
    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.
    ContainerDefinitions 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 requiresCompatibilities is FARGATE this field is required.
    EnableFaultInjection bool
    Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Default is false.
    EphemeralStorages List<GetTaskDefinitionEphemeralStorage>
    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.
    ExecutionRoleArn string
    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. The following arguments are optional:
    Id string
    The provider-assigned unique ID for this managed resource.
    IpcMode string
    IPC resource namespace to be used for the containers in the task The valid values are host, task, and none.
    Memory string
    Amount (in MiB) of memory used by the task. If the requiresCompatibilities is FARGATE this field is required.
    NetworkMode string
    Docker networking mode to use for the containers in the task. Valid values are none, bridge, awsvpc, and host.
    PidMode string
    Process namespace to use for the containers in the task. The valid values are host and task.
    PlacementConstraints List<GetTaskDefinitionPlacementConstraint>
    Configuration block for rules that are taken into consideration during task placement. Maximum number of placementConstraints is 10. Detailed below.
    ProxyConfigurations List<GetTaskDefinitionProxyConfiguration>
    Configuration block for the App Mesh proxy. Detailed below.
    Region string
    RequiresCompatibilities List<string>
    Set of launch types required by the task. The valid values are EC2 and FARGATE.
    Revision int
    Revision of the task in a particular family.
    RuntimePlatforms List<GetTaskDefinitionRuntimePlatform>
    Configuration block for runtimePlatform that containers in your task may use.
    Status string
    Status of the task definition.
    TaskDefinition string
    TaskRoleArn string
    ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
    Volumes List<GetTaskDefinitionVolume>
    Attributes corresponding to the volume argument of the aws.ecs.TaskDefinition resource.
    Arn string
    ARN of the task definition.
    ArnWithoutRevision string
    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.
    ContainerDefinitions 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 requiresCompatibilities is FARGATE this field is required.
    EnableFaultInjection bool
    Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Default is false.
    EphemeralStorages []GetTaskDefinitionEphemeralStorage
    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.
    ExecutionRoleArn string
    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. The following arguments are optional:
    Id string
    The provider-assigned unique ID for this managed resource.
    IpcMode string
    IPC resource namespace to be used for the containers in the task The valid values are host, task, and none.
    Memory string
    Amount (in MiB) of memory used by the task. If the requiresCompatibilities is FARGATE this field is required.
    NetworkMode string
    Docker networking mode to use for the containers in the task. Valid values are none, bridge, awsvpc, and host.
    PidMode string
    Process namespace to use for the containers in the task. The valid values are host and task.
    PlacementConstraints []GetTaskDefinitionPlacementConstraint
    Configuration block for rules that are taken into consideration during task placement. Maximum number of placementConstraints is 10. Detailed below.
    ProxyConfigurations []GetTaskDefinitionProxyConfiguration
    Configuration block for the App Mesh proxy. Detailed below.
    Region string
    RequiresCompatibilities []string
    Set of launch types required by the task. The valid values are EC2 and FARGATE.
    Revision int
    Revision of the task in a particular family.
    RuntimePlatforms []GetTaskDefinitionRuntimePlatform
    Configuration block for runtimePlatform that containers in your task may use.
    Status string
    Status of the task definition.
    TaskDefinition string
    TaskRoleArn string
    ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
    Volumes []GetTaskDefinitionVolume
    Attributes corresponding to the volume argument of the aws.ecs.TaskDefinition resource.
    arn String
    ARN of the task definition.
    arnWithoutRevision String
    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.
    containerDefinitions 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 requiresCompatibilities is FARGATE this field is required.
    enableFaultInjection Boolean
    Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Default is false.
    ephemeralStorages List<GetTaskDefinitionEphemeralStorage>
    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.
    executionRoleArn String
    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. The following arguments are optional:
    id String
    The provider-assigned unique ID for this managed resource.
    ipcMode String
    IPC resource namespace to be used for the containers in the task The valid values are host, task, and none.
    memory String
    Amount (in MiB) of memory used by the task. If the requiresCompatibilities is FARGATE this field is required.
    networkMode String
    Docker networking mode to use for the containers in the task. Valid values are none, bridge, awsvpc, and host.
    pidMode String
    Process namespace to use for the containers in the task. The valid values are host and task.
    placementConstraints List<GetTaskDefinitionPlacementConstraint>
    Configuration block for rules that are taken into consideration during task placement. Maximum number of placementConstraints is 10. Detailed below.
    proxyConfigurations List<GetTaskDefinitionProxyConfiguration>
    Configuration block for the App Mesh proxy. Detailed below.
    region String
    requiresCompatibilities List<String>
    Set of launch types required by the task. The valid values are EC2 and FARGATE.
    revision Integer
    Revision of the task in a particular family.
    runtimePlatforms List<GetTaskDefinitionRuntimePlatform>
    Configuration block for runtimePlatform that containers in your task may use.
    status String
    Status of the task definition.
    taskDefinition String
    taskRoleArn String
    ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
    volumes List<GetTaskDefinitionVolume>
    Attributes corresponding to the volume argument of the aws.ecs.TaskDefinition resource.
    arn string
    ARN of the task definition.
    arnWithoutRevision string
    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.
    containerDefinitions 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 requiresCompatibilities is FARGATE this field is required.
    enableFaultInjection boolean
    Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Default is false.
    ephemeralStorages GetTaskDefinitionEphemeralStorage[]
    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.
    executionRoleArn string
    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. The following arguments are optional:
    id string
    The provider-assigned unique ID for this managed resource.
    ipcMode string
    IPC resource namespace to be used for the containers in the task The valid values are host, task, and none.
    memory string
    Amount (in MiB) of memory used by the task. If the requiresCompatibilities is FARGATE this field is required.
    networkMode string
    Docker networking mode to use for the containers in the task. Valid values are none, bridge, awsvpc, and host.
    pidMode string
    Process namespace to use for the containers in the task. The valid values are host and task.
    placementConstraints GetTaskDefinitionPlacementConstraint[]
    Configuration block for rules that are taken into consideration during task placement. Maximum number of placementConstraints is 10. Detailed below.
    proxyConfigurations GetTaskDefinitionProxyConfiguration[]
    Configuration block for the App Mesh proxy. Detailed below.
    region string
    requiresCompatibilities string[]
    Set of launch types required by the task. The valid values are EC2 and FARGATE.
    revision number
    Revision of the task in a particular family.
    runtimePlatforms GetTaskDefinitionRuntimePlatform[]
    Configuration block for runtimePlatform that containers in your task may use.
    status string
    Status of the task definition.
    taskDefinition string
    taskRoleArn string
    ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
    volumes GetTaskDefinitionVolume[]
    Attributes corresponding to the volume argument of the aws.ecs.TaskDefinition resource.
    arn str
    ARN of the task definition.
    arn_without_revision str
    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 requiresCompatibilities is FARGATE this field is required.
    enable_fault_injection bool
    Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Default is false.
    ephemeral_storages Sequence[GetTaskDefinitionEphemeralStorage]
    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_arn str
    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. The following arguments are optional:
    id str
    The provider-assigned unique ID for this managed resource.
    ipc_mode str
    IPC resource namespace to be used for the containers in the task The valid values are host, task, and none.
    memory str
    Amount (in MiB) of memory used by the task. If the requiresCompatibilities is FARGATE this field is required.
    network_mode str
    Docker networking mode to use for the containers in the task. Valid values are none, bridge, awsvpc, and host.
    pid_mode str
    Process namespace to use for the containers in the task. The valid values are host and task.
    placement_constraints Sequence[GetTaskDefinitionPlacementConstraint]
    Configuration block for rules that are taken into consideration during task placement. Maximum number of placementConstraints is 10. Detailed below.
    proxy_configurations Sequence[GetTaskDefinitionProxyConfiguration]
    Configuration block for the App Mesh proxy. Detailed below.
    region str
    requires_compatibilities Sequence[str]
    Set of launch types required by the task. The valid values are EC2 and FARGATE.
    revision int
    Revision of the task in a particular family.
    runtime_platforms Sequence[GetTaskDefinitionRuntimePlatform]
    Configuration block for runtimePlatform that containers in your task may use.
    status str
    Status of the task definition.
    task_definition str
    task_role_arn str
    ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
    volumes Sequence[GetTaskDefinitionVolume]
    Attributes corresponding to the volume argument of the aws.ecs.TaskDefinition resource.
    arn String
    ARN of the task definition.
    arnWithoutRevision String
    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.
    containerDefinitions 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 requiresCompatibilities is FARGATE this field is required.
    enableFaultInjection Boolean
    Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Default is false.
    ephemeralStorages List<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.
    executionRoleArn String
    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. The following arguments are optional:
    id String
    The provider-assigned unique ID for this managed resource.
    ipcMode String
    IPC resource namespace to be used for the containers in the task The valid values are host, task, and none.
    memory String
    Amount (in MiB) of memory used by the task. If the requiresCompatibilities is FARGATE this field is required.
    networkMode String
    Docker networking mode to use for the containers in the task. Valid values are none, bridge, awsvpc, and host.
    pidMode String
    Process namespace to use for the containers in the task. The valid values are host and task.
    placementConstraints List<Property Map>
    Configuration block for rules that are taken into consideration during task placement. Maximum number of placementConstraints is 10. Detailed below.
    proxyConfigurations List<Property Map>
    Configuration block for the App Mesh proxy. Detailed below.
    region String
    requiresCompatibilities List<String>
    Set of launch types required by the task. The valid values are EC2 and FARGATE.
    revision Number
    Revision of the task in a particular family.
    runtimePlatforms List<Property Map>
    Configuration block for runtimePlatform that containers in your task may use.
    status String
    Status of the task definition.
    taskDefinition String
    taskRoleArn String
    ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services.
    volumes List<Property Map>
    Attributes corresponding to the volume argument of the aws.ecs.TaskDefinition resource.

    Supporting Types

    GetTaskDefinitionEphemeralStorage

    SizeInGib int
    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 is 200 GiB.
    SizeInGib int
    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 is 200 GiB.
    sizeInGib Integer
    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 is 200 GiB.
    sizeInGib number
    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 is 200 GiB.
    size_in_gib int
    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 is 200 GiB.
    sizeInGib Number
    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 is 200 GiB.

    GetTaskDefinitionPlacementConstraint

    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
    Proxy type. The default value is APPMESH. The only supported value is APPMESH.
    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
    Proxy type. The default value is APPMESH. The only supported value is APPMESH.
    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
    Proxy type. The default value is APPMESH. The only supported value is APPMESH.
    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
    Proxy type. The default value is APPMESH. The only supported value is APPMESH.
    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 str
    Proxy type. The default value is APPMESH. The only supported value is APPMESH.
    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
    Proxy type. The default value is APPMESH. The only supported value is APPMESH.

    GetTaskDefinitionProxyConfiguration

    ContainerName 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 is APPMESH.
    ContainerName 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 is APPMESH.
    containerName 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 is APPMESH.
    containerName 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 is APPMESH.
    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 is APPMESH.
    containerName 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 is APPMESH.

    GetTaskDefinitionRuntimePlatform

    CpuArchitecture string
    Must be set to either X86_64 or ARM64; see cpu architecture
    OperatingSystemFamily string
    If the requiresCompatibilities is FARGATE this field is required; must be set to a valid option from the operating system family in the runtime platform setting
    CpuArchitecture string
    Must be set to either X86_64 or ARM64; see cpu architecture
    OperatingSystemFamily string
    If the requiresCompatibilities is FARGATE this field is required; must be set to a valid option from the operating system family in the runtime platform setting
    cpuArchitecture String
    Must be set to either X86_64 or ARM64; see cpu architecture
    operatingSystemFamily String
    If the requiresCompatibilities is FARGATE this field is required; must be set to a valid option from the operating system family in the runtime platform setting
    cpuArchitecture string
    Must be set to either X86_64 or ARM64; see cpu architecture
    operatingSystemFamily string
    If the requiresCompatibilities is FARGATE 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 or ARM64; see cpu architecture
    operating_system_family str
    If the requiresCompatibilities is FARGATE this field is required; must be set to a valid option from the operating system family in the runtime platform setting
    cpuArchitecture String
    Must be set to either X86_64 or ARM64; see cpu architecture
    operatingSystemFamily String
    If the requiresCompatibilities is FARGATE this field is required; must be set to a valid option from the operating system family in the runtime platform setting

    GetTaskDefinitionVolume

    GetTaskDefinitionVolumeDockerVolumeConfiguration

    Autoprovision bool
    Driver string
    DriverOpts Dictionary<string, string>
    Labels Dictionary<string, string>
    Scope string
    Autoprovision bool
    Driver string
    DriverOpts map[string]string
    Labels map[string]string
    Scope string
    autoprovision Boolean
    driver String
    driverOpts Map<String,String>
    labels Map<String,String>
    scope String
    autoprovision boolean
    driver string
    driverOpts {[key: string]: string}
    labels {[key: string]: string}
    scope string
    autoprovision bool
    driver str
    driver_opts Mapping[str, str]
    labels Mapping[str, str]
    scope str
    autoprovision Boolean
    driver String
    driverOpts Map<String>
    labels Map<String>
    scope String

    GetTaskDefinitionVolumeEfsVolumeConfiguration

    GetTaskDefinitionVolumeEfsVolumeConfigurationAuthorizationConfig

    AccessPointId string
    Iam string
    AccessPointId string
    Iam string
    accessPointId String
    iam String
    accessPointId string
    iam string
    accessPointId String
    iam String

    GetTaskDefinitionVolumeFsxWindowsFileServerVolumeConfiguration

    GetTaskDefinitionVolumeFsxWindowsFileServerVolumeConfigurationAuthorizationConfig

    GetTaskDefinitionVolumeS3filesVolumeConfiguration

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    Viewing docs for AWS v7.28.0
    published on Thursday, Apr 30, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.