This message was deleted.
# aws
s
This message was deleted.
p
This is the relevant section in the ts file for this deployment
Copy code
const redis = new elasticache.Cluster(
    `redis-${deploymentName}`,
    {
      // azMode,
      numCacheNodes: 1,
      engine: 'redis',
      // engineVersion: '6.x',
      engineVersion: '6.0.5',
      nodeType: 'cache.m4.large',
      subnetGroupName: redisSubnetGroup.id,
      securityGroupIds: [redisSecurityGroup.id],
      port: 6379
    }
    // { ignoreChanges: ['engineVersion'] }
  )
l
You could try ignoring snapshotArns? The docs say that snapshotArns must be a single-element array, so if ignoring it doesn't work, you could try changing it to
"snapshotArns":[""]
?
However ignoring it looks like the safer option...
p
let me try that
ok, tried
{ ignoreChanges: ['snapshotArns'] }
and then tried
snapshotArns: [""]
and
snapshotArns: ''
. All three are producing errors. The ignore changes produces this error:
Copy code
error: aws:elasticache/cluster:Cluster resource 'redis-temp' has a problem: Attribute must be a single valu
e, not a list. Examine values at 'Cluster.SnapshotArns'.
While the last produced the same error as originally posted. Using the
[]
in the middle gives me an error in the editor
Copy code
Type 'string[]' is not assignable to type 'Input<string> | undefined'.
  Type 'string[]' is not assignable to type 'string'.
l
Hmm... yea, I read the definition of the param without reading the type of the param.
string
is correct, and the definition Single-element string list is wrong.
Since the attribute is not in your code, and the problem is happening during an
up
, then I infer that there's a difference between what's in the state and what the provider requires. Possibly the provider's version has changed recently? Maybe running
pulumi refresh
, at least on that resource, would "fix" the Pulumi state?
p
I have tried that. I exported the state and manually deleted the two snapshotArns lines then imported that and did a refresh
l
And refresh puts the "snapshotArns": [] back? Hmm.. that's awkward.
p
yeah
I've put a refresh just before the pulumi up in my code deploy to see if that changes anything which is running now
l
You can put
--refresh
in the parameters to a preview or up...
p
good to know
l
Also you can export just before and after a refresh, to see what changes...
I think we should find out who created the provider and ask for help from dev team...
Or raise an issue on github.
p
actually I think we already had that... we have a
-r
in our pulumi up command
l
Maybe try removing that after editing your state? Perhaps you're fixing it then overwriting your fix before `up`ing.
p
just tried the export, remove the snapshotArns from the state file, and then reimported. did a
pulumi up --non-interactive --yes -r
which failed with the same error. then re-exported teh state to confirm and the snapshotArns lines were gone
l
Try it without the
-r
. That will be updating your state after you import it and before the
up
.
You want to test your version of the state, not the providers' version.
If that works, then you know there's an issue / bug in the provider, and you should raise it in GitHub.
p
ok, so I removed the
-r
. Manually refreshed the state with
pulumi refresh
, exported the state and manually removed the lines containing `snapshotArns`and then re-imported the state. Then did
pulumi up --non-interactive --yes
which has now resulted in a new error about existing securityGroups which is not related to the original issue.
so it appears that by removing those lines from state and updating the state manually worked around the initial issue.
without doing a
refresh
inbetween steps
I'll write up a bug report into Github tomorrow morning on this
👍 1