Skip to content

Commit 17e3e6b

Browse files
santhoshratalasanthosh ratala
andauthored
Add deployment_circuit_breaker & health_check_grace_period vars to ECS Service module (#22)
Co-authored-by: santhosh ratala <[email protected]>
1 parent f13c556 commit 17e3e6b

File tree

12 files changed

+37
-467
lines changed

12 files changed

+37
-467
lines changed

README.md

Lines changed: 1 addition & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -24,92 +24,6 @@ No resources.
2424

2525
## Inputs
2626

27-
| Name | Description | Type | Default | Required |
28-
|------|-------------|------|---------|:--------:|
29-
| <a name="input_asg_create"></a> [asg\_create](#input\_asg\_create) | Specify whether to create ASG resource | `bool` | `false` | no |
30-
| <a name="input_asg_desired_capacity"></a> [asg\_desired\_capacity](#input\_asg\_desired\_capacity) | The number of Amazon EC2 instances that should be running in the autoscaling group | `number` | `null` | no |
31-
| <a name="input_asg_ebs_optimized"></a> [asg\_ebs\_optimized](#input\_asg\_ebs\_optimized) | If true, the launched EC2 instance will be EBS-optimized | `bool` | `true` | no |
32-
| <a name="input_asg_enable_monitoring"></a> [asg\_enable\_monitoring](#input\_asg\_enable\_monitoring) | Enables/disables detailed monitoring | `bool` | `true` | no |
33-
| <a name="input_asg_enabled_metrics"></a> [asg\_enabled\_metrics](#input\_asg\_enabled\_metrics) | A list of metrics to collect. The allowed values are `GroupDesiredCapacity`, `GroupInServiceCapacity`, `GroupPendingCapacity`, `GroupMinSize`, `GroupMaxSize`, `GroupInServiceInstances`, `GroupPendingInstances`, `GroupStandbyInstances`, `GroupStandbyCapacity`, `GroupTerminatingCapacity`, `GroupTerminatingInstances`, `GroupTotalCapacity`, `GroupTotalInstances` | `list(string)` | <pre>[<br> "GroupDesiredCapacity",<br> "GroupInServiceCapacity",<br> "GroupPendingCapacity",<br> "GroupMinSize",<br> "GroupMaxSize",<br> "GroupInServiceInstances",<br> "GroupPendingInstances",<br> "GroupStandbyInstances",<br> "GroupStandbyCapacity",<br> "GroupTerminatingCapacity",<br> "GroupTerminatingInstances",<br> "GroupTotalCapacity",<br> "GroupTotalInstances"<br>]</pre> | no |
34-
| <a name="input_asg_health_check_type"></a> [asg\_health\_check\_type](#input\_asg\_health\_check\_type) | `EC2` or `ELB`. Controls how health checking is done | `string` | `"ELB"` | no |
35-
| <a name="input_asg_iam_instance_profile_arn"></a> [asg\_iam\_instance\_profile\_arn](#input\_asg\_iam\_instance\_profile\_arn) | The IAM Instance Profile ARN to launch the instance with | `string` | `null` | no |
36-
| <a name="input_asg_ignore_desired_capacity_changes"></a> [asg\_ignore\_desired\_capacity\_changes](#input\_asg\_ignore\_desired\_capacity\_changes) | Determines whether the `desired_capacity` value is ignored after initial apply. See README note for more details | `bool` | `true` | no |
37-
| <a name="input_asg_image_id"></a> [asg\_image\_id](#input\_asg\_image\_id) | The AMI from which to launch the instance | `string` | `""` | no |
38-
| <a name="input_asg_instance_market_options"></a> [asg\_instance\_market\_options](#input\_asg\_instance\_market\_options) | The market (purchasing) option for the instance | `any` | `null` | no |
39-
| <a name="input_asg_instance_name"></a> [asg\_instance\_name](#input\_asg\_instance\_name) | Name that is propogated to launched EC2 instances via a tag - if not provided, defaults to `var.name` | `string` | `""` | no |
40-
| <a name="input_asg_instance_type"></a> [asg\_instance\_type](#input\_asg\_instance\_type) | The type of the instance to launch | `string` | `"t2.micro"` | no |
41-
| <a name="input_asg_launch_template_description"></a> [asg\_launch\_template\_description](#input\_asg\_launch\_template\_description) | Description of the launch template | `string` | `null` | no |
42-
| <a name="input_asg_max_size"></a> [asg\_max\_size](#input\_asg\_max\_size) | The maximum size of the autoscaling group | `number` | `null` | no |
43-
| <a name="input_asg_min_size"></a> [asg\_min\_size](#input\_asg\_min\_size) | The minimum size of the autoscaling group | `number` | `null` | no |
44-
| <a name="input_asg_name"></a> [asg\_name](#input\_asg\_name) | Name of ASG resource | `string` | `""` | no |
45-
| <a name="input_asg_network_interface_security_groups"></a> [asg\_network\_interface\_security\_groups](#input\_asg\_network\_interface\_security\_groups) | A list of security group IDs to associate | `list(string)` | `null` | no |
46-
| <a name="input_asg_placement"></a> [asg\_placement](#input\_asg\_placement) | The placement of the instance | `map(string)` | `null` | no |
47-
| <a name="input_asg_protect_from_scale_in"></a> [asg\_protect\_from\_scale\_in](#input\_asg\_protect\_from\_scale\_in) | Allows setting instance protection. The autoscaling group will not select instances with this setting for termination during scale in events. | `bool` | `false` | no |
48-
| <a name="input_asg_subnets"></a> [asg\_subnets](#input\_asg\_subnets) | A list of subnet IDs to launch resources in. Subnets automatically determine which availability zones the group will reside. Conflicts with `availability_zones` | `list(string)` | `null` | no |
49-
| <a name="input_asg_user_data_base64"></a> [asg\_user\_data\_base64](#input\_asg\_user\_data\_base64) | The Base64-encoded user data to provide when launching the instance | `string` | `null` | no |
50-
| <a name="input_asg_volume_size"></a> [asg\_volume\_size](#input\_asg\_volume\_size) | Specify the volume size for the root ebs | `string` | `30` | no |
51-
| <a name="input_asg_wait_for_capacity_timeout"></a> [asg\_wait\_for\_capacity\_timeout](#input\_asg\_wait\_for\_capacity\_timeout) | A maximum duration that Terraform should wait for ASG instances to be healthy before timing out. (See also Waiting for Capacity below.) Setting this to '0' causes Terraform to skip all Capacity Waiting behavior. | `string` | `null` | no |
52-
| <a name="input_assign_public_ip"></a> [assign\_public\_ip](#input\_assign\_public\_ip) | Enable a public IP address for the container | `bool` | `false` | no |
53-
| <a name="input_create_launch_template"></a> [create\_launch\_template](#input\_create\_launch\_template) | Create a launch template | `bool` | `true` | no |
54-
| <a name="input_enable_execute_command"></a> [enable\_execute\_command](#input\_enable\_execute\_command) | Specifies whether to enable Amazon ECS Exec for the tasks within the service | `bool` | `false` | no |
55-
| <a name="input_launch_type"></a> [launch\_type](#input\_launch\_type) | The launch type on which to run your task.(EC2\|FARGATE) | `string` | `"EC2"` | no |
56-
| <a name="input_link_ecs_to_asg_capacity_provider"></a> [link\_ecs\_to\_asg\_capacity\_provider](#input\_link\_ecs\_to\_asg\_capacity\_provider) | Specify whether to link ECS to autoscaling group capacity provider | `bool` | `false` | no |
57-
| <a name="input_name"></a> [name](#input\_name) | Name of the product/project/application | `string` | `""` | no |
58-
| <a name="input_platform_version"></a> [platform\_version](#input\_platform\_version) | Platform version (applicable for FARGATE launch type) | `string` | `"LATEST"` | no |
59-
| <a name="input_service_deployment_maximum_percent"></a> [service\_deployment\_maximum\_percent](#input\_service\_deployment\_maximum\_percent) | 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. Not valid when using the DAEMON scheduling strategy. | `number` | `200` | no |
60-
| <a name="input_service_deployment_minimum_healthy_percent"></a> [service\_deployment\_minimum\_healthy\_percent](#input\_service\_deployment\_minimum\_healthy\_percent) | 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. | `number` | `100` | no |
61-
| <a name="input_service_map"></a> [service\_map](#input\_service\_map) | A map of services to deploy | `map(any)` | `{}` | no |
62-
| <a name="input_service_max_capacity"></a> [service\_max\_capacity](#input\_service\_max\_capacity) | Maximum capacity of ECS autoscaling target, cannot be less than min\_capacity | `number` | `4` | no |
63-
| <a name="input_service_min_capacity"></a> [service\_min\_capacity](#input\_service\_min\_capacity) | Minimum capacity of ECS autoscaling target, cannot be more than max\_capacity | `number` | `1` | no |
64-
| <a name="input_service_scale_in_cooldown"></a> [service\_scale\_in\_cooldown](#input\_service\_scale\_in\_cooldown) | Time between scale in action | `number` | `300` | no |
65-
| <a name="input_service_scale_out_cooldown"></a> [service\_scale\_out\_cooldown](#input\_service\_scale\_out\_cooldown) | Time between scale out action | `number` | `300` | no |
66-
| <a name="input_service_security_groups"></a> [service\_security\_groups](#input\_service\_security\_groups) | Security group IDs to attach to your ECS Service | `list(string)` | `[]` | no |
67-
| <a name="input_service_subnets"></a> [service\_subnets](#input\_service\_subnets) | Private subnets for ECS | `list(string)` | `[]` | no |
68-
| <a name="input_service_target_cpu_value"></a> [service\_target\_cpu\_value](#input\_service\_target\_cpu\_value) | Autoscale when CPU Usage value over the specified value. Must be specified if `enable_cpu_based_autoscaling` is `true`. | `number` | `70` | no |
69-
| <a name="input_service_task_execution_role_arn"></a> [service\_task\_execution\_role\_arn](#input\_service\_task\_execution\_role\_arn) | Default IAM role for ECS execution | `string` | `""` | no |
70-
| <a name="input_service_task_role_arn"></a> [service\_task\_role\_arn](#input\_service\_task\_role\_arn) | Default IAM role for ECS task | `string` | `""` | no |
71-
72-
## Outputs
73-
74-
| Name | Description |
75-
|------|-------------|
76-
| <a name="output_aws_ecs_task_definition"></a> [aws\_ecs\_task\_definition](#output\_aws\_ecs\_task\_definition) | ARN of the ECS service |
77-
| <a name="output_ecs_cloudwatch_log_group_arn"></a> [ecs\_cloudwatch\_log\_group\_arn](#output\_ecs\_cloudwatch\_log\_group\_arn) | The cloudwatch log group to be used by the cluster |
78-
| <a name="output_ecs_cloudwatch_log_group_name"></a> [ecs\_cloudwatch\_log\_group\_name](#output\_ecs\_cloudwatch\_log\_group\_name) | The cloudwatch log group to be used by the cluster |
79-
| <a name="output_ecs_cluster_arn"></a> [ecs\_cluster\_arn](#output\_ecs\_cluster\_arn) | ARN of the ECS Cluster |
80-
| <a name="output_ecs_cluster_id"></a> [ecs\_cluster\_id](#output\_ecs\_cluster\_id) | ID of the ECS Cluster |
81-
| <a name="output_ecs_cluster_kms_arn"></a> [ecs\_cluster\_kms\_arn](#output\_ecs\_cluster\_kms\_arn) | The AWS Key Management Service key ID to encrypt the data between the local client and the container |
82-
| <a name="output_ecs_cluster_name"></a> [ecs\_cluster\_name](#output\_ecs\_cluster\_name) | The name of the ECS cluster |
83-
| <a name="output_ecs_service_arn"></a> [ecs\_service\_arn](#output\_ecs\_service\_arn) | ARN of the ECS service |
84-
| <a name="output_ecs_service_name"></a> [ecs\_service\_name](#output\_ecs\_service\_name) | The name of the ECS service |
85-
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
86-
87-
<!-- BEGIN_TF_DOCS -->
88-
## Requirements
89-
90-
| Name | Version |
91-
|------|---------|
92-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
93-
94-
## Providers
95-
96-
No providers.
97-
98-
## Modules
99-
100-
| Name | Source | Version |
101-
|------|--------|---------|
102-
| <a name="module_autoscaling_group"></a> [autoscaling\_group](#module\_autoscaling\_group) | ./modules/autoscaling-group | n/a |
103-
| <a name="module_cluster"></a> [cluster](#module\_cluster) | ./modules/cluster | n/a |
104-
| <a name="module_service"></a> [service](#module\_service) | ./modules/service | n/a |
105-
| <a name="module_service_cpu_autoscaling_policy"></a> [service\_cpu\_autoscaling\_policy](#module\_service\_cpu\_autoscaling\_policy) | ./modules/autoscaling-policy | n/a |
106-
107-
## Resources
108-
109-
No resources.
110-
111-
## Inputs
112-
11327
| Name | Description | Type | Default | Required |
11428
|------|-------------|------|---------|:--------:|
11529
| <a name="input_asg_create"></a> [asg\_create](#input\_asg\_create) | Specify whether to create ASG resource | `bool` | `false` | no |
@@ -169,4 +83,4 @@ No resources.
16983
| <a name="output_ecs_cluster_name"></a> [ecs\_cluster\_name](#output\_ecs\_cluster\_name) | The name of the ECS cluster |
17084
| <a name="output_ecs_service_arn"></a> [ecs\_service\_arn](#output\_ecs\_service\_arn) | ARN of the ECS service |
17185
| <a name="output_ecs_service_name"></a> [ecs\_service\_name](#output\_ecs\_service\_name) | The name of the ECS service |
172-
<!-- END_TF_DOCS -->
86+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/ec2/README.MD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
| Name | Version |
1313
|------|---------|
14-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.36.1 |
15-
| <a name="provider_local"></a> [local](#provider\_local) | 2.2.3 |
14+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.67.0 |
15+
| <a name="provider_local"></a> [local](#provider\_local) | 2.4.1 |
1616

1717
## Modules
1818

examples/fargate/README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
| Name | Version |
1212
|------|---------|
13-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.45.0 |
13+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.67.0 |
1414

1515
## Modules
1616

main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ module "service" {
6060

6161
deployment_maximum_percent = lookup(each.value, "deployment_maximum_percent", var.service_deployment_maximum_percent)
6262
deployment_minimum_healthy_percent = lookup(each.value, "deployment_minimum_healthy_percent", var.service_deployment_minimum_healthy_percent)
63+
deployment_circuit_breaker = lookup(each.value, "deployment_circuit_breaker", { enable = false })
6364

64-
ecs_load_balancers = lookup(each.value, "ecs_load_balancers", [])
65+
ecs_load_balancers = lookup(each.value, "ecs_load_balancers", [])
66+
health_check_grace_period_seconds = lookup(each.value, "health_check_grace_period_seconds", null)
6567

6668
docker_volumes = try(each.value.docker_volumes, [])
6769
efs_volumes = try(each.value.efs_volumes, [])

0 commit comments

Comments
 (0)