Skip to content

Terraform module to deploy ECS tasks with addons. Bootstrap an ECS service exposed with an Application Load Balancer, ECR, simple IAM Policy and generate CI credentials.

License

Notifications You must be signed in to change notification settings

tbobm/terraform-aws-ecs

Repository files navigation

Terraform ECS Module

Simple Terraform module to deploy an ECS task using AWS Fargate including addons (Load Balancer, ECR, CI credentials)

Example usage

module "ecr" {
  source  = "tbobm/ecs/aws"
  version = "0.0.1"

  container = {
    image = "particuleio/helloworld"
  }

  vpc = {
    id = "vpc-xxxxxxxx"
  }
}

Doc generation

Code formatting and documentation for variables and outputs is generated using pre-commit-terraform hooks which uses terraform-docs.

Follow these instructions to install pre-commit locally.

And install terraform-docs with go get github.com/segmentio/terraform-docs or brew install terraform-docs.

Contributing

Report issues/questions/feature requests on in the issues section.

Requirements

Name Version
aws ~> 3.0

Providers

Name Version
aws ~> 3.0

Modules

No modules.

Resources

Name Type
aws_ecr_repository.repository resource
aws_ecr_repository_policy.policy resource
aws_ecs_cluster.cluster resource
aws_ecs_service.service resource
aws_ecs_task_definition.task resource
aws_iam_access_key.publisher resource
aws_iam_role.fargate resource
aws_iam_role_policy.fargate resource
aws_iam_user.publisher resource
aws_iam_user_policy.publisher resource
aws_lb.alb resource
aws_lb_listener.front_end resource
aws_lb_target_group.group resource
aws_subnet.subnets data source
aws_subnet_ids.subnets data source
aws_vpc.vpc data source

Inputs

Name Description Type Default Required
aws_region AWS region string "eu-west-3" no
container Container configuration to deploy any {} no
ecr_values AWS ECR configuration any {} no
ecs_values AWS ECS configuration any {} no
lb_values AWS Load Balancer configuration any {} no
vpc AWS VPC configuration any {} no

Outputs

Name Description
app_url The public ALB DNS
aws_region The AWS region used
container_name Container name for the ECS task
ecr_repository_name The ECR repository name
ecr_url The ECR repository URL
ecs_cluster The ECS cluster name
ecs_service The ECS service name
publisher_access_key AWS_ACCESS_KEY to publish to ECR
publisher_secret_key AWS_SECRET_ACCESS_KEY to upload to the ECR

About

Terraform module to deploy ECS tasks with addons. Bootstrap an ECS service exposed with an Application Load Balancer, ECR, simple IAM Policy and generate CI credentials.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages