You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know that Terraform doesn't support conditionals, but I was wondering if three was any other way to support this use case... I have an instance module which we use to create aws_instance resources. The reason for using a module is to avoid having to redeclare user_data everrywhere (we use a shared bootstrap script as user data). Currently, our module basically looks like this:
I want to add support for root_block_device mapping, but this mapping should only exist for EBS-backed instances. Is there anyway to achieve this? Can I just do something like this and set the default value for ${var.root_block_device_volume_size} to "" or some such equivalent?
Hi @joshuaspence! Sorry for the long silence here. This issue was using an older labeling scheme and so we missed it on previous update passes.
The problem you described here is the same idea as for #7034, which is now closed due to the addition of a new feature in master ready for the forthcoming v0.12.0 release. I left some comments over there showing how it can be used to generate nested blocks based on variables.
I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Mar 31, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I know that Terraform doesn't support conditionals, but I was wondering if three was any other way to support this use case... I have an
instance
module which we use to createaws_instance
resources. The reason for using a module is to avoid having to redeclareuser_data
everrywhere (we use a shared bootstrap script as user data). Currently, our module basically looks like this:I want to add support for
root_block_device
mapping, but this mapping should only exist for EBS-backed instances. Is there anyway to achieve this? Can I just do something like this and set the default value for${var.root_block_device_volume_size}
to""
or some such equivalent?The text was updated successfully, but these errors were encountered: