You use Terraform to manage an application deployed to a Google Cloud environment The application runs on instances deployed by a managed instance group The Terraform code is deployed by using a CI/CD pipeline When you change the machine type on the instance template used by the managed instance group, the pipeline fails at the terraform apply stage with the following error message

You need to update the instance template and minimize disruption to the application and the number of pipeline runs What should you do?
Suggested Answer: B
Get Premium Professional Cloud DevOps Engineer Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
37 comments · newest first
GE
Gene
11 months ago
I think C is a bit risky, reimporting can be tricky.
TU
Tula
11 months ago
Definitely not A, that would cause too much downtime.
AS
Ashley
11 months ago
Surprised that deleting the managed instance group is even an option.
KI
Kimberely
11 months ago
I disagree, option D could work too!
WA
Walker
12 months ago
Option B seems like the best choice to minimize disruption.
MI
Mila
12 months ago
I’m a bit confused about the terraform state file. Is option C really necessary, or can we just update the instance template directly?
AU
Audria
1 year ago
I feel like I saw a question similar to this in our practice tests, but I can't recall if we discussed the lifecycle block in detail.
AR
Arlyne
1 year ago
I think adding a new instance template and updating the managed instance group is a common practice. It seems like option B might be the right choice.
DO
Dominque
1 year ago
I remember something about updating instance templates without deleting the managed instance group, but I'm not sure which option does that.
JE
Jerry
1 year ago
The create_before_destroy option seems promising. That could allow me to update the instance template without causing issues with the pipeline. I'll definitely consider that one.
AR
Arlie
1 year ago
Removing the managed instance group from the Terraform state and reimporting it - that's an interesting idea. I'll need to make sure I understand the implications of that approach.
JA
Jame
1 year ago
Ah, I see. Adding a new instance template and updating the managed instance group could work, but I'm not sure if that's the most efficient approach. Let me think this through.
MA
Macy
1 year ago
Hmm, deleting the managed instance group seems risky - that could cause significant downtime. I'm leaning towards one of the other options that minimizes disruption.
HE
Helga
1 year ago
This looks like a tricky one. I'll need to carefully review the options and think through the potential impact on the application and pipeline.
VA
Vallie
1 year ago
I'm just glad I'm not the one who has to figure this out on a production system. Can you imagine the angry calls from the users if we botch this update?
BI
Billye
1 year ago
That sounds like a good plan. We can also monitor the application during the update to ensure everything is running smoothly.
AL
Alonso
1 year ago
Then we can gradually replace the instances in the group with the new template to minimize disruption.
VI
Viva
1 year ago
We should create a new instance template with the updated machine type and update the managed instance group to use the new template.
JA
James
1 year ago
Haha, I bet the Terraform maintainers had a good laugh when they came up with that `create_before_destroy` meta-argument. Looks like that might be the way to go here, though I'd want to test it out first.
EV
Evette
1 year ago
Agreed. Let's make sure to test it thoroughly to minimize any potential issues with the pipeline.
LE
Leota
1 year ago
That sounds like a good idea. We should definitely test it out first before making any changes.
SH
Shoshana
1 year ago
We could try using the `create_before_destroy` meta-argument to update the instance template without disrupting the application.
FA
Fannie
1 year ago
Wait, so we can't just delete the managed instance group and recreate it? That seems like the simplest solution, but I guess it could cause downtime. Gotta love Terraform's idempotency!
PO
Pok
1 year ago
Deleting and recreating the managed instance group could work, but it might cause downtime for the application.
DA
Darci
1 year ago
Another option is to manually update the instance template and then trigger a rolling update on the managed instance group.
DO
Dortha
1 year ago
You could create a new instance template with the updated machine type and then update the managed instance group to use the new template.
FI
Filiberto
2 years ago
Ah, I see. The key here is to minimize disruption to the application while updating the instance template. I think option B might be the best approach, but I'll need to double-check the details.
MA
Marjory
1 year ago
User 2: Yeah, I agree. Updating the managed instance group to use the new instance template and then deleting the old one sounds like a good plan.
CE
Ceola
1 year ago
User 1: I think option B is the way to go. It seems like the least disruptive option.
JO
Jose
2 years ago
Why do you think D is the correct answer?
EL
Elbert
2 years ago
Hmm, this is a tricky one. I'm not sure I fully understand the issue with the instance template change causing the pipeline to fail. I'll need to carefully read through the options and think this through.
JA
Jame
1 year ago
Definitely, we need to ensure that the application continues to run smoothly while updating the instance template.
JO
Joseph
1 year ago
That makes sense, it's important to minimize disruption when making changes to the infrastructure.
TH
Theresia
1 year ago
I agree, adding a new instance template and updating the managed instance group seems like the least disruptive option.
LE
Lera
1 year ago
Option B seems like the best approach to update the instance template without disrupting the application.
VA
Val
2 years ago
I disagree, I believe the correct answer is D.
JO
Jose
2 years ago
I think the answer is B.