-
Notifications
You must be signed in to change notification settings - Fork 155
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
aws:ec2:LaunchTemplate update_default_version Fails on AWS Provider #1504
Comments
The workaround right now is to just pull the |
@farvour is this still an issue to you? I'm using |
Going to close this out - there's been no response here so it seems all is working? |
So,... this feels like it came back again:
|
I'm getting this when I'm trying to add a tag to an otherwise unchanged launch template. If I update a property of the template, it works fine. using |
Just ran into the exact same scenario. |
I believe this is the same issue tracked in hashicorp/terraform-provider-aws#34867 upstream. Will reopen here as tracking that issue being fixed and adopted into this provider. |
I can reproduce on latest Pulumi with the following: import pulumi
import pulumi_aws as aws
config = pulumi.Config()
key_name = config.require("key_name")
tag_name = config.require("tag_name")
ec2_launch_template = aws.ec2.LaunchTemplate(
"my_launch_template",
image_id="ami-0c55b159cbfafe1f0",
instance_type="t2.micro",
key_name=key_name,
tags={
"Name": tag_name
},
update_default_version=True)
# Export the ID of the launch template
pulumi.export("launch_template_id", ec2_launch_template.id)
pulumi.export("launch_template_latest_version", ec2_launch_template.latest_version) #!/usr/bin/env bash
set -euo pipefail
pulumi destroy --yes
# Initial configuration
pulumi config set tag_name tag1
pulumi config set key_name key1
pulumi up --skip-preview --yes
# Change only tag
pulumi config set tag_name tag2
pulumi config set key_name key1
pulumi preview --diff
PULUMI_DEBUG_GRPC="$PWD/repro.json" pulumi up --skip-preview --yes # version not changing Observing that the issue happens for programs that specify update_default_version=True during changes that only affect
Debugging the failure leads to this line: ModifyLaunchTemplateWithContext fails because DefaultVersion incorrectly interpreted a Computed latestVersion as 0. (dlv) print d.diff.Attributes["latest_version"]
*github.com/hashicorp/terraform-plugin-sdk/v2/terraform.ResourceAttrDiff {
Old: "1",
New: "0",
NewComputed: true,
NewRemoved: false,
NewExtra: interface {} nil,
RequiresNew: false,
Sensitive: false,
Type: 0,} I suspect that the diff customizer is something that sets it to computed, verifying this. |
Curiously, this particular repro does not reproduce once WithPlanResourceChange is applied to the If this theory is correct though, this repro would not reproduce on the similar program written in TF, and the fix would |
Fixes #1504 Due to discrepancies between TF and Pulumi Bridged provider life cycle, editing tags on a Launch Template resource caused failure in pulumi-aws. This is now fixed by opting in this resource to the PlanResourceChange behavior that tracks TF lifecycle more closely.
Curiously, this particular repro does not reproduce once WithPlanResourceChange is applied to the If this theory is correct though, this repro would not reproduce on the similar program written in TF, and the fix would |
I have confirmed that this issue does not currently reproduce in Terraform. To double check I also tried tags under Suggest moving forward here with this change that fixes the problem with updating tags: The root cause is that CustomizeDiff methods should not be run on Update, but are, cause this to fail under Pulumi. Tracking broader PlanResourceChange rollout in pulumi/pulumi-terraform-bridge#1785 |
This is now releasing and automation should close this and make a new release. Please let us know if this fix works, and reopen if there's any further issues in this area. Appreciate your patience! |
Fixes #1504 Due to discrepancies between TF and Pulumi Bridged provider life cycle, editing tags on a Launch Template resource caused failure in pulumi-aws. This is now fixed by opting in this resource to the PlanResourceChange behavior that tracks TF lifecycle more closely.
I upgraded the AWS provider from 3.23 to the latest 4.5.1 recently to do a Pulumi 3.x upgrade. Noticed some code that sets
update_default_version
on this provider fails now when doing a pulumi update on the existing resources.Expected behavior
No changes should have been seen by the provider and updateDefaultVersion should continue to function as desired.
Current behavior
also, it doesn't even show up in the list of diffSet, so something tells me the provider is misbehaving internally here.
Steps to reproduce
We are using the Python dialect. Create a
pulumi_aws.ec2.LaunchTemplate
resource and set theupdate_default_version
attribute to True.Context (Environment)
Existing resource was present and may or may not affect the outcome of the result. This was a LaunchTemplate whose versioning updating was working just fine prior to upgrading the pulumi-aws provider to 4.5.1 and pulumi to 3.2.1.
This seems like a really old Terraform issue to be honest, that somehow resurfaced itself (regression?) in the newer AWS provider. hashicorp/terraform-provider-aws#4655
Affected feature
N/A
The text was updated successfully, but these errors were encountered: