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

aws.elasticache.ReplicationGroup type error #4339

Open
javier-accruemoney opened this issue Aug 1, 2024 · 8 comments
Open

aws.elasticache.ReplicationGroup type error #4339

javier-accruemoney opened this issue Aug 1, 2024 · 8 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec needs-repro Needs repro steps before it can be triaged or fixed

Comments

@javier-accruemoney
Copy link

javier-accruemoney commented Aug 1, 2024

Describe what happened

While trying to update an Elasticache Replication Group have a type mismatch error:

Sample program

new aws.elasticache.ReplicationGroup(name, {
        applyImmediately: true,
        automaticFailoverEnabled: false,
        clusterMode: 'disabled',
        engineVersion: '7.0',
        nodeType: ElasticacheNodeType,
        multiAzEnabled: false,
        numCacheClusters: 1,
        port: 6379,
        description: 'Redis replication groups',
        snapshotRetentionLimit: 30,
        securityGroupIds: [**redisSecurityGroupID**],
        subnetGroupName: **subnetGroup.name**,
        replicationGroupId: name,
      });

Log output

Diagnostics:
aws:elasticache:ReplicationGroup (XXXXXXXXX):
error: unmarshaling urn:pulumi:XXXXX::XXXX::aws:elasticache/replicationGroup:ReplicationGroup::XXXXXXXX instance state: could not read field cluster_mode: '' expected type 'string', got unconvertible type 'map[string]interface {}', value: 'map[numNodeGroups:1 replicasPerNodeGroup:0]'

Affected Resource(s)

aws.elasticache.ReplicationGroup

Output of pulumi about

CLI
Version 3.108.0
Go Version go1.22.0
Go Compiler gc

Plugins
NAME VERSION
aws 6.47.0
awsx 2.13.0
datadog 4.31.0
docker 4.5.5
docker 3.6.1
nodejs unknown

Host
OS darwin
Version 14.4.1
Arch arm64

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

@javier-accruemoney javier-accruemoney added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Aug 1, 2024
@corymhall
Copy link
Contributor

@javier-accruemoney you mention that the error occurs during an update, can you provide the before/after configuration that you used? Thanks!

@corymhall corymhall added needs-repro Needs repro steps before it can be triaged or fixed awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Aug 1, 2024
@javier-accruemoney
Copy link
Author

Elasticache replication group configuration was not changed, even though, during pulumi preview got the unmarshaling error.

Just tested with release v6.45.0 and issue is not preset, it starts with v6.46.0

@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Aug 1, 2024
@corymhall
Copy link
Contributor

@javier-accruemoney what version of pulumi-aws & pulumi was the cluster created with? I tested creating with 6.47.0 and I tested creating with 6.45.0 and updating to 6.46.0 and wasn't able to reproduce. I'm assuming there is some upgrade issue, but you need to have used a certain prior version.

@corymhall corymhall added awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Aug 5, 2024
@javier-accruemoney
Copy link
Author

That's correct, those resources have more than a year of created and can't tell with which was the version from where those resources where created, but the last working one is 6.45.0

@corymhall corymhall self-assigned this Aug 7, 2024
@corymhall
Copy link
Contributor

@javier-accruemoney if you run pulumi stack export and then find the ReplicationGroup resource it should have a provider entry with the version of the aws provider used.

@t0yv0
Copy link
Member

t0yv0 commented Aug 8, 2024

It appears there is some complicated upstream evolution history here that might be causing this problem.

hashicorp/terraform-provider-aws@a00ceec removes cluster_mode parameter that had a complex type

hashicorp/terraform-provider-aws@f893c22 reintroduces cluster_mode of string type

Pulumi bridged provider inherited these changes. I suspect the users of the TF provider may also be affected here. Ideally, the upgrades could have been supported by writing state migration code that automatically moves over user states to the new schema for the resource, but it appears this has not been done in the case of this resource.

To quickly workaround the issue state surgery, pulumi stack export, edit the state by manually migrating it to the new expected shape, followed by pulumi stack import.

@mikhailshilkov mikhailshilkov removed the awaiting-feedback Blocked on input from the author label Aug 21, 2024
@akgoel18
Copy link

CLI          
Version      3.121.0
Go Version   go1.22.4
Go Compiler  gc

Host     
OS       darwin
Version  14.5
Arch     arm64

Backend        
Name           pulumi.com
URL            https://app.pulumi.com
User           Unknown
Organizations  
Token type     personal

pulumi about command output should look like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec needs-repro Needs repro steps before it can be triaged or fixed
Projects
None yet
Development

No branches or pull requests

6 participants