»AWS ECS

»Builders

ECS uses Docker images for building, which are generated by these builders:

»aws-ecr (registry)

Store a docker image within an Elastic Container Registry on AWS.

»Interface

  • Input: docker.Image
  • Output: ecr.Image

»Examples

registry {
    use "aws-ecr" {
      region = "us-east-1"
      tag = "latest"
    }
}
registry {    use "aws-ecr" {      region = "us-east-1"      tag = "latest"    }}

»Mappers

»Allow an ECR Image to be used as a standard docker.Image

  • Input: ecr.Image
  • Output: docker.Image

»Required Parameters

These parameters are used in the use stanza for this plugin.

»tag

The docker tag to assign to the new image.

  • Type: string

»Optional Parameters

These parameters are used in the use stanza for this plugin.

»region

The AWS region the ECR repository is in.

If not set uses the environment variable AWS_REGION or AWS_REGION_DEFAULT.

  • Type: string
  • Optional

»repository

The ECR repository to store the image into.

This defaults to waypoint- then the application name. The repository will be automatically created if needed.

  • Type: string
  • Optional

»Output Attributes

Output attributes can be used in your waypoint.hcl as variables via artifact or deploy.

»image

  • Type: string

»tag

  • Type: string

»aws-ecs (platform)

Deploy the application into an ECS cluster on AWS.

»Interface

  • Input: docker.Image
  • Output: ecs.Deployment

»Examples

deploy {
  use "aws-ecs" {
    region = "us-east-1"
    memory = 512
  }
}
deploy {  use "aws-ecs" {    region = "us-east-1"    memory = 512  }}

»Required Parameters

These parameters are used in the use stanza for this plugin.

»alb (category)

Provides additional configuration for using an ALB with ECS.

»alb.certificate

The ARN of an AWS Certificate Manager cert to associate with the ALB.

  • Type: string
  • Optional
»alb.domain_name

Fully qualified domain name to set for the ALB.

Set along with zone_id to have DNS automatically setup for the ALB. this value should include the full hostname and domain name, for instance app.example.com.

  • Type: string
  • Optional
»alb.internal

Whether or not the created ALB should be internal.

Used when listener_arn is not set. If set, the created ALB will have a scheme of internal, otherwise by default it has a scheme of internet-facing.

  • Type: bool
  • Optional
»alb.listener_arn

The ARN on an existing ALB to configure.

When this is set, no ALB or Listener is created. Instead the application is configured by manipulating this existing Listener. This allows users to configure their ALB outside waypoint but still have waypoint hook the application to that ALB.

  • Type: string
  • Optional
»alb.zone_id

Route53 ZoneID to create a DNS record into.

Set along with alb.domain_name to have DNS automatically setup for the ALB.

  • Type: string
  • Optional

»logging (category)

Provides additional configuration for logging flags for ECS.

Part of the ecs task definition. These configuration flags help control how the awslogs log driver is configured.

»logging.create_group

Enables creation of the aws logs group if not present.

  • Type: bool
  • Optional
»logging.datetime_format

Defines the multiline start pattern in Python strftime format.

  • Type: string
  • Optional
»logging.max_buffer_size

When using non-blocking logging mode, this is the buffer size for message storage.

  • Type: string
  • Optional
»logging.mode

Delivery method for log messages, either 'blocking' or 'non-blocking'.

  • Type: string
  • Optional
»logging.multiline_pattern

Defines the multiline start pattern using a regular expression.

  • Type: string
  • Optional
»logging.region

The region the logs are to be shipped to.

»logging.stream_prefix

Prefix for application in cloudwatch logs path.

  • Type: string
  • Optional
  • Default: Generated based off timestamp

»memory

How much memory to assign to the container running the application.

When running in Fargate, this must be one of a few values, specified in MB: 512, 1024, 2048, 3072, 4096, 5120, and up to 16384 in increments of 1024. The memory value also controls the possible values for cpu.

  • Type: int

»region

The AWS region for the ECS cluster.

  • Type: string

»sidecar

Additional container to run as a sidecar.

This runs additional containers in addition to the main container that comes from the build phase.

  • Type: list of ecs.ContainerConfig

»sidecar.container_port

The port number for the container.

»sidecar.host_port

The port number on the host to reserve for the container.

»sidecar.image

Image of the sidecar container.

»sidecar.memory

The amount (in MiB) of memory to present to the container.

»sidecar.memory_reservation

The soft limit (in MiB) of memory to reserve for the container.

»sidecar.name

Name of the container.

»sidecar.protocol

The protocol used for port mapping.

»sidecar.secrets

Secrets to expose to this container.

»sidecar.static_environment

Environment variables to expose to this container.

»Optional Parameters

These parameters are used in the use stanza for this plugin.

»cluster

The name of the ECS cluster to deploy into.

The ECS cluster that will run the application as a Service. if there is no ECS cluster with this name, the ECS cluster will be created and configured to use Fargate to run containers.

  • Type: string
  • Optional

»count

How many instances of the application should run.

  • Type: int
  • Optional

»cpu

How many cpu shares the container running the application is allowed.

On Fargate, possible values for this are configured by the amount of memory the container is using. Here is a complete listing of possible values: 512MB: 256 1024MB: 256, 512 2048MB: 256, 512, 1024 3072MB: 512, 1024 4096MB: 512, 1024, 2048 5120MB: 1024, 2048 6144MB: 1024, 2048 7168MB: 1024, 2048 8192MB: 1024, 2048, 4096 9216MB: 2048, 4096 10240MB: 2048, 4096 11264MB: 2048, 4096 12288MB: 2048, 4096 13312MB: 2048, 4096 14336MB: 2048, 4096 15360MB: 2048, 4096 16384MB: 4096 17408MB: 4096 18432MB: 4096 19456MB: 4096 20480MB: 4096 21504MB: 4096 22528MB: 4096 23552MB: 4096 24576MB: 4096 25600MB: 4096 26624MB: 4096 27648MB: 4096 28672MB: 4096 29696MB: 4096 30720MB: 4096.

  • Type: int
  • Optional

»disable_alb

Do not create a load balancer assigned to the service.

  • Type: bool
  • Optional

»ec2_cluster

Indicate if the ECS cluster should be EC2 type rather than Fargate.

This controls if we should verify the ECS cluster in EC2 type. The cluster will not be created if it doesn't exist, only that there as existing cluster this is using EC2 and not Fargate.

  • Type: bool
  • Optional

»execution_role_name

The name of the IAM role to use for ECS execution.

  • Type: string
  • Optional
  • Default: create a new exeuction IAM role based on the application name

»log_group

The CloudWatchLogs log group to store container logs into.

  • Type: string
  • Optional
  • Default: derived from the application name

»memory_reservation

  • Type: int
  • Optional

»secrets

Secret key/values to pass to the ECS container.

  • Type: map of string to string
  • Optional

»service_port

The TCP port that the application is listening on.

  • Type: int64
  • Optional
  • Default: 3000

»static_environment

Static environment variables to make available.

  • Type: map of string to string
  • Optional

»subnets

The VPC subnets to use for the application.

  • Type: list of string
  • Optional
  • Default: public subnets in the default VPC

»task_role_name

The name of the task IAM role to assign.

  • Type: string
  • Optional

»Output Attributes

Output attributes can be used in your waypoint.hcl as variables via artifact or deploy.

»cluster

  • Type: string

»load_balancer_arn

  • Type: string

»service_arn

  • Type: string

»target_group_arn

  • Type: string

»task_arn

  • Type: string

»url

  • Type: string