Skip to content
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

[aws api] Ordering of env vars does not work #52

Closed
bendavies opened this issue Nov 20, 2019 · 4 comments
Closed

[aws api] Ordering of env vars does not work #52

bendavies opened this issue Nov 20, 2019 · 4 comments

Comments

@bendavies
Copy link

bendavies commented Nov 20, 2019

Hi there,

This is just for visibility here rather than anything.
There is some effort here to ensure environment vars are sorted as to not produce unnecessary diffs when any changes are made.

Unfortunately, it doesn't work too well because of a bug in the aws provider:
hashicorp/terraform-provider-aws#3035

cheers!

@aknysh
Copy link
Member

aknysh commented Nov 26, 2019

@bendavies thanks for reporting

@rafilkmp3
Copy link

this force replace all time module.td.aws_ecs_task_definition.td must be replaced

@nitrocode nitrocode changed the title Ordering of env vars does not work [aws api] Ordering of env vars does not work Jun 19, 2020
@nitrocode
Copy link
Member

This has been bugging me too. There is currently sorting logic in this module.

# Sort environment variables so terraform will not try to recreate on each plan/apply
env_vars = var.environment != null ? var.environment : []
env_vars_keys = [for m in local.env_vars : lookup(m, "name")]
env_vars_values = [for m in local.env_vars : lookup(m, "value")]
env_vars_as_map = zipmap(local.env_vars_keys, local.env_vars_values)
sorted_env_vars_keys = sort(local.env_vars_keys)

If there is an improvement to make this module's environment equivalent to the aws api, we'd love to know and pull requests are always welcome.

@bendavies
Copy link
Author

fixed via hashicorp/terraform-provider-aws#11463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants