From 60a3aa22edb9977e06f41e5ab6ed2e7e6cdd6446 Mon Sep 17 00:00:00 2001 From: Chris McNabb Date: Fri, 8 Oct 2021 16:18:02 -0400 Subject: [PATCH 1/3] Add vars to use ephemeral storage --- main.tf | 7 +++++++ variables.tf | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/main.tf b/main.tf index 2b7ae08d..7fdba791 100644 --- a/main.tf +++ b/main.tf @@ -609,6 +609,13 @@ resource "aws_ecs_task_definition" "atlantis" { container_definitions = local.container_definitions + dynamic "ephemeral_storage" { + for_each = var.enable_ephemeral_storage ? [1] : [] + content { + size_in_gib = var.ephemeral_storage_size + } + } + tags = local.tags } diff --git a/variables.tf b/variables.tf index c77a0c27..f8a9a589 100644 --- a/variables.tf +++ b/variables.tf @@ -625,3 +625,19 @@ variable "ecs_service_enable_execute_command" { type = bool default = true } + +variable "enable_ephemeral_storage" { + description = "Enable to use Fargate Ephermal Storage" + type = bool + default = false +} +variable "ephemeral_storage_size" { + description = "Size of Ephemeral Storage in GiB" + type = number + default = 21 + + validation { + condition = var.ephemeral_storage_size >= 21 && var.ephemeral_storage_size <= 200 + error_message = "The minimum supported value is 21 GiB and the maximum supported value is 200 GiB." + } +} From c48083cc0d3ff59bda595eea3bad139dbf66a547 Mon Sep 17 00:00:00 2001 From: Chris McNabb Date: Fri, 12 Nov 2021 00:18:14 -0500 Subject: [PATCH 2/3] Requested PR Changes (#7) * Fix variables.tf formatting and update versions.tf files * Update documentation --- README.md | 6 ++++-- examples/github-complete/README.md | 8 ++++---- examples/github-complete/versions.tf | 2 +- examples/github-repository-webhook/README.md | 4 ++-- examples/github-repository-webhook/versions.tf | 2 +- examples/gitlab-repository-webhook/README.md | 4 ++-- examples/gitlab-repository-webhook/versions.tf | 2 +- variables.tf | 1 + versions.tf | 2 +- 9 files changed, 17 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index aca85357..ebe1a03d 100644 --- a/README.md +++ b/README.md @@ -226,14 +226,14 @@ allow_github_webhooks = true | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.1 | -| [aws](#requirement\_aws) | >= 2.68 | +| [aws](#requirement\_aws) | >= 3.45 | | [random](#requirement\_random) | >= 2.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 2.68 | +| [aws](#provider\_aws) | >= 3.45 | | [random](#provider\_random) | >= 2.0 | ## Modules @@ -344,7 +344,9 @@ allow_github_webhooks = true | [ecs\_task\_cpu](#input\_ecs\_task\_cpu) | The number of cpu units used by the task | `number` | `256` | no | | [ecs\_task\_memory](#input\_ecs\_task\_memory) | The amount (in MiB) of memory used by the task | `number` | `512` | no | | [enable\_ecs\_managed\_tags](#input\_enable\_ecs\_managed\_tags) | Specifies whether to enable Amazon ECS managed tags for the tasks within the service | `bool` | `false` | no | +| [enable\_ephemeral\_storage](#input\_enable\_ephemeral\_storage) | Enable to use Fargate Ephermal Storage | `bool` | `false` | no | | [entrypoint](#input\_entrypoint) | The entry point that is passed to the container | `list(string)` | `null` | no | +| [ephemeral\_storage\_size](#input\_ephemeral\_storage\_size) | Size of Ephemeral Storage in GiB | `number` | `21` | no | | [essential](#input\_essential) | Determines whether all other containers in a task are stopped, if this container fails or stops for any reason. Due to how Terraform type casts booleans in json it is required to double quote this value | `bool` | `true` | no | | [external\_task\_definition\_updates](#input\_external\_task\_definition\_updates) | Enable to allow the task definition to be updated outside of this Terraform module. This should be enabled when using a deployment tool such as ecs-deploy which updates the task definition and will then keep the ECS service using the latest version of the task definition. | `bool` | `false` | no | | [extra\_container\_definitions](#input\_extra\_container\_definitions) | A list of valid container definitions provided as a single valid JSON document. These will be provided as supplimentary to the main Atlantis container definition | `list(any)` | `[]` | no | diff --git a/examples/github-complete/README.md b/examples/github-complete/README.md index 4b05b180..c4fdbfb1 100644 --- a/examples/github-complete/README.md +++ b/examples/github-complete/README.md @@ -30,22 +30,22 @@ Go to https://eu-west-1.console.aws.amazon.com/ecs/home?region=eu-west-1#/settin | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.1 | -| [aws](#requirement\_aws) | >= 2.68 | +| [aws](#requirement\_aws) | >= 3.45 | | [github](#requirement\_github) | >= 4.8 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 2.68 | +| [aws](#provider\_aws) | >= 3.45 | ## Modules | Name | Source | Version | |------|--------|---------| -| [atlantis](#module\_atlantis) | ../../ | | +| [atlantis](#module\_atlantis) | ../../ | n/a | | [atlantis\_access\_log\_bucket](#module\_atlantis\_access\_log\_bucket) | terraform-aws-modules/s3-bucket/aws | ~> 2 | -| [github\_repository\_webhook](#module\_github\_repository\_webhook) | ../../modules/github-repository-webhook | | +| [github\_repository\_webhook](#module\_github\_repository\_webhook) | ../../modules/github-repository-webhook | n/a | ## Resources diff --git a/examples/github-complete/versions.tf b/examples/github-complete/versions.tf index abcfe940..28ce680e 100644 --- a/examples/github-complete/versions.tf +++ b/examples/github-complete/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 2.68" + version = ">= 3.45" } github = { diff --git a/examples/github-repository-webhook/README.md b/examples/github-repository-webhook/README.md index f60f7d15..fc9c3373 100644 --- a/examples/github-repository-webhook/README.md +++ b/examples/github-repository-webhook/README.md @@ -22,7 +22,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.1 | -| [aws](#requirement\_aws) | >= 2.68 | +| [aws](#requirement\_aws) | >= 3.45 | | [github](#requirement\_github) | >= 4.8 | ## Providers @@ -35,7 +35,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Source | Version | |------|--------|---------| -| [github\_repository\_webhook](#module\_github\_repository\_webhook) | ../../modules/github-repository-webhook | | +| [github\_repository\_webhook](#module\_github\_repository\_webhook) | ../../modules/github-repository-webhook | n/a | ## Resources diff --git a/examples/github-repository-webhook/versions.tf b/examples/github-repository-webhook/versions.tf index abcfe940..28ce680e 100644 --- a/examples/github-repository-webhook/versions.tf +++ b/examples/github-repository-webhook/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 2.68" + version = ">= 3.45" } github = { diff --git a/examples/gitlab-repository-webhook/README.md b/examples/gitlab-repository-webhook/README.md index 250898e1..1c0f78aa 100644 --- a/examples/gitlab-repository-webhook/README.md +++ b/examples/gitlab-repository-webhook/README.md @@ -20,7 +20,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.1 | -| [aws](#requirement\_aws) | >= 2.68 | +| [aws](#requirement\_aws) | >= 3.45 | | [gitlab](#requirement\_gitlab) | >= 3.0 | ## Providers @@ -33,7 +33,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Source | Version | |------|--------|---------| -| [gitlab\_repository\_webhook](#module\_gitlab\_repository\_webhook) | ../../modules/gitlab-repository-webhook | | +| [gitlab\_repository\_webhook](#module\_gitlab\_repository\_webhook) | ../../modules/gitlab-repository-webhook | n/a | ## Resources diff --git a/examples/gitlab-repository-webhook/versions.tf b/examples/gitlab-repository-webhook/versions.tf index d4819a48..ac53951e 100644 --- a/examples/gitlab-repository-webhook/versions.tf +++ b/examples/gitlab-repository-webhook/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 2.68" + version = ">= 3.45" } gitlab = { diff --git a/variables.tf b/variables.tf index 9c05e151..a5a5dc2f 100644 --- a/variables.tf +++ b/variables.tf @@ -637,6 +637,7 @@ variable "enable_ephemeral_storage" { type = bool default = false } + variable "ephemeral_storage_size" { description = "Size of Ephemeral Storage in GiB" type = number diff --git a/versions.tf b/versions.tf index 35026472..8009c97e 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 2.68" + version = ">= 3.45" } random = { From afcd16dd871f1e3860369264ea0cba3b4535771e Mon Sep 17 00:00:00 2001 From: Chris McNabb Date: Fri, 12 Nov 2021 21:34:31 -0500 Subject: [PATCH 3/3] Update readmes with terraform-docs@0.13.0 --- examples/github-complete/README.md | 4 ++-- examples/github-repository-webhook/README.md | 2 +- examples/gitlab-repository-webhook/README.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/github-complete/README.md b/examples/github-complete/README.md index c4fdbfb1..9dc06580 100644 --- a/examples/github-complete/README.md +++ b/examples/github-complete/README.md @@ -43,9 +43,9 @@ Go to https://eu-west-1.console.aws.amazon.com/ecs/home?region=eu-west-1#/settin | Name | Source | Version | |------|--------|---------| -| [atlantis](#module\_atlantis) | ../../ | n/a | +| [atlantis](#module\_atlantis) | ../../ | | | [atlantis\_access\_log\_bucket](#module\_atlantis\_access\_log\_bucket) | terraform-aws-modules/s3-bucket/aws | ~> 2 | -| [github\_repository\_webhook](#module\_github\_repository\_webhook) | ../../modules/github-repository-webhook | n/a | +| [github\_repository\_webhook](#module\_github\_repository\_webhook) | ../../modules/github-repository-webhook | | ## Resources diff --git a/examples/github-repository-webhook/README.md b/examples/github-repository-webhook/README.md index fc9c3373..0e55c4f6 100644 --- a/examples/github-repository-webhook/README.md +++ b/examples/github-repository-webhook/README.md @@ -35,7 +35,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Source | Version | |------|--------|---------| -| [github\_repository\_webhook](#module\_github\_repository\_webhook) | ../../modules/github-repository-webhook | n/a | +| [github\_repository\_webhook](#module\_github\_repository\_webhook) | ../../modules/github-repository-webhook | | ## Resources diff --git a/examples/gitlab-repository-webhook/README.md b/examples/gitlab-repository-webhook/README.md index 1c0f78aa..f17dd1ac 100644 --- a/examples/gitlab-repository-webhook/README.md +++ b/examples/gitlab-repository-webhook/README.md @@ -33,7 +33,7 @@ Note that this example may create resources which cost money. Run `terraform des | Name | Source | Version | |------|--------|---------| -| [gitlab\_repository\_webhook](#module\_gitlab\_repository\_webhook) | ../../modules/gitlab-repository-webhook | n/a | +| [gitlab\_repository\_webhook](#module\_gitlab\_repository\_webhook) | ../../modules/gitlab-repository-webhook | | ## Resources