Hey friends, we migrated from `aws.s3.Bucket` to `...
# aws
a
Hey friends, we migrated from
aws.s3.Bucket
to
aws.s3.BucketV2
a while ago. Everything was working. We now started getting these errors:
Copy code
Diagnostics:
  aws:s3:BucketV2 (xxx):
    error:   sdk-v2/provider2.go:515: sdk.helper_schema: missing expected [: provider=aws@6.66.3
    error: diffing urn:pulumi:prod::apps::aws:s3/bucketV2:BucketV2::xxx: 1 error occurred:
        * [server_side_encryption_configuration] missing expected [
I found this ticket which seems related https://github.com/pulumi/pulumi-aws/issues/4471, but I'm not entirely sure whether this is the issue. Is it still aliasing if we fully migrated back when we upgraded? Do you have any advice on how I could fix the state or fix the compatibility issue? The stack is now effectively broken since no changes can be made at all. We have
dev
and
prod
stacks of the same project and weirdly the issue only appears in
prod
.
dev
is working fine. I'm 99% sure we did the exact same migration for both stacks. Thanks!
looking at the resources using
pulumi stack export
I can see that the outputs for the same bucket in the different stacks is quite different. I think I could probably "fix" it manually.... is there a way to edit the stack json? or is delete + reimport the only way? I'm a bit hesitant to do this because sadly the prod stack is affected. If it was dev it would be easier....
fixed by manually editing state via
pulumi state edit
was scary
diff output would be nice
e
Sorry you're seeing this. Mind sharing the nature of edits you had to do in
pulumi state edit
?
https://github.com/pulumi/pulumi-aws/issues/4471 would be in play if you have aws.s3.Bucket in the state file, but then edit the program to say aws.s3.BucketV2 and run a pulumi up. Because of how the system is setup it will send the Bucket's state to the BucketV2 code. Unfortunately that requires something akin to database migrations that have bit-rotted (that's 4471).
But perhaps you are seeing something else?
a
Sure. These two properties are now plural and arrays. It looks like they weren't migrated properly. Adding an
s
to the name and wrapping the object in an array solved the issue.
Copy code
"serverSideEncryptionConfiguration": {
  "rule": {
      "applyServerSideEncryptionByDefault": {
          "kmsMasterKeyId": "",
          "sseAlgorithm": "AES256"
      },
      "bucketKeyEnabled": true
  }
},
"versioning": {
    "enabled": false,
    "mfaDelete": false
},
Copy code
"serverSideEncryptionConfigurations": [
  {
    "rules": [
      {
        "applyServerSideEncryptionByDefaults": [
          {
            "kmsMasterKeyId": "",
            "sseAlgorithm": "AES256"
          }
        ],
        "bucketKeyEnabled": true
      }
    ]
  }
],
"versionings": [
  {
    "enabled": false,
    "mfaDelete": false
  }
],
e
Checking up, yes at glance it sounds like 4471. Please upvote. I'll try to prioritize this again with our team .
a
cool, thanks