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
Not sure if this is the right forum for these questions, so happy to re-post elsewhere!
We're experiencing an issue where we're launching an EC2 instance from an AMI that already has EBS volume snapshots in it, and the EC2 instance template has those EBS volumes specified.
Terraform wants to destroy and recreate the instance everytime we run apply with something like this message:
Conceptually, this seems like it ought not need to recreate the instance, because the EBS block devices really do have the matching properties. But it seems like TF can't track those EBS resources created through AMI launch process...
If I remove the ebs_block_device blocks completely, then the initial launch and susquent apply converges happily -- no changes detected. Removing those block devices in general isn't ideal, and we couldn't figure out a way to get TF template interpolation to do what I needed. We'd like to avoid integration a pre-Terraform templating engine if possible, but if that's the only solution then...that would be good to know.
Even if I specify ignore_changes through the lifecycle block, i.e.,
In case it helps, here is the whole reason we're trying to do this: the instance specified by the template is expensive to create because we end up installing a bunch of stuff that takes a long time, so we wanted to take an AMI snapshot of an already created one, and use that as a sort of "cached" instance that we can use for development/CI purposes. But obviously we won't use that cached AMI for our "real" deploys.
We're open to any solution to our use case, our though around this "override" base AMI was just the most promising path we saw initially. But definitely open to different ideas! Thanks so much in advance for your help! By and large, TF has been great!
I've found some related issues, but they seemed not quite the same or the resolution didn't quite work for what we're trying:
Okay looks like there's a lot of prior related/duplicate questions. I'm wondering then if we could just get some guidance on the best workaround for now? I'm not sure if there are plans to resolve this issue (or if it's even possible) but we don't mind doing something a little hacky for now.
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
Apr 28, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Not sure if this is the right forum for these questions, so happy to re-post elsewhere!
We're experiencing an issue where we're launching an EC2 instance from an AMI that already has EBS volume snapshots in it, and the EC2 instance template has those EBS volumes specified.
Terraform wants to destroy and recreate the instance everytime we run apply with something like this message:
Conceptually, this seems like it ought not need to recreate the instance, because the EBS block devices really do have the matching properties. But it seems like TF can't track those EBS resources created through AMI launch process...
Here is an excerpt of the resource template:
Two other interesting things of note:
ebs_block_device
blocks completely, then the initial launch and susquent apply converges happily -- no changes detected. Removing those block devices in general isn't ideal, and we couldn't figure out a way to get TF template interpolation to do what I needed. We'd like to avoid integration a pre-Terraform templating engine if possible, but if that's the only solution then...that would be good to know.ignore_changes
through thelifecycle
block, i.e.,TF still detects the instance as needing to be destroyed and re-created, even though it no longer lists the
ebs_block_device
in the diff. Baffling!In case it helps, here is the whole reason we're trying to do this: the instance specified by the template is expensive to create because we end up installing a bunch of stuff that takes a long time, so we wanted to take an AMI snapshot of an already created one, and use that as a sort of "cached" instance that we can use for development/CI purposes. But obviously we won't use that cached AMI for our "real" deploys.
We're open to any solution to our use case, our though around this "override" base AMI was just the most promising path we saw initially. But definitely open to different ideas! Thanks so much in advance for your help! By and large, TF has been great!
I've found some related issues, but they seemed not quite the same or the resolution didn't quite work for what we're trying:
lifecycle
but with differentignore_changes
parameters (and an actual error, rather than just a divergence)The text was updated successfully, but these errors were encountered: