parent | title | nav_exclude |
---|---|---|
Infrastructure Components |
AWS ECS-Task |
false |
ECS, or EC2 Container Service, is able to run docker containers natively in AWS cloud. While the module can support classic EC2-based and Fargate, features, this module generally prefers "ECS Fargete", which allows dynamic launching of docker containers with no always-on cost and no servers to manage or pay for when tasks are not running.
Use in combination with the ECS-Cluster
component.
No requirements.
The following providers are used by this module:
-
http
-
aws
-
random
-
null
The following input variables are required:
Description: Standard name_prefix
module input. (Prefix counts towards 64-character max length for certain resource types.)
Type: string
Description: Standard environment
module input.
Type:
object({
vpc_id = string
aws_region = string
public_subnets = list(string)
private_subnets = list(string)
})
Description: Standard resource_tags
module input.
Type: map(string)
Description: Examples: 'python:3.8', [aws_account_id].dkr.ecr.[aws_region].amazonaws.com/[byo_model_repo_name]
Type: string
Description: The name of the ECS Cluster to use.
Type: string
The following input variables are optional (have default values):
Description: True to create an ECS Service with a single 'always-on' task instance.
Type: bool
Default: false
Description: A list of admin ports (to be governed by admin_cidr
).
Type: list(string)
Default: []
Description: Optional. The range of IP addresses which should be able to access admin ports. Defaults to the local user's current IP.
Type: list
Default: []
Description: A list of app ports (will be governed by app_cidr
).
Type: list(string)
Default: []
Description: Optional. The range of IP addresses which should be able to access app ports. Defaults to the local user's current IP.
Type: list
Default: []
Description: Optional. Overrides 'command' for the image.
Type: any
Default: null
Description: Optional. Overrides the 'entrypoint' for the image.
Type: any
Default: null
Description: Optional. Overrides the name of the default container.
Type: string
Default: "DefaultContainer"
Description: The number of CPU cores to dedicate to the container.
Type: string
Default: "4"
Description: The amount of RAM to dedicate to the container.
Type: string
Default: "8"
Description: Mapping of environment variable names to secret manager ARNs or local file secrets. Examples:
- arn:aws:secretsmanager:[aws_region]:[aws_account]:secret:prod/ECSRunner/thisisnottherealsecret
- path/to/file.json:MY_KEY_NAME_1
- path/to/file.yml:MY_KEY_NAME_2
Type: map(string)
Default: {}
Description: Mapping of environment variable names to their values.
Type: map(string)
Default: {}
Description: Required only if use_load_balancer
= True. The load balancer to use for inbound traffic.
Type: string
Default: null
Description: A list of bucket names, to which the ECS task will be granted read/write access.
Type: list(string)
Default: null
Description: A lists of scheduled execution times.
Type: set(string)
Default: []
Description: Optional. Overrides the KMS key used when storing secrets in AWS Secrets Manager.
Type: string
Default: null
Description: True to receive inbound traffic from the load balancer specified in load_balancer_arn
.
Type: bool
Default: false
Description: True to use Fargate for task execution (default), False to use EC2 (classic).
Type: bool
Default: true
Description: If True, tasks will use a private subnet and will require a NAT gateway to pull the docker image, and for any outbound traffic. If False, tasks will use a public subnet and will not require a NAT gateway.
Type: bool
Default: false
Description: True to allow the terraform user to connect to the DB instance.
Type: bool
Default: true
The following outputs are exported:
Description: Name of Cloudwatch log group used for this task.
Description: Command-ling string used to print Cloudwatch logs locally.
Description: The name of the task's primary container.
Description: An IAM role which has access to execute the ECS Task.
Description: Link to Cloudwatch logs for this task.
Description: Command-line string used to trigger on-demand execution of the Task.
Description: The name of the ECS task.
Description: The name of the EC2 security group used by ECS.
Description: The unique ID (ARN) of the load balancer (if applicable).
Description: The DNS of the load balancer (if applicable).
Description: A list of subnets used for task execution.
Source code for this module is available using the links below.
NOTE: This documentation was auto-generated using
terraform-docs
and s-infra
from slalom.dataops
.
Please do not attempt to manually update this file.