UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

205 lines (204 loc) 8.03 kB
import * as pulumi from "@pulumi/pulumi"; import * as outputs from "../types/output"; /** * The ECS task definition data source allows access to details of * a specific AWS ECS task definition. * * ## Example Usage * * ```typescript * 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), * }); * ``` */ export declare function getTaskDefinition(args: GetTaskDefinitionArgs, opts?: pulumi.InvokeOptions): Promise<GetTaskDefinitionResult>; /** * A collection of arguments for invoking getTaskDefinition. */ export interface GetTaskDefinitionArgs { /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: 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. */ taskDefinition: string; } /** * A collection of values returned by getTaskDefinition. */ export interface GetTaskDefinitionResult { /** * ARN of the task definition. */ readonly arn: 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](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StartTask.html#ECS-StartTask-request-taskDefinition) for details. */ readonly arnWithoutRevision: string; /** * A list of valid [container definitions](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ContainerDefinition.html) 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](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html) section from the official [Developer Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide). */ readonly containerDefinitions: string; /** * Number of cpu units used by the task. If the `requiresCompatibilities` is `FARGATE` this field is required. */ readonly cpu: string; /** * Enables fault injection and allows for fault injection requests to be accepted from the task's containers. Default is `false`. */ readonly enableFaultInjection: boolean; /** * 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. */ readonly ephemeralStorages: outputs.ecs.GetTaskDefinitionEphemeralStorage[]; /** * ARN of the task execution role that the Amazon ECS container agent and the Docker daemon can assume. */ readonly executionRoleArn: string; /** * A unique name for your task definition. * The following arguments are optional: */ readonly family: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; /** * IPC resource namespace to be used for the containers in the task The valid values are `host`, `task`, and `none`. */ readonly ipcMode: string; /** * Amount (in MiB) of memory used by the task. If the `requiresCompatibilities` is `FARGATE` this field is required. */ readonly memory: string; /** * Docker networking mode to use for the containers in the task. Valid values are `none`, `bridge`, `awsvpc`, and `host`. */ readonly networkMode: string; /** * Process namespace to use for the containers in the task. The valid values are `host` and `task`. */ readonly pidMode: string; /** * Configuration block for rules that are taken into consideration during task placement. Maximum number of `placementConstraints` is `10`. Detailed below. */ readonly placementConstraints: outputs.ecs.GetTaskDefinitionPlacementConstraint[]; /** * Configuration block for the App Mesh proxy. Detailed below. */ readonly proxyConfigurations: outputs.ecs.GetTaskDefinitionProxyConfiguration[]; readonly region: string; /** * Set of launch types required by the task. The valid values are `EC2` and `FARGATE`. */ readonly requiresCompatibilities: string[]; /** * Revision of the task in a particular family. */ readonly revision: number; /** * Configuration block for runtimePlatform that containers in your task may use. */ readonly runtimePlatforms: outputs.ecs.GetTaskDefinitionRuntimePlatform[]; /** * Status of the task definition. */ readonly status: string; readonly taskDefinition: string; /** * ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services. */ readonly taskRoleArn: string; /** * Configuration block for volumes that containers in your task may use. Detailed below. */ readonly volumes: outputs.ecs.GetTaskDefinitionVolume[]; } /** * The ECS task definition data source allows access to details of * a specific AWS ECS task definition. * * ## Example Usage * * ```typescript * 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), * }); * ``` */ export declare function getTaskDefinitionOutput(args: GetTaskDefinitionOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetTaskDefinitionResult>; /** * A collection of arguments for invoking getTaskDefinition. */ export interface GetTaskDefinitionOutputArgs { /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<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. */ taskDefinition: pulumi.Input<string>; }