Skip to content

Commit

Permalink
chore: upgrade to 5.x compatibility + documentation (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdul Wahid authored Jul 26, 2023
1 parent f9e3259 commit 0c2e424
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 38 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.4.0
hooks:
- id: check-added-large-files
args: ['--maxkb=500']
- id: check-executables-have-shebangs
- id: pretty-format-json
args: ['--autofix', '--no-sort-keys', '--indent=2']
- id: check-byte-order-marker
- id: fix-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
Expand All @@ -17,9 +17,9 @@ repos:
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: trailing-whitespace
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.50.0
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.81.0
hooks:
- id: terraform_fmt
- id: terraform_docs
- id: terraform_tflint
- id: terraform_tflint
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ All notable changes to this project will be documented in this file.



<a name="2.1.2"></a>
## [2.1.2] - 2021-07-16

- 'task_container_working_directory' encoded with jsonencode function ([#16](https://github.com/umotif-public/terraform-aws-ecs-fargate-task-definition/issues/16))


<a name="2.1.1"></a>
## [2.1.1] - 2021-04-21

Expand Down Expand Up @@ -86,7 +92,8 @@ All notable changes to this project will be documented in this file.
- Initial commit


[Unreleased]: https://github.com/umotif-public/terraform-aws-ecs-fargate-task-definition/compare/2.1.1...HEAD
[Unreleased]: https://github.com/umotif-public/terraform-aws-ecs-fargate-task-definition/compare/2.1.2...HEAD
[2.1.2]: https://github.com/umotif-public/terraform-aws-ecs-fargate-task-definition/compare/2.1.1...2.1.2
[2.1.1]: https://github.com/umotif-public/terraform-aws-ecs-fargate-task-definition/compare/2.1.0...2.1.1
[2.1.0]: https://github.com/umotif-public/terraform-aws-ecs-fargate-task-definition/compare/2.0.2...2.1.0
[2.0.2]: https://github.com/umotif-public/terraform-aws-ecs-fargate-task-definition/compare/2.0.1...2.0.2
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ Module managed by [Marcin Cuber](https://github.com/marcincuber) [LinkedIn](http

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.6 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.68 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.11 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.76.1 |

## Providers

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

## Modules

Expand Down Expand Up @@ -109,14 +109,14 @@ No modules.
| <a name="input_task_mount_points"></a> [task\_mount\_points](#input\_task\_mount\_points) | The mount points for data volumes in your container. Each object inside the list requires "sourceVolume", "containerPath" and "readOnly". For more information see https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html | `list(object({ sourceVolume = string, containerPath = string, readOnly = bool }))` | `null` | no |
| <a name="input_task_start_timeout"></a> [task\_start\_timeout](#input\_task\_start\_timeout) | Time duration (in seconds) to wait before giving up on resolving dependencies for a container. If this parameter is not specified, the default value of 3 minutes is used (fargate). | `number` | `null` | no |
| <a name="input_task_stop_timeout"></a> [task\_stop\_timeout](#input\_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 |
| <a name="input_volume"></a> [volume](#input\_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 |
| <a name="input_volume"></a> [volume](#input\_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 | `any` | `[]` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_container_port"></a> [container\_port](#output\_container\_port) | Port on which the container is listening. |
| <a name="output_execution_role_arn"></a> [execution\_role\_arn](#output\_execution\_role\_arn) | The Amazon Resource Name (ARN) of execution role. |
| <a name="output_execution_role_arn"></a> [execution\_role\_arn](#output\_execution\_role\_arn) | The Amazon Resource Name (ARN : null of execution role. |
| <a name="output_execution_role_create_date"></a> [execution\_role\_create\_date](#output\_execution\_role\_create\_date) | The creation date of the IAM role. |
| <a name="output_execution_role_id"></a> [execution\_role\_id](#output\_execution\_role\_id) | The ID of the execution role. |
| <a name="output_execution_role_name"></a> [execution\_role\_name](#output\_execution\_role\_name) | The name of the execution service role. |
Expand Down
25 changes: 25 additions & 0 deletions examples/core/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions examples/core/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
provider "aws" {
region = "eu-west-1"
}

#####
# Optional Secret creation for task credentials
#####
Expand Down Expand Up @@ -31,8 +27,8 @@ module "ecs-task-definition" {
task_container_port = "80"
task_host_port = "80"

task_definition_cpu = "512"
task_definition_memory = "1024"
task_definition_cpu = "256"
task_definition_memory = "512"

task_container_environment = {
"ENVIRONEMNT" = "Test"
Expand Down
14 changes: 14 additions & 0 deletions examples/core/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
provider "aws" {
region = "eu-west-1"
}

terraform {
required_version = "1.0.11"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5"
}
}
}
4 changes: 0 additions & 4 deletions examples/task-efs/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
provider "aws" {
region = "eu-west-1"
}

resource "aws_efs_file_system" "efs" {
creation_token = "efs-html"

Expand Down
14 changes: 14 additions & 0 deletions examples/task-efs/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
provider "aws" {
region = "eu-west-1"
}

terraform {
required_version = "1.0.11"

required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5"
}
}
}
30 changes: 15 additions & 15 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
output "task_role_arn" {
description = "The Amazon Resource Name (ARN) specifying the ECS service role."
value = join("", aws_iam_role.task.*.arn)
value = var.enabled ? aws_iam_role.task[0].arn : null
}

output "task_role_name" {
description = "The name of the Fargate task service role."
value = join("", aws_iam_role.task.*.name)
value = var.enabled ? aws_iam_role.task[0].name : null
}

output "task_role_create_date" {
description = "The creation date of the IAM role."
value = join("", aws_iam_role.task.*.create_date)
value = var.enabled ? aws_iam_role.task[0].create_date : null
}

output "task_role_id" {
description = "The ID of the role."
value = join("", aws_iam_role.task.*.id)
value = var.enabled ? aws_iam_role.task[0].id : null
}

output "task_role_unique_id" {
description = "The stable and unique string identifying the role."
value = join("", aws_iam_role.task.*.unique_id)
value = var.enabled ? aws_iam_role.task[0].unique_id : null
}

output "execution_role_arn" {
description = "The Amazon Resource Name (ARN) of execution role."
value = join("", aws_iam_role.execution.*.arn)
description = "The Amazon Resource Name (ARN : null of execution role."
value = var.enabled ? aws_iam_role.execution[0].arn : null
}

output "execution_role_name" {
description = "The name of the execution service role."
value = join("", aws_iam_role.execution.*.name)
value = var.enabled ? aws_iam_role.execution[0].name : null
}

output "execution_role_create_date" {
description = "The creation date of the IAM role."
value = join("", aws_iam_role.execution.*.create_date)
value = var.enabled ? aws_iam_role.execution[0].create_date : null
}

output "execution_role_id" {
description = "The ID of the execution role."
value = join("", aws_iam_role.execution.*.id)
value = var.enabled ? aws_iam_role.execution[0].id : null
}

output "execution_role_unique_id" {
description = "The stable and unique string identifying the role."
value = join("", aws_iam_role.execution.*.unique_id)
value = var.enabled ? aws_iam_role.execution[0].unique_id : null
}

output "task_definition_arn" {
description = "Full ARN of the Task Definition (including both family and revision)."
value = join("", aws_ecs_task_definition.task.*.arn)
value = var.enabled ? aws_ecs_task_definition.task[0].arn : null
}

output "task_definition_family" {
description = "The family of the Task Definition."
value = join("", aws_ecs_task_definition.task.*.family)
value = var.enabled ? aws_ecs_task_definition.task[0].family : null
}

output "task_definition_revision" {
description = "The revision of the task in a particular family."
value = join("", aws_ecs_task_definition.task.*.revision)
value = var.enabled ? aws_ecs_task_definition.task[0].revision : null
}

output "container_port" {
description = "Port on which the container is listening."
value = var.task_container_port
value = var.enabled ? var.task_container_port : null
}
2 changes: 2 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ variable "repository_credentials_kms_key" {
variable "create_repository_credentials_iam_policy" {
default = false
description = "Set to true if you are specifying `repository_credentials` variable, it will attach IAM policy with necessary permissions to task role."
type = bool
}

variable "placement_constraints" {
Expand All @@ -131,6 +132,7 @@ variable "proxy_configuration" {
variable "volume" {
description = "(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"
default = []
type = any
}

variable "task_health_check" {
Expand Down
8 changes: 6 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
terraform {
required_version = ">= 0.12.6"
required_version = ">= 1.0.11"

required_providers {
aws = ">= 2.68"
aws = {
source = "hashicorp/aws"
version = ">= 3.76.1"
}

}
}

0 comments on commit 0c2e424

Please sign in to comment.