diff --git a/README.md b/README.md
index 4566af0..d65adbc 100644
--- a/README.md
+++ b/README.md
@@ -213,13 +213,13 @@ Available targets:
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 0.14.0 |
-| [aws](#requirement\_aws) | >= 4.59 |
+| [aws](#requirement\_aws) | >= 5.37 |
## Providers
| Name | Version |
|------|---------|
-| [aws](#provider\_aws) | >= 4.59 |
+| [aws](#provider\_aws) | >= 5.37 |
## Modules
@@ -345,6 +345,7 @@ Available targets:
| [task\_policy\_arns\_map](#input\_task\_policy\_arns\_map) | A map of name to IAM Policy ARNs to attach to the generated task role.
The names are arbitrary, but must be known at plan time. The purpose of the name
is so that changes to one ARN do not cause a ripple effect on the other ARNs.
If you cannot provide unique names known at plan time, use `task_policy_arns` instead. | `map(string)` | `{}` | no |
| [task\_role\_arn](#input\_task\_role\_arn) | A `list(string)` of zero or one ARNs of IAM roles that allows
your Amazon ECS container task to make calls to other AWS services.
If the list is empty, a role will be created for you.
DEPRECATED: you can also pass a `string` with the ARN, but that
string must be known a "plan" time. | `any` | `[]` | no |
| [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
+| [track\_latest](#input\_track\_latest) | Whether should track latest task definition or the one created with the resource. | `bool` | `false` | no |
| [use\_alb\_security\_group](#input\_use\_alb\_security\_group) | A flag to enable/disable allowing traffic from the ALB security group to the service security group | `bool` | `false` | no |
| [use\_nlb\_cidr\_blocks](#input\_use\_nlb\_cidr\_blocks) | A flag to enable/disable adding the NLB ingress rule to the service security group | `bool` | `false` | no |
| [use\_old\_arn](#input\_use\_old\_arn) | A flag to enable/disable tagging the ecs resources that require the new arn format | `bool` | `false` | no |
diff --git a/docs/terraform.md b/docs/terraform.md
index be2747b..fedbfa9 100644
--- a/docs/terraform.md
+++ b/docs/terraform.md
@@ -4,13 +4,13 @@
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 0.14.0 |
-| [aws](#requirement\_aws) | >= 4.59 |
+| [aws](#requirement\_aws) | >= 5.37 |
## Providers
| Name | Version |
|------|---------|
-| [aws](#provider\_aws) | >= 4.59 |
+| [aws](#provider\_aws) | >= 5.37 |
## Modules
@@ -136,6 +136,7 @@
| [task\_policy\_arns\_map](#input\_task\_policy\_arns\_map) | A map of name to IAM Policy ARNs to attach to the generated task role.
The names are arbitrary, but must be known at plan time. The purpose of the name
is so that changes to one ARN do not cause a ripple effect on the other ARNs.
If you cannot provide unique names known at plan time, use `task_policy_arns` instead. | `map(string)` | `{}` | no |
| [task\_role\_arn](#input\_task\_role\_arn) | A `list(string)` of zero or one ARNs of IAM roles that allows
your Amazon ECS container task to make calls to other AWS services.
If the list is empty, a role will be created for you.
DEPRECATED: you can also pass a `string` with the ARN, but that
string must be known a "plan" time. | `any` | `[]` | no |
| [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no |
+| [track\_latest](#input\_track\_latest) | Whether should track latest task definition or the one created with the resource. | `bool` | `false` | no |
| [use\_alb\_security\_group](#input\_use\_alb\_security\_group) | A flag to enable/disable allowing traffic from the ALB security group to the service security group | `bool` | `false` | no |
| [use\_nlb\_cidr\_blocks](#input\_use\_nlb\_cidr\_blocks) | A flag to enable/disable adding the NLB ingress rule to the service security group | `bool` | `false` | no |
| [use\_old\_arn](#input\_use\_old\_arn) | A flag to enable/disable tagging the ecs resources that require the new arn format | `bool` | `false` | no |
diff --git a/main.tf b/main.tf
index 0cd1864..1ef4585 100644
--- a/main.tf
+++ b/main.tf
@@ -68,6 +68,7 @@ resource "aws_ecs_task_definition" "default" {
pid_mode = var.pid_mode
execution_role_arn = length(local.task_exec_role_arn) > 0 ? local.task_exec_role_arn : one(aws_iam_role.ecs_exec[*]["arn"])
task_role_arn = length(local.task_role_arn) > 0 ? local.task_role_arn : one(aws_iam_role.ecs_task[*]["arn"])
+ track_latest = var.track_latest
dynamic "proxy_configuration" {
for_each = var.proxy_configuration == null ? [] : [var.proxy_configuration]
diff --git a/variables.tf b/variables.tf
index 4d8f3ab..4541808 100644
--- a/variables.tf
+++ b/variables.tf
@@ -582,3 +582,9 @@ variable "pid_mode" {
error_message = "The pid_mode value must be one of host or task."
}
}
+
+variable "track_latest" {
+ type = bool
+ description = "Whether should track latest task definition or the one created with the resource."
+ default = false
+}
\ No newline at end of file
diff --git a/versions.tf b/versions.tf
index 4507648..f33805c 100644
--- a/versions.tf
+++ b/versions.tf
@@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
- version = ">= 4.59"
+ version = ">= 5.37"
}
}
}