Fugue.AWS.ECS.TaskDefinition

Module Members

external

(Function)

Create a reference to an externally defined TaskDefinition.

Example usage:

taskDefinition: ECS.TaskDefinition.external("arn:aws:ecs:us-east-2:0123456789:task-definition/wordpress:2")

Type Signature

 fun (String) -> TaskDefinition
Argument: arn

The ARN for the task definition revision to reference.

Type: String

Returns:

A reference to the specified TaskDefinition.

Type: TaskDefinition

new

(Function)

new TaskDefinition (Constructor)

Call this constructor to create a new Fugue.Core.AWS.ECS.TaskDefinition value.

Example usage:

example: ECS.TaskDefinition.new {
  family: "example",
  region: AWS.Us-east-2,
  containerDefinitions: [
    ECS.ContainerDefinition.new {
      name: "nginx",
      image: "nginx",
      cpu: 10,
      memory: 500,
      essential: True,
      portMappings: [
        ECS.PortMapping.tcp {
          containerPort: 80,
          hostPort: 55001,
        },
      ],
    },
  ],
}

Type Signature

 fun { family: Optional<String>,
       containerDefinitions: List<ContainerDefinition>,
       networkMode: Optional<NetworkMode>,
       volumes: Optional<List<Volume>>,
       placementConstraints: Optional<List<String>>,
       region: Region,
       role: Optional<Role>,
       executionRole: Optional<Role>,
       requiresCompatibilities: Optional<List<LaunchType>>,
       cpu: Optional<Int>,
       memory: Optional<Int>,
       resourceId: Optional<String> } -> TaskDefinition
Argument: family

The family name of the task definition. If not provided a unique family name will be generated.

Type: Optional<String>

Argument: containerDefinitions

List of container definitions to create.

Type: List<ContainerDefinition>

Argument: networkMode

The network mode to use for the task’s containers. Defaults to bridge.

Type: Optional<NetworkMode>

Argument: volumes

Optional list of volumes to make available to the container definitions.

Type: Optional<List<Volume>>

Argument: placementConstraints

Optional list of Cluster Query Language expressions to match when placing tasks.

Type: Optional<List<String>>

Argument: region

The region in which to create the task definition.

Type: Region

Argument: role

An optional IAM role that containers within the task definition can assume.

Type: Optional<Role>

Argument: executionRole

An optional IAM role that the ECS container agent and docker daemon can assume. See https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service_IAM_role.html for more information on the permissions this role should have.

Type: Optional<Role>

Argument: requiresCompatibilities

The launch type the task is using. Default is ECS.Ec2.

Type: Optional<List<LaunchType>>

Argument: cpu

The number of cpu units used by the task. If using the EC2 launch type, this field is optional and any value can be used. If using the Fargate launch type, this field is required. See http://botocore.readthedocs.io/en/latest/reference/services/ecs.html#ECS.Client.register_task_definition for more information on valid values.

Type: Optional<Int>

Argument: memory

The amount (in MiB) of memory used by the task. If using the EC2 launch type, this field is optional and any value can be used. If using the Fargate launch type, this field is required. See http://botocore.readthedocs.io/en/latest/reference/services/ecs.html#ECS.Client.register_task_definition for more information on valid values.

Type: Optional<Int>

Argument: resourceId

Resource ID of the resource to import with Fugue Import. This field is only honored on fugue run. The resource ID is the ARN. Mutable. Example: arn:aws:ecs:us-east-1:123456789012:task-definition/hello_world:8

Type: Optional<String>

Returns:

A new Fugue.Core.AWS.ECS.TaskDefinition value.

Type: TaskDefinition

region

(Function)

Return the region for a given TaskDefinition. Works on externals.

Type Signature

 fun (TaskDefinition) -> Region
Argument: taskDefinition

The TaskDefinition whose region to return.

Type: TaskDefinition

Returns:

Region containing the TaskDefinition.

Type: Region