Skip to content

Commit 8329c8e

Browse files
authored
Lock minimum version of provider and add force_new_deployment (#18)
* Add support for force_new_deployment and minimum provider version * update readme
1 parent 8903a6f commit 8329c8e

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
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.0.1
3+
rev: v3.1.0
44
hooks:
55
- id: check-added-large-files
66
args: ['--maxkb=500']

README.md

Lines changed: 7 additions & 4 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 `~> v2.0`. Submit pull-requests to `master` branch.
7+
Terraform 0.12. Pin module version to `~> v3.0`. Submit pull-requests to `master` branch.
88

99
## Usage
1010

@@ -28,7 +28,7 @@ resource "aws_ecs_cluster" "cluster" {
2828
2929
module "ecs-farage" {
3030
source = "umotif-public/ecs-fargate/aws"
31-
version = "~> 2.0.0"
31+
version = "~> 3.0.0"
3232
3333
name_prefix = "ecs-fargate-example"
3434
vpc_id = "vpc-abasdasd132"
@@ -73,13 +73,15 @@ Module managed by [Marcin Cuber](https://github.com/marcincuber) [LinkedIn](http
7373
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
7474
## Requirements
7575

76-
No requirements.
76+
| Name | Version |
77+
|------|---------|
78+
| aws | ~> 2.63 |
7779

7880
## Providers
7981

8082
| Name | Version |
8183
|------|---------|
82-
| aws | n/a |
84+
| aws | ~> 2.63 |
8385
| null | n/a |
8486

8587
## Inputs
@@ -94,6 +96,7 @@ No requirements.
9496
| deployment\_maximum\_percent | The upper limit of the number of running tasks that can be running in a service during a deployment | `number` | `200` | no |
9597
| deployment\_minimum\_healthy\_percent | The lower limit of the number of running tasks that must remain running and healthy in a service during a deployment | `number` | `50` | no |
9698
| desired\_count | The number of instances of the task definitions to place and keep running. | `number` | `1` | no |
99+
| force\_new\_deployment | Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g. myimage:latest), roll Fargate tasks onto a newer platform version. | `bool` | `false` | no |
97100
| health\_check | A health block containing health check settings for the target group. Overrides the defaults. | `map(string)` | n/a | yes |
98101
| health\_check\_grace\_period\_seconds | Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 7200. Only valid for services configured to use load balancers. | `number` | `300` | no |
99102
| lb\_arn | Arn for the LB for which the service should be attach to. | `string` | n/a | yes |

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ resource "aws_ecs_service" "service" {
264264
platform_version = var.platform_version
265265
launch_type = length(var.capacity_provider_strategy) == 0 ? "FARGATE" : null
266266

267+
force_new_deployment = var.force_new_deployment
268+
267269
deployment_minimum_healthy_percent = var.deployment_minimum_healthy_percent
268270
deployment_maximum_percent = var.deployment_maximum_percent
269271
health_check_grace_period_seconds = var.load_balanced ? var.health_check_grace_period_seconds : null

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,9 @@ variable "task_mount_points" {
259259
default = null
260260
}
261261

262+
variable "force_new_deployment" {
263+
type = bool
264+
description = "Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g. myimage:latest), roll Fargate tasks onto a newer platform version."
265+
default = false
266+
}
267+

versions.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
terraform {
2+
required_providers {
3+
aws = "~> 2.63"
4+
}
5+
}

0 commit comments

Comments
 (0)