AWS Provider mis parsing the state for redis
See original GitHub issueI have a complete production environment setup by Pulumi. Yesterday I upgraded to Pulumi 3 and upgraded all npm packages to their latest.
“@pulumi/aws”: “^4.0.0”, “@pulumi/awsx”: “^0.30.0”, “@pulumi/cloudflare”: “^3.0.0”, “@pulumi/eks”: “^0.30.0”, “@pulumi/kubernetes”: “^3.0.0”, “@pulumi/pulumi”: “^3.0.0”, “@pulumi/random”: “^4.0.0”
After this I ran pulumi refresh
to sync the state with aws but once I ran pulumi up
I keep getting this error
aws:elasticache:Cluster (platform): error: unmarshaling urn:pulumi:production::at-platform::aws:elasticache/cluster:Cluster::platform’s instance state: could not read field snapshot_arns: ‘’ expected type ‘string’, got unconvertible type ‘[]interface {}’, value: ‘[]’
I opened a ticket with support and after further investigation from their side and more information they asked me about, they said that the issue is from the AWS Provider and asked me to open an issue here.
The code to create the redis that I used is
new aws.elasticache.Cluster(options.name, { engine: “redis”, engineVersion: “5.0.6”, clusterId: options.name, maintenanceWindow: “sat:03:00-sat:04:00”, nodeType: options.nodeType, subnetGroupName: options.redisSubnetGroup.name, securityGroupIds: [options.redisSecurityGroup.id], numCacheNodes: 1, parameterGroupName: “default.redis5.0”, applyImmediately: true });
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:6 (1 by maintainers)
As a workaround for anyone else that gets into this situation, you can do the following to “fix” your state and get unblocked.
pulumi stack export --file exported-stack.json
exported-stack.json
file forsnapshotArns
. It should be under outputs on youraws:elasticache/cluster:Cluster
resources and look like"snapshotArns": [],
.exported-stack.json
pulumi stack import --file exported-stack.json
pulumi up
to ensure you are unblockedStrange. I am also getting this problem, with the same error, but I don’t actually have
snapshotArns
in my state export at all. What I had to do is a non-refreshed update and then I could do the refresh fine. I was updating from aws3.30.0
to4.5.1
and pulumi2.21.2
.