Skip to content

Commit 40e4a7f

Browse files
authored
Add ephemeral storage support (#27)
1 parent aceb127 commit 40e4a7f

File tree

7 files changed

+27
-3
lines changed

7 files changed

+27
-3
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:
2-
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.50.0
2+
- repo: https://github.com/antonbabenko/pre-commit-terraform
3+
rev: v1.71.0
44
hooks:
55
- id: terraform_docs
66
- id: terraform_fmt

.terraform.lock.hcl

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ In order to run all checks at any point run the following command:
8181
| <a name="input_entrypoint"></a> [entrypoint](#input\_entrypoint) | The entry point that is passed to the container | `list(string)` | `null` | no |
8282
| <a name="input_environment"></a> [environment](#input\_environment) | The environment variables to pass to the container. This is a list of maps. map\_environment overrides environment | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
8383
| <a name="input_environment_files"></a> [environment\_files](#input\_environment\_files) | One or more files containing the environment variables to pass to the container. This maps to the --env-file option to docker run. The file must be hosted in Amazon S3. This option is only available to tasks using the EC2 launch type. This is a list of maps | <pre>list(object({<br> value = string<br> type = string<br> }))</pre> | `[]` | no |
84+
| <a name="input_ephemeral_storage_size"></a> [ephemeral\_storage\_size](#input\_ephemeral\_storage\_size) | The number of GBs to provision for ephemeral storage on Fargate tasks. Must be greater than or equal to 21 and less than or equal to 200 | `number` | `0` | no |
8485
| <a name="input_essential"></a> [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 |
8586
| <a name="input_extra_hosts"></a> [extra\_hosts](#input\_extra\_hosts) | A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. This is a list of maps | <pre>list(object({<br> ipAddress = string<br> hostname = string<br> }))</pre> | `null` | no |
8687
| <a name="input_firelens_configuration"></a> [firelens\_configuration](#input\_firelens\_configuration) | The FireLens configuration for the container. This is used to specify and configure a log router for container logs. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_FirelensConfiguration.html | <pre>object({<br> type = string<br> options = map(string)<br> })</pre> | `null` | no |

examples/multiple-containers/.terraform.lock.hcl

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/test/.terraform.lock.hcl

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ resource "aws_ecs_task_definition" "td" {
102102
type = lookup(proxy_configuration.value, "type", null)
103103
}
104104
}
105+
dynamic "ephemeral_storage" {
106+
for_each = var.ephemeral_storage_size == 0 ? [] : [var.ephemeral_storage_size]
107+
content {
108+
size_in_gib = var.ephemeral_storage_size
109+
}
110+
}
105111
dynamic "volume" {
106112
for_each = var.volumes
107113
content {

variables.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,17 @@ variable "proxy_configuration" {
366366
default = []
367367
}
368368

369+
variable "ephemeral_storage_size" {
370+
type = number
371+
description = "The number of GBs to provision for ephemeral storage on Fargate tasks. Must be greater than or equal to 21 and less than or equal to 200"
372+
default = 0
373+
374+
validation {
375+
condition = var.ephemeral_storage_size == 0 || (var.ephemeral_storage_size >= 21 && var.ephemeral_storage_size <= 200)
376+
error_message = "The ephemeral_storage_size value must be inclusively between 21 and 200."
377+
}
378+
}
379+
369380
variable "volumes" {
370381
description = "(Optional) A set of volume blocks that containers in your task may use"
371382
type = list(object({

0 commit comments

Comments
 (0)