![CircleCI](https://camo.githubusercontent.com/70e0bfbae525af7d2869240c6e443a7a61a9df8dfd6274d1071e2bd23e388069/68747470733a2f2f636972636c6563692e636f6d2f67682f6772616e64636f6c6c696e652f7465727261666f726d2d6177732d6563732d666172676174652e7376673f7374796c653d73766726636972636c652d746f6b656e3d34323636386631363330616364633132656530623735316338383061343432346335633536366331)
This is Minimal ECS Fargate Service Module.
These types of resources are supported:
type = lb
is create target group and connect to ecs_service.
Private Service Discovery
type = sd
is create private service discovery and connect to ecs_service.
type = no
is not create more resources.
is_mem_scale = true
or is_cpu_scale = true
module "fargate" {
source = "grandcolline/ecs-fargate/aws"
version = "1.0.0"
service_name = "FargateTestService"
cluster_name = aws_ecs_cluster.main.name
task_definition_arn = aws_ecs_task_definition.main.arn
container_name = "ecs_demo_app"
assign_public_ip = "true"
type = "lb"
service_subnets = ["${var.service_subnet_id}"]
lb_dns = aws_alb.main.dns_name
}
Name |
Description |
Type |
Default |
Required |
region |
AWS Region |
string |
"ap-northeast-1" |
no |
add_tags |
Additional tags |
map(string) |
{} |
no |
Name |
Description |
Type |
Default |
Required |
service_name |
fargate service name |
string |
n/a |
yes |
cluster_name |
ECS cluster name |
string |
n/a |
yes |
task_count |
task's desired count & minimum capacity |
string |
"1" |
no |
task_definition_arn |
task definition's arn |
string |
n/a |
yes |
type |
fargate service type. load balancer or service discovery or nothing (lb/sd/no) |
string |
"no" |
no |
deployment_maximum_percent |
maximum percent when deploy |
string |
"200" |
no |
deployment_minimum_healthy_percent |
minimum percent when deploy |
string |
"50" |
no |
assign_public_ip |
assign public ip to the task |
bool |
"false" |
no |
Name |
Description |
Type |
Default |
Required |
service_subnets |
List of subnet id's to put the task on |
list |
n/a |
yes |
Load Balancer Variables (type = lb
)
Name |
Description |
Type |
Default |
Required |
container_name |
container's name to which target group connect |
string |
"" |
no |
container_port |
container's port to which target group connect |
string |
"8080" |
no |
deregistration_delay |
time for load balancing to wait before deregistering a target |
string |
"300" |
no |
lb_dns |
load balancer's dns |
string |
"" |
no |
healthy_threshold |
|
string |
"2" |
no |
unhealthy_threshold |
|
string |
"5" |
no |
healthcheck_timeout |
|
string |
"5" |
no |
healthcheck_protocol |
|
string |
"HTTP" |
no |
healthcheck_path |
|
string |
"/hc" |
no |
healthcheck_interval |
|
string |
"30" |
no |
healthcheck_matcher |
|
string |
"200" |
no |
Service Discovery Variables (type = sd
)
Name |
Description |
Type |
Default |
Required |
dns_namespace_id |
|
string |
"" |
no |
dns_ttl |
|
string |
"10" |
no |
Name |
Description |
Type |
Default |
Required |
task_max_count |
task's maximum capacity |
string |
"2" |
no |
is_mem_scale |
scale task by memory usage |
bool |
"false" |
no |
mem_target_value |
target value of scale task by memory usage (%) |
string |
"40" |
no |
mem_scale_in_cooldown |
cool down time of scale in task by memory usage |
string |
"300" |
no |
mem_scale_out_cooldown |
cool down time of scale out task by memory usage |
string |
"300" |
no |
is_cpu_scale |
scale task by cpu usage |
bool |
"false" |
no |
cpu_target_value |
target value of scale task by cpu usage (%) |
string |
"40" |
no |
cpu_scale_in_cooldown |
cool down time of scale in task by cpu usage |
string |
"300" |
no |
cpu_scale_out_cooldown |
cool down time of scale out task by cpu usage |
string |
"300" |
no |
Name |
Description |
target_group_arn |
target group's arn |
target_group_arn_suffix |
target group's arn suffix |