Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.14 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.21 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.14 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.21 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 6.14"
version = ">= 6.21"
}
}
}
2 changes: 1 addition & 1 deletion examples/container-definition/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.14 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.21 |
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.2 |

## Providers
Expand Down
2 changes: 1 addition & 1 deletion examples/container-definition/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 6.14"
version = ">= 6.21"
}
null = {
source = "hashicorp/null"
Expand Down
4 changes: 2 additions & 2 deletions examples/ec2-autoscaling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.14 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.21 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.14 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.21 |

## Modules

Expand Down
2 changes: 1 addition & 1 deletion examples/ec2-autoscaling/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 6.14"
version = ">= 6.21"
}
}
}
4 changes: 2 additions & 2 deletions examples/fargate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ Note that this example may create resources which will incur monetary charges on
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.14 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.21 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.14 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.21 |

## Modules

Expand Down
12 changes: 12 additions & 0 deletions examples/fargate/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ module "ecs_service" {
# lifecycle_stages = ["TEST_TRAFFIC_SHIFT", "POST_PRODUCTION_TRAFFIC_SHIFT"]
# }
# }

# # Example config using linear deployment strategy
# linear_configuration {
# step_percent = 25.0
# step_bake_time_in_minutes = 5
# }

# # Example config using canary deployment strategy
# canary_configuration {
# canary_percent = 10.0
# canary_bake_time_in_minutes = 5
# }
}

# Container definition(s)
Expand Down
2 changes: 1 addition & 1 deletion examples/fargate/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 6.14"
version = ">= 6.21"
}
}
}
2 changes: 1 addition & 1 deletion modules/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ module "ecs_service" {
| <a name="input_create_task_exec_policy"></a> [create\_task\_exec\_policy](#input\_create\_task\_exec\_policy) | Determines whether the ECS task definition IAM policy should be created. This includes permissions included in AmazonECSTaskExecutionRolePolicy as well as access to secrets and SSM parameters | `bool` | `true` | no |
| <a name="input_create_tasks_iam_role"></a> [create\_tasks\_iam\_role](#input\_create\_tasks\_iam\_role) | Determines whether the ECS tasks IAM role should be created | `bool` | `true` | no |
| <a name="input_deployment_circuit_breaker"></a> [deployment\_circuit\_breaker](#input\_deployment\_circuit\_breaker) | Configuration block for deployment circuit breaker | <pre>object({<br/> enable = bool<br/> rollback = bool<br/> })</pre> | `null` | no |
| <a name="input_deployment_configuration"></a> [deployment\_configuration](#input\_deployment\_configuration) | Configuration block for deployment settings | <pre>object({<br/> strategy = optional(string)<br/> bake_time_in_minutes = optional(string)<br/> lifecycle_hook = optional(map(object({<br/> hook_target_arn = string<br/> role_arn = string<br/> lifecycle_stages = list(string)<br/> hook_details = optional(string)<br/> })))<br/> })</pre> | `null` | no |
| <a name="input_deployment_configuration"></a> [deployment\_configuration](#input\_deployment\_configuration) | Configuration block for deployment settings | <pre>object({<br/> strategy = optional(string)<br/> bake_time_in_minutes = optional(string)<br/> lifecycle_hook = optional(map(object({<br/> hook_target_arn = string<br/> role_arn = string<br/> lifecycle_stages = list(string)<br/> hook_details = optional(string)<br/> })))<br/> canary_configuration = optional(map(object({<br/> canary_percent = string<br/> canary_bake_time_in_minutes = optional(string)<br/> })))<br/> linear_configuration = optional(map(object({<br/> step_percent = string<br/> step_bake_time_in_minutes = optional(string)<br/> })))<br/> })</pre> | `null` | no |
| <a name="input_deployment_controller"></a> [deployment\_controller](#input\_deployment\_controller) | Configuration block for deployment controller configuration | <pre>object({<br/> type = optional(string)<br/> })</pre> | `null` | no |
| <a name="input_deployment_maximum_percent"></a> [deployment\_maximum\_percent](#input\_deployment\_maximum\_percent) | Upper limit (as a percentage of the service's `desired_count`) of the number of running tasks that can be running in a service during a deployment | `number` | `200` | no |
| <a name="input_deployment_minimum_healthy_percent"></a> [deployment\_minimum\_healthy\_percent](#input\_deployment\_minimum\_healthy\_percent) | Lower limit (as a percentage of the service's `desired_count`) of the number of running tasks that must remain running and healthy in a service during a deployment | `number` | `66` | no |
Expand Down
18 changes: 18 additions & 0 deletions modules/service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,24 @@ resource "aws_ecs_service" "this" {
hook_details = lifecycle_hook.value.hook_details
}
}

dynamic "canary_configuration" {
for_each = deployment_configuration.value.canary_configuration != null ? deployment_configuration.value.canary_configuration : {}

content {
canary_percent = canary_configuration.value.canary_percent
canary_bake_time_in_minutes = canary_configuration.value.canary_bake_time_in_minutes
}
}

dynamic "linear_configuration" {
for_each = deployment_configuration.value.linear_configuration != null ? deployment_configuration.value.linear_configuration : {}

content {
step_percent = linear_configuration.value.step_percent
step_bake_time_in_minutes = linear_configuration.value.step_bake_time_in_minutes
}
}
}
}

Expand Down
8 changes: 8 additions & 0 deletions modules/service/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ variable "deployment_configuration" {
lifecycle_stages = list(string)
hook_details = optional(string)
})))
canary_configuration = optional(map(object({
canary_percent = string
canary_bake_time_in_minutes = optional(string)
})))
linear_configuration = optional(map(object({
step_percent = string
step_bake_time_in_minutes = optional(string)
})))
})
default = null
}
Expand Down
8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@ variable "services" {
lifecycle_stages = list(string)
hook_details = optional(string)
})))
canary_configuration = optional(map(object({
canary_percent = string
canary_bake_time_in_minutes = optional(string)
})))
linear_configuration = optional(map(object({
step_percent = string
step_bake_time_in_minutes = optional(string)
})))
}))
deployment_controller = optional(object({
type = optional(string)
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 6.14"
version = ">= 6.21"
}
}
}
2 changes: 1 addition & 1 deletion wrappers/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 6.14"
version = ">= 6.21"
}
}
}