这是indexloc提供的服务,不要输入任何密码
Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zapion
Copy link

@zapion zapion commented Nov 18, 2021

Hi,
AWS ECS introduced ephemeral storage earlier this year, and aws provider supports it from v3.45.0.

@zapion zapion requested a review from a team as a code owner November 18, 2021 03:45
@maheshbr maheshbr self-requested a review November 24, 2021 13:59
variables.tf Outdated
variable "ephemeral_storage" {
type = number
description = "(Optional) The amount(in GiB) of ephemeral storage to allocate for the task"
default = 0

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?

Copy link
Author

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.

@@ -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] : []
Copy link

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

Copy link
Author

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.

Copy link

@nicor88 nicor88 Nov 26, 2021

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.

Copy link
Author

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.

Copy link

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:)

@zapion zapion force-pushed the ephemeral_storage branch from 1065278 to c187403 Compare December 1, 2021 04:41
@zapion zapion force-pushed the ephemeral_storage branch from c187403 to 9352909 Compare December 1, 2021 04:42
@zapion
Copy link
Author

zapion commented Dec 1, 2021

Just checked hashicorp/terraform-github-actions and it was officially replaced by hashicorp/setup-terraform
Not quite sure which version is preferred, simply replace it with the code snippet in its README.md

@zapion zapion requested a review from maheshbr December 16, 2021 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants