-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat!: Raise minimum required Terraform version to 1.0+ #331
feat!: Raise minimum required Terraform version to 1.0+ #331
Conversation
|
||
lifecycle { | ||
ignore_changes = [ | ||
ami |
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.
I see you like to have copy-paste just to have this use-case covered :)
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.
Its such a bad hack! @AdamTylerLynch use your influence to help us avoid having to use these ugly hacks 🙏🏽 😬 There are valid use cases where you want to initialize a value and then forget it, but we cannot do that in Terraform in a clean way currently (nor give users the ability to specify which values they wish to ignore which means we have to pick and choose which ones we are going to hardcode into the module)
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.
Minor comments here and there.
main.tf
Outdated
device_name = ephemeral_block_device.value.device_name | ||
no_device = lookup(ephemeral_block_device.value, "no_device", null) | ||
virtual_name = lookup(ephemeral_block_device.value, "virtual_name", null) | ||
device_name = try(ephemeral_block_device.value.device_name, each.key) |
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.
This should be reverted (in both resources) because var.ephemeral_block_device
is a list.
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.
whoops, ya I tried to use this and forgot we had it as a list. Looks like I only corrected the EBS block device, I'll revert all of these each.key
s
} | ||
} | ||
|
||
dynamic "network_interface" { | ||
for_each = var.network_interface | ||
|
||
content { | ||
device_index = network_interface.value.device_index | ||
network_interface_id = lookup(network_interface.value, "network_interface_id", null) |
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.
Probably try()
here and in all (or almost all other places in this file), too.
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.
I suspect we'll have users who are wrapping this module in their own module, so I avoided converting any arguments that might be passed as computed attributes to try()
to avoid https://github.com/clowdhaus/terraform-for-each-unknown
So any of the kms_key_id
, snapshot_id
, network_interface_id
, etc. I left as lookup()
s so that they don't throw the unknown computed value error when wrapped in another module
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.
LGTM
This PR is included in version 5.0.0 🎉 |
@bryantbiggs Has this been tested with the new variable
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
metadata_options
to enforce IMDSv2 for stronger security postureMotivation and Context
Breaking Changes
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request