-
Notifications
You must be signed in to change notification settings - Fork 12
Add support of ephemeral_storage #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
variables.tf
Outdated
variable "ephemeral_storage" { | ||
type = number | ||
description = "(Optional) The amount(in GiB) of ephemeral storage to allocate for the task" | ||
default = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @zapion Thank you for the PR and adding an option , could you please run a terraform fmt
and push the changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey thanks! I just pushed with the modified commit.
1e71de5
to
1065278
Compare
@@ -146,6 +146,13 @@ resource "aws_ecs_task_definition" "fargate_task" { | |||
cpu = var.task_cpu | |||
memory = var.task_memory | |||
|
|||
dynamic "ephemeral_storage" { | |||
for_each = var.ephemeral_storage > 20 ? [var.ephemeral_storage] : [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you use ephemeral_storage=10
won't work, consider to use var.ephemeral_storage > 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello @nicor88
I'm using terraform 1.0.6 + aws provider 3.64.0 and didn't see the error. Can I see the error message to reproduce? thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is not error on terraform itself, it's a semantical error. Try to setup ephemeral_storage=10, and see if the storage is attached.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_EphemeralStorage.html
sizeInGiB
The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported value is 21 GiB and the maximum supported value is 200 GiB.
If I set ephemeral_storage=10, I got
Error: expected ephemeral_storage.0.size_in_gib to be in the range (21 - 200), got 10
since the parameter is designed to enlarge instead of adding another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, then ignore my message. looks good then:)
1065278
to
c187403
Compare
c187403
to
9352909
Compare
Just checked |
Hi,
AWS ECS introduced ephemeral storage earlier this year, and aws provider supports it from v3.45.0.