-
Notifications
You must be signed in to change notification settings - Fork 159
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
BucketV2 to Bucket aliasing is no longer working #4471
Comments
We ran into the same issue. Fixed by manually editing the state via In all resources of type Old"serverSideEncryptionConfiguration": {
"rule": {
"applyServerSideEncryptionByDefault": {
"kmsMasterKeyId": "",
"sseAlgorithm": "AES256"
},
"bucketKeyEnabled": true
}
},
"versioning": {
"enabled": false,
"mfaDelete": false
}, New"serverSideEncryptionConfigurations": [
{
"rules": [
{
"applyServerSideEncryptionByDefaults": [
{
"kmsMasterKeyId": "",
"sseAlgorithm": "AES256"
}
],
"bucketKeyEnabled": true
}
]
}
],
"versionings": [
{
"enabled": false,
"mfaDelete": false
}
], |
@dstockhammer thanks for the info! It looks like in order for us to fix this we need to do some state transforms. Maybe something like this to convert all the objects to arrays. TransformFromState: func(ctx context.Context, props resource.PropertyMap) (resource.PropertyMap, error) {
if versioning, ok := props["versioning"]; ok && versioning.IsObject() {
props["versionings"] = resource.NewArrayProperty([]resource.PropertyValue{versioning})
delete(props, "versioning")
} It would be a bit verbose because there are some properties that have nested properties that need to be converted. Maybe there is a way to walk the schema and add a transform for every property that changed to an array. |
There's a few more discrepancies between the schemas of Bucket vs BucketV2 that have accumulated over time, perhaps worth checking out in case we can program a complete migration method. |
Describe what happened
BucketV2 is aliased to Bucket but is not able to seamlessly read its state.
References: #4470
Sample program
Starting from this program:
And going to this program:
The alias kicks in and sends the Bucket state to the BucketV2 resource to process. However due to the accumulated schema drift, the reading of the Bucket state no longer works. Instead it generates this error:
Log output
See above.
Affected Resource(s)
Bucket
BucketV2
Output of
pulumi about
Additional context
We must have regressed this somewhere but failed to call out in https://www.pulumi.com/blog/announcing-6-0-of-the-pulumi-aws-classic-provider/
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).
The text was updated successfully, but these errors were encountered: