aws-cloudformation / aws-cloudformation-resource-providers-redshift

The CloudFormation Resource Provider Package For Amazon Redshift
https://aws.amazon.com/redshift/
Apache License 2.0
3 stars 13 forks source link

Sanitize wlm_json_configuration then compare #137

Closed mashuaihh closed 1 year ago

mashuaihh commented 1 year ago

Before this commit, we sometimes update wlm_json_configuration when we should not. We decide whether to update (call modifyClusterParameterGroup) by checking the wlm_json_configuration provided by cx in cfn template vs. the one we fetch by calling describe API. But the wlm_json_configuration returned by describe API is sanitized by Redshift backend. So many times wlm_json_configuration comparison would tell us we should update.

This commit sanitizes both new and old (from api) wlm_json_configuration then compare if they are equal. We can do a more precise job by comparing if the two string evaluates to the same JSON object, but too much effort involved for now.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.