pulumi-aws: Updating the tags of an RDS instance is causing a replace to happen (which then fails).

Reported by @jasonhedges. They have an RDS db instance. During a minor change to their program (to just add tags to the instance) they encountered the following behavior.

Pulumi stated (even during preview) that there would just be a change to tags. However, at the same time, it specified that a replace would happen (which shouldnt’ happen just with a change to tags).

Investigating this, it was determined that pulumi wants to do a replace here because the storageEncrypted value changed on the instance.

When manual refreshes were performed, pulumi completed successfully, with no change to the storageEncrypted value.

There are several issues here:

  1. that the UI doesn’t properly state the reason we think a replace is necessary. that’s not great, but is more misleading, than being critically broken.
  2. that update/refresh are somehow not consistent here in terms of how they’re reading in this value. ‘refresh’ thinks all the values are fine, and doesn’t want to change anything. But update thinks this value is changing.
  3. that update thinks this value is changing at all (even though only tags changed).

Overall, this brokenness has led to Jason being unable to change his resource in a simple way that should be totally supported. From quickly skimming logs, i couldn’t see anything standing out that obviously showed what the issue is. Ihave a feeling someone will have to spelunk into the provider side of things to see why these values are coming back in this manner and causing the problems.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (13 by maintainers)

Most upvoted comments

So I was able to recreate this and find out that the documentation around read_replicas is just terrible, both here, and in terraform. The following config works:

const defaultInstance = new aws.rds.Instance("default", {
    allocatedStorage: 20,
    engine: "mysql",
    engineVersion: "5.7",
    instanceClass: "db.t2.micro",
    name: "mydb",
    parameterGroupName: "default.mysql5.7",
    password: "foobarbaz",
    storageType: "gp2",
    username: "foo",
    backupRetentionPeriod: 30,
    backupWindow: "03:00-04:00", // UTC
    skipFinalSnapshot: true,

    tags: {
        Name: "test",
        Foo: "bar",
    }
});

const replicaInstance = new aws.rds.Instance("replica", {
    instanceClass: "db.t2.micro",
    skipFinalSnapshot: true,

    replicateSourceDb: defaultInstance.identifier,

    tags: {
        Name: "test",
        Foo: "bar",
    }
});

export const replicaID= replicaInstance.identifier;
export const mainDB = defaultInstance.identifier;

export const mainEndpoint = defaultInstance.endpoint

That creates the correct read replica. It also stops us being able to get spurious diffs. We can improve the documentation in the area greatly to help our users.