All Projects → tmknom → Terraform Aws Ecs Fargate

tmknom / Terraform Aws Ecs Fargate

Licence: apache-2.0
Terraform module which creates ECS Fargate resources on AWS.

Projects that are alternatives of or similar to Terraform Aws Ecs Fargate

Terraform Fargate Example
Example repository to run an ECS cluster on Fargate
Stars: ✭ 206 (+488.57%)
Mutual labels:  aws, ecs, terraform, hcl
Terraform Aws Alb
Terraform module to provision a standard ALB for HTTP/HTTP traffic
Stars: ✭ 53 (+51.43%)
Mutual labels:  aws, ecs, terraform, hcl
Terraform Ecs Fargate
A Terraform template used for provisioning web application stacks on AWS ECS Fargate
Stars: ✭ 293 (+737.14%)
Mutual labels:  aws, ecs, terraform, hcl
Terraform Aws Ecs Codepipeline
Terraform Module for CI/CD with AWS Code Pipeline and Code Build for ECS https://cloudposse.com/
Stars: ✭ 85 (+142.86%)
Mutual labels:  aws, ecs, terraform, hcl
Infrastructure As Code Talk
Sample code for the talk "Infrastructure-as-code: running microservices on AWS with Docker, ECS, and Terraform"
Stars: ✭ 520 (+1385.71%)
Mutual labels:  aws, ecs, terraform, hcl
Ecs Pipeline
☁️ 🐳 ⚡️ 🚀 Create environment and deployment pipelines to ECS Fargate with CodePipeline, CodeBuild and Github using Terraform
Stars: ✭ 85 (+142.86%)
Mutual labels:  aws, ecs, terraform, hcl
Terraform Ecs Autoscale Alb
ECS cluster with instance and service autoscaling configured and running behind an ALB with path based routing set up
Stars: ✭ 60 (+71.43%)
Mutual labels:  aws, ecs, terraform, hcl
Aws Ecs Airflow
Run Airflow in AWS ECS(Elastic Container Service) using Fargate tasks
Stars: ✭ 107 (+205.71%)
Mutual labels:  aws, ecs, terraform, hcl
Terraform Aws Ecs Container Definition
Terraform module to generate well-formed JSON documents (container definitions) that are passed to the aws_ecs_task_definition Terraform resource
Stars: ✭ 217 (+520%)
Mutual labels:  aws, ecs, terraform, hcl
Cloudguardiaas
Check Point CloudGuard Network Security repository containing solution templates, Terraform templates, tools and scripts for deploying and configuring CloudGuard Network Security products.
Stars: ✭ 27 (-22.86%)
Mutual labels:  aws, terraform, hcl
Terraform Aws Gitlab Runner
Terraform module for AWS GitLab runners on ec2 (spot) instances
Stars: ✭ 292 (+734.29%)
Mutual labels:  aws, terraform, hcl
Terraform Kubestack
Terraform GitOps Framework — Everything you need to build reliable automation for AKS, EKS and GKE Kubernetes clusters in one free and open-source framework.
Stars: ✭ 300 (+757.14%)
Mutual labels:  aws, terraform, hcl
Lambda Deployment Example
Automated Lambda Deployments with Terraform & CodePipeline
Stars: ✭ 25 (-28.57%)
Mutual labels:  aws, terraform, hcl
Terraform Modules
Terraform Modules
Stars: ✭ 25 (-28.57%)
Mutual labels:  aws, terraform, hcl
Kubenow
Deploy Kubernetes. Now!
Stars: ✭ 285 (+714.29%)
Mutual labels:  aws, terraform, hcl
Terratag
Terratag is a CLI tool that enables users of Terraform to automatically create and maintain tags across their entire set of AWS, Azure, and GCP resources
Stars: ✭ 385 (+1000%)
Mutual labels:  aws, terraform, hcl
Terra Aws Core Kube
Terraform configuration to bootstrap a Kubernetes Cluster on top of CoreOS using AWS-EC2 instances
Stars: ✭ 10 (-71.43%)
Mutual labels:  aws, terraform, hcl
Iam Policy Json To Terraform
Small tool to convert an IAM Policy in JSON format into a Terraform aws_iam_policy_document
Stars: ✭ 282 (+705.71%)
Mutual labels:  aws, terraform, hcl
Elasticsearch Cloud Deploy
Deploy Elasticsearch on the cloud easily
Stars: ✭ 308 (+780%)
Mutual labels:  aws, terraform, hcl
Inframap
Read your tfstate or HCL to generate a graph specific for each provider, showing only the resources that are most important/relevant.
Stars: ✭ 430 (+1128.57%)
Mutual labels:  aws, terraform, hcl

terraform-aws-ecs-fargate

Terraform Actions Status Markdown Actions Status YAML Actions Status JSON Actions Status GitHub tag License

Terraform module which creates ECS Fargate resources on AWS.

Description

Provision ECS Service and ECS Task Definition.

This module provides recommended settings:

  • Fargate launch type
  • Disable assign public ip address

Usage

Minimal

module "ecs_fargate" {
  source                = "git::https://github.com/tmknom/terraform-aws-ecs-fargate.git?ref=tags/2.0.0"
  name                  = "example"
  container_name        = "nginx"
  container_port        = "80"
  cluster               = var.ecs_cluster_arn
  subnets               = var.subnets
  target_group_arn      = var.target_group_arn
  vpc_id                = var.vpc_id
  container_definitions = var.container_definitions
}

Complete

