Skip to content

Commit cf68252

Browse files
authored
Upgrades (#24)
1 parent 4176153 commit cf68252

File tree

9 files changed

+61
-30
lines changed

9 files changed

+61
-30
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.2.0
3+
rev: v3.3.0
44
hooks:
55
- id: check-added-large-files
66
args: ['--maxkb=500']
@@ -18,7 +18,7 @@ repos:
1818
args: ['--allow-missing-credentials']
1919
- id: trailing-whitespace
2020
- repo: git://github.com/antonbabenko/pre-commit-terraform
21-
rev: v1.31.0
21+
rev: v1.44.0
2222
hooks:
2323
- id: terraform_fmt
2424
- id: terraform_docs

CHANGELOG.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,25 @@ All notable changes to this project will be documented in this file.
55
<a name="unreleased"></a>
66
## [Unreleased]
77

8-
- Update module versions to support v3 provider
8+
- Add upgrades
9+
10+
11+
<a name="4.0.3"></a>
12+
## [4.0.3] - 2020-10-13
13+
14+
- Update main.tf ([#23](https://github.com/umotif-public/terraform-aws-ecs-fargate/issues/23))
15+
16+
17+
<a name="4.0.2"></a>
18+
## [4.0.2] - 2020-10-02
19+
20+
- Fix log group permissions ([#22](https://github.com/umotif-public/terraform-aws-ecs-fargate/issues/22))
21+
22+
23+
<a name="4.0.1"></a>
24+
## [4.0.1] - 2020-08-05
25+
26+
- Feature/v3 provider support ([#21](https://github.com/umotif-public/terraform-aws-ecs-fargate/issues/21))
927

1028

1129
<a name="4.0.0"></a>
@@ -137,7 +155,10 @@ All notable changes to this project will be documented in this file.
137155
- Initial commit
138156

139157

140-
[Unreleased]: https://github.com/umotif-public/terraform-aws-ecs-fargate/compare/4.0.0...HEAD
158+
[Unreleased]: https://github.com/umotif-public/terraform-aws-ecs-fargate/compare/4.0.3...HEAD
159+
[4.0.3]: https://github.com/umotif-public/terraform-aws-ecs-fargate/compare/4.0.2...4.0.3
160+
[4.0.2]: https://github.com/umotif-public/terraform-aws-ecs-fargate/compare/4.0.1...4.0.2
161+
[4.0.1]: https://github.com/umotif-public/terraform-aws-ecs-fargate/compare/4.0.0...4.0.1
141162
[4.0.0]: https://github.com/umotif-public/terraform-aws-ecs-fargate/compare/3.0.2...4.0.0
142163
[3.0.2]: https://github.com/umotif-public/terraform-aws-ecs-fargate/compare/3.0.1...3.0.2
143164
[3.0.1]: https://github.com/umotif-public/terraform-aws-ecs-fargate/compare/3.0.0...3.0.1

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Terraform module to create AWS ECS FARGATE services. Module support both FARGATE
44

55
## Terraform versions
66

7-
Terraform 0.12. Pin module version to `~> v4.0`. Submit pull-requests to `master` branch.
7+
Terraform 0.13. Pin module version to `~> v5.0`. Submit pull-requests to `master` branch.
88

99
## Usage
1010

@@ -28,7 +28,7 @@ resource "aws_ecs_cluster" "cluster" {
2828
2929
module "ecs-fargate" {
3030
source = "umotif-public/ecs-fargate/aws"
31-
version = "~> 4.0.0"
31+
version = "~> 5.0.0"
3232
3333
name_prefix = "ecs-fargate-example"
3434
vpc_id = "vpc-abasdasd132"
@@ -58,7 +58,7 @@ module "ecs-fargate" {
5858

5959
## Assumptions
6060

61-
Module is to be used with Terraform > 0.12.
61+
Module is to be used with Terraform > 0.13.
6262

6363
## Examples
6464

@@ -75,15 +75,14 @@ Module managed by [Marcin Cuber](https://github.com/marcincuber) [LinkedIn](http
7575

7676
| Name | Version |
7777
|------|---------|
78-
| terraform | >= 0.12.6, < 0.14 |
79-
| aws | >= 2.68, < 4.0 |
78+
| terraform | >= 0.13.0 |
79+
| aws | >= 3.13 |
8080

8181
## Providers
8282

8383
| Name | Version |
8484
|------|---------|
85-
| aws | >= 2.68, < 4.0 |
86-
| null | n/a |
85+
| aws | >= 3.13 |
8786

8887
## Inputs
8988

@@ -135,6 +134,7 @@ Module managed by [Marcin Cuber](https://github.com/marcincuber) [LinkedIn](http
135134
| task\_stop\_timeout | Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. The max stop timeout value is 120 seconds and if the parameter is not specified, the default value of 30 seconds is used. | `number` | `null` | no |
136135
| volume | (Optional) A set of volume blocks that containers in your task may use. This is a list of maps, where each map should contain "name", "host\_path", "docker\_volume\_configuration" and "efs\_volume\_configuration". Full set of options can be found at https://www.terraform.io/docs/providers/aws/r/ecs_task_definition.html | `list` | `[]` | no |
137136
| vpc\_id | The VPC ID. | `string` | n/a | yes |
137+
| wait\_for\_steady\_state | If true, Terraform will wait for the service to reach a steady state (like aws ecs wait services-stable) before continuing. | `bool` | `false` | no |
138138

139139
## Outputs
140140

examples/core/main.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ provider "aws" {
77
#####
88
module "vpc" {
99
source = "terraform-aws-modules/vpc/aws"
10-
version = "~> 2.32"
10+
version = "~> 2.63"
1111

1212
name = "simple-vpc"
1313

@@ -98,6 +98,8 @@ module "fargate" {
9898
lb_arn = module.alb.arn
9999
cluster_id = aws_ecs_cluster.cluster.id
100100

101+
wait_for_steady_state = true
102+
101103
platform_version = "1.4.0" # defaults to LATEST
102104

103105
task_container_image = "marcincuber/2048-game:latest"
@@ -114,6 +116,10 @@ module "fargate" {
114116

115117
task_stop_timeout = 90
116118

119+
depends_on = [
120+
module.alb
121+
]
122+
117123
### To use task credentials, below paramaters are required
118124
# create_repository_credentials_iam_policy = false
119125
# repository_credentials = aws_secretsmanager_secret.task_credentials.arn

examples/fargate-efs/main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ provider "aws" {
77
#####
88
module "vpc" {
99
source = "terraform-aws-modules/vpc/aws"
10-
version = "~> 2.21"
10+
version = "~> 2.63"
1111

1212
name = "simple-vpc"
1313

@@ -146,4 +146,8 @@ module "fargate" {
146146
]
147147
}
148148
]
149+
150+
depends_on = [
151+
module.alb
152+
]
149153
}

examples/fargate-spot/main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ provider "aws" {
77
#####
88
module "vpc" {
99
source = "terraform-aws-modules/vpc/aws"
10-
version = "~> 2.21"
10+
version = "~> 2.63"
1111

1212
name = "simple-vpc"
1313

@@ -111,4 +111,8 @@ module "fargate" {
111111
weight = 100
112112
}
113113
]
114+
115+
depends_on = [
116+
module.alb
117+
]
114118
}

main.tf

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,14 @@ resource "aws_security_group_rule" "egress_service" {
8080
# Load Balancer Target group
8181
#####
8282
resource "aws_lb_target_group" "task" {
83-
count = var.load_balanced ? 1 : 0
83+
count = var.load_balanced ? 1 : 0
84+
8485
name = var.target_group_name != "" ? var.target_group_name : "${var.name_prefix}-target-${var.task_container_port}"
8586
vpc_id = var.vpc_id
8687
protocol = var.task_container_protocol
8788
port = var.task_container_port
8889
target_type = "ip"
90+
8991
dynamic "health_check" {
9092
for_each = [var.health_check]
9193
content {
@@ -274,7 +276,8 @@ resource "aws_ecs_service" "service" {
274276
platform_version = var.platform_version
275277
launch_type = length(var.capacity_provider_strategy) == 0 ? "FARGATE" : null
276278

277-
force_new_deployment = var.force_new_deployment
279+
force_new_deployment = var.force_new_deployment
280+
wait_for_steady_state = var.wait_for_steady_state
278281

279282
deployment_minimum_healthy_percent = var.deployment_minimum_healthy_percent
280283
deployment_maximum_percent = var.deployment_maximum_percent
@@ -323,16 +326,4 @@ resource "aws_ecs_service" "service" {
323326
Name = "${var.name_prefix}-service"
324327
},
325328
)
326-
327-
depends_on = [null_resource.lb_exists]
328-
}
329-
330-
# HACK: The workaround used in ecs/service does not work for some reason in this module, this fixes the following error:
331-
# "The target group with targetGroupArn arn:aws:elasticloadbalancing:... does not have an associated load balancer."
332-
# see https://github.com/hashicorp/terraform/issues/12634.
333-
# Service depends on this resources which prevents it from being created until the LB is ready
334-
resource "null_resource" "lb_exists" {
335-
triggers = {
336-
alb_name = var.lb_arn
337-
}
338329
}

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,8 @@ variable "force_new_deployment" {
264264
default = false
265265
}
266266

267+
variable "wait_for_steady_state" {
268+
type = bool
269+
description = "If true, Terraform will wait for the service to reach a steady state (like aws ecs wait services-stable) before continuing."
270+
default = false
271+
}

versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
2-
required_version = ">= 0.12.6, < 0.14"
2+
required_version = ">= 0.13.0"
33

44
required_providers {
5-
aws = ">= 2.68, < 4.0"
5+
aws = ">= 3.13"
66
}
77
}

0 commit comments

Comments
 (0)