pulumi / pulumi-awsx

AWS infrastructure best practices in component form!
https://www.pulumi.com/docs/guides/crosswalk/aws/
Apache License 2.0
218 stars 105 forks source link

aliases ignored by awsx.ec2.Vpc #1030

Open bennettp123 opened 1 year ago

bennettp123 commented 1 year ago

What happened?

Pulumi want to delete and recreate resources, ignoring aliases.

image

Preview: https://app.pulumi.com/bennettp123/awsx-vpc-aliases-not-working/reproduce-bug/previews/4d4ddb46-9379-4372-b546-ed80ffd340d0

Expected Behavior

Pulumi makes no changes—updates URNs without deleting and recreating the underlying resources

Steps to reproduce

Apply the changes in this PR: https://github.com/bennettp123/awsx-vpc-aliases-not-working/pull/1/files

diff --git a/index.ts b/index.ts
index b078e73..6159833 100644
--- a/index.ts
+++ b/index.ts
@@ -14,6 +14,12 @@ class Container extends pulumi.ComponentResource {
                     strategy: "None",
                 },
                 subnetSpecs: [{ type: "Isolated" }]
+            },
+            {
+                aliases: [{
+                    parent: pulumi.rootStackResource, // old parent
+                }],
+                parent: this, // new parent
             }
         );
     }

Output of pulumi about

Before applying the changes:

CLI          
Version      3.68.0
Go Version   go1.20.4
Go Compiler  gc

Plugins
NAME    VERSION
aws     5.41.0
awsx    1.0.2
docker  3.6.1
nodejs  unknown

Host     
OS       darwin
Version  13.5
Arch     x86_64

This project is written in nodejs: executable='/Users/bennett/.nvm/versions/node/v18.15.0/bin/node' version='v18.15.0'

Current Stack: bennettp123/awsx-vpc-aliases-not-working/reproduce-bug

TYPE                                                 URN
pulumi:pulumi:Stack                                  urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::pulumi:pulumi:Stack::awsx-vpc-aliases-not-working-reproduce-bug
example:Container                                    urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::example:Container::example
pulumi:providers:awsx                                urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::pulumi:providers:awsx::default_1_0_2
pulumi:providers:aws                                 urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::pulumi:providers:aws::default_5_16_2
awsx:ec2:Vpc                                         urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::awsx:ec2:Vpc::example
aws:ec2/vpc:Vpc                                      urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::awsx:ec2:Vpc$aws:ec2/vpc:Vpc::example
aws:ec2/subnet:Subnet                                urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet::example-isolated-1
aws:ec2/internetGateway:InternetGateway              urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/internetGateway:InternetGateway::example
aws:ec2/routeTable:RouteTable                        urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable::example-isolated-1
aws:ec2/routeTableAssociation:RouteTableAssociation  urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/routeTableAssociation:RouteTableAssociation::example-isolated-1
pulumi:providers:pulumi                              urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::pulumi:providers:pulumi::default

Found no pending operations associated with reproduce-bug

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/bennettp123
User           bennettp123
Organizations  bennettp123

Dependencies:
NAME            VERSION
@pulumi/aws     5.41.0
@pulumi/awsx    1.0.2
@pulumi/pulumi  3.68.0
@types/node     16.18.34

Pulumi locates its logs in /var/folders/7d/69pdjd9j50qb_g2m88x355r00000gn/T/ by default

After applying the changes: see comment below

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).

bennettp123 commented 1 year ago

Oops—the pulumi about in the OP was captured after applying the changes in the PR. I've edited the bug report to include the pulumi about from before the changes.

Here's the original output of pulumi about, captured after the changes were applied (after deleting and recreating all the resources)—it shows the different resource URNs:

CLI          
Version      3.68.0
Go Version   go1.20.4
Go Compiler  gc

Plugins
NAME    VERSION
aws     5.41.0
awsx    1.0.2
docker  3.6.1
nodejs  unknown

Host     
OS       darwin
Version  13.5
Arch     x86_64

This project is written in nodejs: executable='/Users/bennett/.nvm/versions/node/v18.15.0/bin/node' version='v18.15.0'

Current Stack: bennettp123/awsx-vpc-aliases-not-working/reproduce-bug

TYPE                                                 URN
pulumi:pulumi:Stack                                  urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::pulumi:pulumi:Stack::awsx-vpc-aliases-not-working-reproduce-bug
example:Container                                    urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::example:Container::example
pulumi:providers:awsx                                urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::pulumi:providers:awsx::default_1_0_2
pulumi:providers:aws                                 urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::pulumi:providers:aws::default_5_16_2
awsx:ec2:Vpc                                         urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::example:Container$awsx:ec2:Vpc::example
aws:ec2/vpc:Vpc                                      urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::example:Container$awsx:ec2:Vpc$aws:ec2/vpc:Vpc::example
aws:ec2/subnet:Subnet                                urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::example:Container$awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet::example-isolated-1
aws:ec2/internetGateway:InternetGateway              urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::example:Container$awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/internetGateway:InternetGateway::example
aws:ec2/routeTable:RouteTable                        urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::example:Container$awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable::example-isolated-1
aws:ec2/routeTableAssociation:RouteTableAssociation  urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::example:Container$awsx:ec2:Vpc$aws:ec2/vpc:Vpc$aws:ec2/subnet:Subnet$aws:ec2/routeTable:RouteTable$aws:ec2/routeTableAssociation:RouteTableAssociation::example-isolated-1
pulumi:providers:pulumi                              urn:pulumi:reproduce-bug::awsx-vpc-aliases-not-working::pulumi:providers:pulumi::default

Found no pending operations associated with reproduce-bug

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/bennettp123
User           bennettp123
Organizations  bennettp123

Dependencies:
NAME            VERSION
@pulumi/awsx    1.0.2
@pulumi/pulumi  3.68.0
@types/node     16.18.34
@pulumi/aws     5.41.0

Pulumi locates its logs in /var/folders/7d/69pdjd9j50qb_g2m88x355r00000gn/T/ by default
bennettp123 commented 1 year ago

Attempted workarounds (none working):

rquitales commented 1 year ago

Hi @bennettp123. Thank you for bringing this issue to our attention, and I apologize for the difficulties you are facing. I appreciate your patience and understanding.

I have conducted an initial investigation into the problem you encountered, but as of now, I haven't been able to determine the root cause definitively. To ensure a comprehensive analysis and resolution, I will collaborate with my colleagues who possess more experience in this specific provider and component resources. Their expertise will help us gain further insights into the issue and work towards a solution.

Rest assured, we are actively working to address this issue, and I will keep you updated on any progress made. Your contribution and in-depth reporting of this problem is highly valuable, and we are committed to resolving it as quickly as possible.