module "ecs_fargate" {
  source                = "git::https://github.com/tmknom/terraform-aws-ecs-fargate.git?ref=tags/2.0.0"
  name                  = "example"
  container_name        = "nginx"
  container_port        = "80"
  cluster               = var.ecs_cluster_arn
  subnets               = var.subnets
  target_group_arn      = var.target_group_arn
  vpc_id                = var.vpc_id
  container_definitions = var.container_definitions

  desired_count                      = 2
  deployment_maximum_percent         = 200
  deployment_minimum_healthy_percent = 100
  deployment_controller_type         = "ECS"
  assign_public_ip                   = true
  health_check_grace_period_seconds  = 10
  platform_version                   = "1.4.0"
  source_cidr_blocks                 = ["0.0.0.0/0"]
  cpu                                = 256
  memory                             = 512
  requires_compatibilities           = ["FARGATE"]
  iam_path                           = "/service_role/"
  description                        = "This is example"
  enabled                            = true

  create_ecs_task_execution_role = false
  ecs_task_execution_role_arn    = var.ecs_task_execution_role_arn

  tags = {
    Environment = "prod"
  }
}

Examples

Requirements

Name Version
terraform >= 0.12

Providers

Name Version
aws n/a

Inputs

Name Description Type Default Required
cluster ARN of an ECS cluster. string n/a yes
container_definitions A list of valid container definitions provided as a single valid JSON document. string n/a yes
container_name The name of the container to associate with the load balancer (as it appears in a container definition). string n/a yes
container_port The port on the container to associate with the load balancer. string n/a yes
name The name of ecs service. string n/a yes
subnets The subnets associated with the task or service. list(string) n/a yes
target_group_arn The ARN of the Load Balancer target group to associate with the service. string n/a yes
vpc_id VPC Id to associate with ECS Service. string n/a yes
assign_public_ip Assign a public IP address to the ENI (Fargate launch type only). Valid values are true or false. string false no
cpu The number of cpu units used by the task. string "256" no
create_ecs_task_execution_role Specify true to indicate that ECS Task Execution IAM Role creation. string true no
deployment_controller_type Type of deployment controller. Valid values: CODE_DEPLOY, ECS. string "ECS" no
deployment_maximum_percent The upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. string 200 no
deployment_minimum_healthy_percent The lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment. string 100 no
description The description of the all resources. string "Managed by Terraform" no
desired_count The number of instances of the task definition to place and keep running. string 0 no
ecs_task_execution_role_arn The ARN of the ECS Task Execution IAM Role. string "" no
enabled Set to false to prevent the module from creating anything. string true no
health_check_grace_period_seconds Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 7200. string 60 no
iam_path Path in which to create the IAM Role and the IAM Policy. string "/" no
memory The amount (in MiB) of memory used by the task. string "512" no
platform_version The platform version on which to run your service. string "1.4.0" no
requires_compatibilities A set of launch types required by the task. The valid values are EC2 and FARGATE. list(string)
[
"FARGATE"
]
no
source_cidr_blocks List of source CIDR blocks. list(string)
[
"0.0.0.0/0"
]
no
tags A mapping of tags to assign to all resources. map(string) {} no

Outputs

Name Description
ecs_service_cluster The Amazon Resource Name (ARN) of cluster which the service runs on.
ecs_service_desired_count The number of instances of the task definition.
ecs_service_iam_role The ARN of IAM role used for ELB.
ecs_service_id The Amazon Resource Name (ARN) that identifies the service.
ecs_service_name The name of the service.
ecs_task_definition_arn Full ARN of the Task Definition (including both family and revision).
ecs_task_definition_family The family of the Task Definition.
ecs_task_definition_revision The revision of the task in a particular family.
iam_policy_arn The ARN assigned by AWS to this IAM Policy.
iam_policy_description The description of the IAM Policy.
iam_policy_document The policy document of the IAM Policy.
iam_policy_id The IAM Policy's ID.
iam_policy_name The name of the IAM Policy.
iam_policy_path The path of the IAM Policy.
iam_role_arn The Amazon Resource Name (ARN) specifying the IAM Role.
iam_role_create_date The creation date of the IAM Role.
iam_role_description The description of the IAM Role.
iam_role_name The name of the IAM Role.
iam_role_unique_id The stable and unique string identifying the IAM Role.
security_group_arn The ARN of the ECS Service security group.
security_group_description The description of the ECS Service security group.
security_group_egress The egress rules of the ECS Service security group.
security_group_id The ID of the ECS Service security group.
security_group_ingress The ingress rules of the ECS Service security group.
security_group_name The name of the ECS Service security group.
security_group_owner_id The owner ID of the ECS Service security group.
security_group_vpc_id The VPC ID of the ECS Service security group.

Development

Development Requirements

Configure environment variables

export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
export AWS_DEFAULT_REGION=ap-northeast-1

Installation

git clone [email protected]:tmknom/terraform-aws-ecs-fargate.git
cd terraform-aws-ecs-fargate
make install

Makefile targets

apply-complete                 Run terraform apply examples/complete
apply-minimal                  Run terraform apply examples/minimal
check-format                   Check format code
clean                          Clean .terraform
destroy-complete               Run terraform destroy examples/complete
destroy-minimal                Run terraform destroy examples/minimal
diff                           Word diff
docs                           Generate docs
format                         Format code
help                           Show help
install                        Install requirements
lint                           Lint code
plan-complete                  Run terraform plan examples/complete
plan-minimal                   Run terraform plan examples/minimal
release                        Release GitHub and Terraform Module Registry
upgrade                        Upgrade makefile

Releasing new versions

Bump VERSION file, and run make release.

Terraform Module Registry

License

Apache 2 Licensed. See LICENSE for full details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].