forked from cloudposse/terraform-aws-ecs-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.yaml
159 lines (131 loc) · 6.08 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: AWS ECS cluster
# Logo for this project
#logo: docs/logo.png
# License of this project
license: "APACHE2"
# Copyrights
copyrights:
- name: "Cloud Posse, LLC"
url: "https://cloudposse.com"
year: "2021"
# Canonical GitHub repo
github_repo: cloudposse/terraform-aws-ecs-cluster
# Badges to display
badges:
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/terraform-aws-ecs-cluster.svg"
url: "https://github.com/cloudposse/terraform-aws-ecs-cluster/releases/latest"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"
- name: "Discourse Forum"
image: "https://img.shields.io/discourse/https/ask.sweetops.com/posts.svg"
url: "https://ask.sweetops.com/"
# List any related terraform modules that this module may be used with or that this module depends on.
related:
- name: "terraform-aws-ecs-web-app"
description: "Terraform module that implements a web app on ECS and supports autoscaling, CI/CD, monitoring, ALB integration, and much more."
url: "https://github.com/cloudposse/terraform-aws-ecs-web-app"
- name: "terraform-aws-ecs-alb-service-task"
description: "Terraform module which implements an ECS service which exposes a web service via ALB."
url: "https://github.com/cloudposse/terraform-aws-ecs-alb-service-task"
- name: "terraform-aws-ecs-atlantis"
description: "Terraform module for deploying Atlantis as an ECS Task."
url: "https://github.com/cloudposse/terraform-aws-ecs-atlantis"
# List any resources helpful for someone to get started. For example, link to the hashicorp documentation or AWS documentation.
references:
- name: "Amazon Elastic Container Service"
description: "Amazon Elastic Container Service (Amazon ECS) is a highly scalable and fast container management service."
url: "https://docs.aws.amazon.com/AmazonECS/latest/developerguide/Welcome.html"
- name: "Amazon ECS capacity providers"
description: "Amazon ECS capacity providers are used to manage the infrastructure the tasks in your clusters use."
url: "https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html"
- name: "Amazon ECS Fargate"
description: "AWS Fargate is a technology that you can use with Amazon ECS to run containers without having to manage servers or clusters of Amazon EC2 instances."
url: "https://docs.aws.amazon.com/AmazonECS/latest/userguide/what-is-fargate.html"
- name: "Amazon EC2 Auto Scaling groups"
description: "An Auto Scaling group contains a collection of EC2 instances that are treated as a logical grouping for the purposes of automatic scaling and management."
url: "https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-groups.html"
- name: "terraform-aws-ec2-autoscale-group"
description: "Terraform module to provision Auto Scaling Group and Launch Template on AWS."
url: "https://github.com/cloudposse/terraform-aws-ec2-autoscale-group"
# Short description of this project
description: |-
Terraform module to provision an [`ECS Cluster`](https://aws.amazon.com/ru/ecs/) with list of
[`capacity providers`](https://docs.aws.amazon.com/AmazonECS/latest/userguide/cluster-capacity-providers.html).
Supports [Amazon ECS Fargate](https://docs.aws.amazon.com/AmazonECS/latest/userguide/fargate-capacity-providers.html)
and [EC2 Autoscaling](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-auto-scaling.html)
capacity providers.
# How to use this module. Should be an easy example to copy and paste.
usage: |-
For a complete example, see [examples/complete](examples/complete).
For automated tests of the complete example using [bats](https://github.com/bats-core/bats-core) and [Terratest](https://github.com/gruntwork-io/terratest)
(which tests and deploys the example on AWS), see [test](test).
### ECS cluster with Fargate capacity provider
```hcl
module "ecs_cluster" {
source = "cloudposse/ecs-cluster/aws"
namespace = "eg"
name = "example"
container_insights_enabled = true
capacity_providers_fargate = true
}
```
### ECS cluster with Fargate and EC2 autoscale capacity provider
```hcl
# Create a standard label resource. See [null-label](https://github.com/cloudposse/terraform-null-label/#terraform-null-label--)
module "label" {
source = "cloudposse/label/null"
# Cloud Posse recommends pinning every module to a specific version, though usually you want to use the current one
# version = "x.x.x"
namespace = "eg"
name = "example"
}
module "vpc" {
source = "cloudposse/vpc/aws"
version = "1.2.0"
context = module.label.context
ipv4_primary_cidr_block = "172.16.0.0/16"
}
module "subnets" {
source = "cloudposse/dynamic-subnets/aws"
version = "2.0.4"
context = module.label.context
availability_zones = var.availability_zones
vpc_id = module.vpc.vpc_id
igw_id = [module.vpc.igw_id]
ipv4_cidr_block = [module.vpc.vpc_cidr_block]
nat_gateway_enabled = false
nat_instance_enabled = false
}
module "ecs_cluster" {
source = "cloudposse/ecs-cluster/aws"
context = module.label.context
container_insights_enabled = true
capacity_providers_fargate = true
capacity_providers_fargate_spot = true
capacity_providers_ec2 = {
default = {
instance_type = "t3.medium"
security_group_ids = [module.vpc.vpc_default_security_group_id]
subnet_ids = module.subnets.private_subnet_ids
associate_public_ip_address = false
min_size = 0
max_size = 2
}
}
}
```
# Other files to include in this README from the project folder
include:
- "docs/targets.md"
- "docs/terraform.md"
# Contributors to this project
contributors:
- name: "Igor Rodionov"
github: "goruha"