ecs-container-definition

cloudposse/ecs-container-definition/aws

Terraform Module HCL AWS

Terraform module to generate well-formed JSON documents (container definitions) that are passed to the aws_ecs_task_definition Terraform resource

Install
module "ecs-container-definition" {
source = "cloudposse/ecs-container-definition/aws"
version = "0.61.2"
}
plain text: /constructs/tfmod-cloudposse-ecs-container-definition-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

Terraform module to generate well-formed JSON documents that are passed to the aws_ecs_task_definition Terraform resource as container definitions. > [!TIP] > #### 👽 Use Atmos with Terraform > Cloud Posse uses atmos to easily orchestrate multiple environments using Terraform. > Works with Github Actions, Atlantis, or Spacelift. > > > Watch demo of using Atmos with Terraform > > Example of running atmos to manage infrastructure from our Quick Start tutorial. > Usage This module is meant to be used as output only, meaning it will be used to create outputs which are consumed as a parameter by Terraform resources or other modules. Caution: This module, unlike nearly all other Cloud Posse Terraform modules, does not use terraform-null-label. Furthermore, it has an input named environment which

Inputs (44)
NameTypeDescriptionDefault
container_namestringThe name of the container. Up to 255 characters ([a-z], [A-Z], [0-9], -, _ allow required
container_imagestringThe image used to start the container. Images in the Docker Hub registry availab required
version_consistencystringSpecifies whether Amazon ECS will resolve the container image tag provided in thnull
healthcheckobject({ command = lisA map containing command (string), timeout, interval (duration in seconds), retrnull
container_cpunumberThe number of cpu units to reserve for the container. This is optional for tasks0
commandlist(string)The command that is passed to the containernull
environmentlist(object({ name = striThe environment variables to pass to the container. This is a list of maps. map_null
ulimitslist(object({ hardLimit = Container ulimit settings. This is a list of maps, where each map should containnull
docker_labelsmap(string)The configuration options to send to the `docker_labels`null
resource_requirementslist(object({ type = striThe type and amount of a resource to assign to a container. The only supported rnull
essentialboolDetermines whether all other containers in a task are stopped, if this containertrue
entrypointlist(string)The entry point that is passed to the containernull
mount_pointslist(object({ containerPatContainer mount points. This is a list of maps, where each map should contain `cnull
docker_security_optionslist(string)A list of strings to provide custom labels for SELinux and AppArmor multi-level null
disable_networkingboolWhen this parameter is true, networking is disabled within the container.null
working_directorystringThe working directory to run commands inside the containernull
extra_hostslist(object({ hostname = A list of hostnames and IP address mappings to append to the /etc/hosts file on null
map_environmentmap(string)The environment variables to pass to the container. This is a map of string: {kenull
environment_fileslist(object({ type = striOne or more files containing the environment variables to pass to the container.null
dns_search_domainslist(string)Container DNS search domains. A list of DNS search domains that are presented tonull
restart_policyobject({ enabled The restart policy for a container. When you set up a restart policy, Amazon ECSnull
interactiveboolWhen this parameter is true, this allows you to deploy containerized applicationnull
… and 4 more inputs
Outputs (6)
json_map_encoded_list — JSON string encoded list of container definitions for use with other terraform resources such as aws
json_map_encoded — JSON string encoded container definitions for use with other terraform resources such as aws_ecs_tas
json_map_object — JSON map encoded container definition
sensitive_json_map_encoded_list — JSON string encoded list of container definitions for use with other terraform resources such as aws
sensitive_json_map_encoded — JSON string encoded container definitions for use with other terraform resources such as aws_ecs_tas
sensitive_json_map_object — JSON map encoded container definition (sensitive)
Details
FrameworkTerraform Module
LanguageHCL
Version0.61.2
Cloud AWS
★ Stars350
Forks239
Total downloads19.9M
Inputs44
Outputs6
Examples7
LicenseApache-2.0
Namespacecloudposse
Updated