-
Notifications
You must be signed in to change notification settings - Fork 159
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
Panic when adding secondaryAllocationIds to existing NAT Gateway #2971
Comments
Thank you for reporting this issue @barryrobison No root cause yet, but quick notes so far: the error is coming from TF bridge Update: https://github.com/pulumi/pulumi-terraform-bridge/blob/f217804896b3dfa0c48627686de58f5e624a9c18/pkg/tfbridge/provider.go#L980 The code hasn't changed for a long while. A similar issue that was closed in the past: pulumi/pulumi-terraform-bridge#296 |
@barryrobison Can you describe which other resources I need to create to repro the issue? How is |
Hi Mikhail - here is a minimal repro: https://github.com/barryrobison/pulumi-issue-repro/tree/main/aws-2971 You'll need to provide your own subnet and EIP allocation ids but hopefully this is sufficient. Thanks! |
Thank you @barryrobison. I got the issue reproduced with the following isolated program: import * as aws from "@pulumi/aws";
const defaultVpc = aws.ec2.getVpcOutput({default: true});
const defaultVpcSubnets = aws.ec2.getSubnetsOutput({
filters: [
{name: "vpc-id", values: [defaultVpc.id]},
],
});
const one = new aws.ec2.Eip("one", {
domain: "vpc",
});
const two = new aws.ec2.Eip("two", {
domain: "vpc",
});
new aws.ec2.NatGateway("ng",
{
allocationId: one.allocationId,
// after a first run to create the NAT Gateway, uncomment
// the following line to reproduce a terraform panic
// secondaryAllocationIds: [two.allocationId],
subnetId: defaultVpcSubnets.ids[0],
},
); Then, on the second update I get the same panic. |
Digging in, I have confirmed that this is a provider bug. @barryrobison Thanks for raising the issue and @mikhailshilkov thanks for building the self-contained repro. It made chasing this down much faster. This is another bug caused by |
This will fix (upon adoption) pulumi/pulumi-aws#2971. The design discussion for this PR is https://pulumi.slack.com/archives/C02FXTZEZ6W/p1699989102568939. ### Changes If there is a replace on the underlying TF object (as indicated by `diff.RequiresNew() || diff.Destroy()`) but no associated replace in the wire return (`pulumirpc.DiffResponse.Replaces`), then we set `pulumirpc.DiffResponse.Replaces = pulumirpc.DiffResponse_DIFF_SOME` and insert `__meta` as needing a replace.
Thanks Ian and Mikhail! Just to clarify, adding the Secondary EIPs to an existing NAT Gateway should not cause a replace. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-natgateway.html I can't find anything definitive in the Terraform docs about how it handles a change of this property.. Thanks! |
I don't see it documented anywhere, but TF handles it the same way that we do, with a replace. I checked by translating the Pulumi program into HCL: https://gist.github.com/iwahbe/d11ab2a962a69394741150e8ce0e7694. |
[Upstream v5.25.0 release notes](https://github.com/hashicorp/terraform-provider-aws/releases/tag/v5.25.0) Fixes #2983, #2904, #2971, #2900 - [x] Rebuild eks.Cluster patches; upstream moved to AWS SDK v2 for Go, patches needed updates as well - [x] Fix pulumi/pulumi-terraform-bridge#1523 in the bridge - [x] Update bridge to include pulumi/pulumi-terraform-bridge#1521 and pulumi/pulumi-terraform-bridge#1520 fixes affecting P1s in pulumi-aws - [x] Build a Pulumi test for EKS Cluster add-on removal -> turns out the property is a no-op, not needed
Fixed in v6.9.0 |
What happened?
We are attempting to add additional EIPs to our existing NAT Gateways. Adding this causes pulumi to panic during a preview.
This operation should not cause a deletion or replacement of an existing NAT GW.
Example
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: