Skip to content
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

RDS Instance replacement when upgrading to 6.0 #2682

Closed
mikhailshilkov opened this issue Aug 8, 2023 · 3 comments · Fixed by #2686
Closed

RDS Instance replacement when upgrading to 6.0 #2682

mikhailshilkov opened this issue Aug 8, 2023 · 3 comments · Fixed by #2686
Assignees
Labels
bug/diff kind/bug related to Pulumi generating wrong diffs on preview or up. kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Milestone

Comments

@mikhailshilkov
Copy link
Member

What happened?

Upgrading from 5.x to 6.0 causes a replacement in aws.rds.Instance.

     Type                 Name        Plan        Info
     pulumi:pulumi:Stack  aws-ts-dev              
 +-  └─ aws:rds:Instance  postgresdb  replace     [diff: ~name]

Resources:
    +-1 to replace
    2 unchanged

Do you want to perform this update? details
  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:dev::aws-ts::pulumi:pulumi:Stack::aws-ts-dev]
    ++aws:rds/instance:Instance: (create-replacement)
        [id=postgresdbd65b294]
        [urn=urn:pulumi:dev::aws-ts::aws:rds/instance:Instance::postgresdb]
        [provider: urn:pulumi:dev::aws-ts::pulumi:providers:aws::default_5_41_0::5199a248-3c92-4b11-ae4e-dbf860fd2c76 => urn:pulumi:dev::aws-ts::pulumi:providers:aws::default_6_0_0::output<string>]
      ~ name: "airflow" => "airflow"
    +-aws:rds/instance:Instance: (replace)
        [id=postgresdbd65b294]
        [urn=urn:pulumi:dev::aws-ts::aws:rds/instance:Instance::postgresdb]
        [provider: urn:pulumi:dev::aws-ts::pulumi:providers:aws::default_5_41_0::5199a248-3c92-4b11-ae4e-dbf860fd2c76 => urn:pulumi:dev::aws-ts::pulumi:providers:aws::default_6_0_0::output<string>]
      ~ name: "airflow" => "airflow"
    --aws:rds/instance:Instance: (delete-replaced)
        [id=postgresdbd65b294]
        [urn=urn:pulumi:dev::aws-ts::aws:rds/instance:Instance::postgresdb]
        [provider=urn:pulumi:dev::aws-ts::pulumi:providers:aws::default_5_41_0::5199a248-3c92-4b11-ae4e-dbf860fd2c76]

Expected Behavior

No change in preview.

Steps to reproduce

  1. Deploy this program with the latest ^5.0.0 of AWS provider:
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as random from "@pulumi/random";

const dbName = "airflow"
const dbUser = "airflow"

const airflowPassword = new random.RandomPassword(`airflow-password`, {
    length: 16,
    special: false,
});

const db = new aws.rds.Instance("postgresdb", {
    engine: "postgres",

    instanceClass: "db.t4g.micro",
    allocatedStorage: 30,

    name: dbName,
    username: dbUser,
    password: airflowPassword.result,

    skipFinalSnapshot: true,
});
  1. Upgrade to 6.0.
  2. Run pulumi preview.

Output of pulumi about

CLI          
Version      3.74.0
Go Version   go1.20.5
Go Compiler  gc

Plugins
NAME    VERSION
aws     6.0.0
nodejs  unknown
random  4.13.2

Host     
OS       darwin
Version  13.4.1
Arch     arm64

This project is written in nodejs: executable='/opt/homebrew/bin/node' version='v20.4.0'

Current Stack: mikhail-pulumi-corp/aws-ts/dev

TYPE                                        URN
pulumi:pulumi:Stack                         urn:pulumi:dev::aws-ts::pulumi:pulumi:Stack::aws-ts-dev
pulumi:providers:random                     urn:pulumi:dev::aws-ts::pulumi:providers:random::default_4_13_2
random:index/randomPassword:RandomPassword  urn:pulumi:dev::aws-ts::random:index/randomPassword:RandomPassword::airflow-password
pulumi:providers:aws                        urn:pulumi:dev::aws-ts::pulumi:providers:aws::default_5_41_0
aws:rds/instance:Instance                   urn:pulumi:dev::aws-ts::aws:rds/instance:Instance::postgresdb


Found no pending operations associated with dev

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/mikhail-pulumi-corp
User           mikhail-pulumi-corp
Organizations  mikhail-pulumi-corp, pulumi

Dependencies:
NAME            VERSION
@pulumi/aws     6.0.0
@pulumi/pulumi  3.74.0
@pulumi/random  4.13.2
@types/node     16.18.38

Pulumi locates its logs in /var/folders/8g/ntvfz6q153q0mx7k8h7_y1j80000gn/T/ by default

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

@mikhailshilkov mikhailshilkov added kind/bug Some behavior is incorrect or out of spec p0 A bug severe enough to interrupt existing work needs-triage Needs attention from the triage team labels Aug 8, 2023
@mikhailshilkov mikhailshilkov pinned this issue Aug 8, 2023
@mikhailshilkov
Copy link
Member Author

Replacement doesn't show up if I create the instance with 6.0 in the first place, and then do a preview

@iwahbe iwahbe self-assigned this Aug 8, 2023
@iwahbe iwahbe added the bug/diff kind/bug related to Pulumi generating wrong diffs on preview or up. label Aug 8, 2023
@mikhailshilkov
Copy link
Member Author

mikhailshilkov commented Aug 8, 2023

The issue is reproduced in 6.0.0-alpha.1 as well (and all of alpha 5, 7, 8), the same diff

~ name: "airflow" => "airflow"

@lukehoban
Copy link
Member

lukehoban commented Aug 8, 2023

A few questions/notes:

  1. Have we identified any other resources that experience this issue - or is it so far only aws.rds.Instance?
  2. Is the [provider: urn:pulumi:dev::aws-ts::pulumi:providers:aws::default_5_41_0::5199a248-3c92-4b11-ae4e-dbf860fd2c76 => urn:pulumi:dev::aws-ts::pulumi:providers:aws::default_6_0_0::output<string>] part of the diff unrelated, and is it expected?
  3. The name property was removed from the upstream provider in rds/instance: NEW ID configuration hashicorp/terraform-provider-aws#31232, as part of the v5 release. It had been deprecated for some time before that and renamed to db_name as of r/db_instance: deprecate name and add db_name hashicorp/terraform-provider-aws#22668.

@t0yv0 t0yv0 added p1 A bug severe enough to be the next item assigned to an engineer and removed p0 A bug severe enough to interrupt existing work labels Aug 8, 2023
@iwahbe iwahbe removed the needs-triage Needs attention from the triage team label Aug 9, 2023
@mikhailshilkov mikhailshilkov added this to the 0.92 milestone Aug 10, 2023
t0yv0 added a commit that referenced this issue Aug 11, 2023
Fixes #2682

With this change "name" property is deprecated on aws.db.Instance in favor of "dbName". Continuing to use it should sill work as expected but will now generate a warning.

---------

Co-authored-by: Anton Tayanovskyy <[email protected]>
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Aug 11, 2023
@t0yv0 t0yv0 unpinned this issue Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/diff kind/bug related to Pulumi generating wrong diffs on preview or up. kind/bug Some behavior is incorrect or out of spec p1 A bug severe enough to be the next item assigned to an engineer resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants