-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow custom AMI ID for EC2 workers #49
Conversation
e042697
to
efb9f23
Compare
variables.tf
Outdated
|
||
variable "ec2_worker_ami_id" { | ||
type = string | ||
default = "" |
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'm going to look into whether this should be null
or just not defined here. The latest versions of TF have made some improvements to default values.
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.
Seems reasonable in concept. I was a bit concerned that it was the edge of a slippery slope of wrapping more and more choices, but considering that GPU-enabled machines are one of the most common reasons for having an EC2 worker, I think it's foreseeable that a different AMI will be required to support the special hardware configuration.
I'd like to explore a few minor tweaks to improve validation, then I plan on merging this.
I plan to make the suggested changes myself; those are just notes to remind me.
403bf63
to
ad0ccda
Compare
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.
The presence of
lifecycle {
ignore_changes = [
# Allow an updated AMI be used for new provisions without always recreating the machine
ami,
]
}
is a significant barrier to making ami_id
a useful variable. Once the module is created, incrementally setting or changing ami_id
will not trigger the appropriate updates to the underlying resources. Worse, it'll do this silently, creating a very non-obvious source of bugs.
The underlying problem could be fixed once hashicorp/terraform#24188 is resolved, so we could only ignore_changes
to ami
if var.ami_id
is not set.
If we want to try to release this now, I'd like to have some sort of workaround to address this bug.
Maybe it's possible to have a |
50da6e9
to
adf7d8f
Compare
adf7d8f
to
98837a8
Compare
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 don't think there's a technical way to solve my usability concerns. Even with the replace_triggered_by
lifecycle option, I don't think it's possible to always reasonably predict a user's intent.
I've updated the variable name and docs to clarify the caveats of how AMIs interact with existing EC2 worker instances.
Fixes #48