hashicorp / aws-cloudformation-resource-schema-sdk-go

This package provides AWS CloudFormation Resource Schema functionality in Go
Mozilla Public License 2.0
5 stars 2 forks source link

update sanitize function so that it works when schema is an unindented json string #46

Closed crazyo closed 1 year ago

crazyo commented 1 year ago

Currently Terraform breaks for AWS CloudControl resources with error mentioned in this issue: https://github.com/hashicorp/terraform-provider-aws/issues/26351

The root cause being CloudFormation describe-type returns the schema as an unindented JSON string, something like this: {"handlers":{"read":{"permissions":["lambda:GetFunction","lambda:GetFunctionCodeSigningConfig"]},"create":{"permissions":["lambda:CreateFunction",...<too long, redacted>..., and the Sanitize function can only replace patterns that appear on its own line.

This PR updates the Sanitize function to work with the above format.

crazyo commented 1 year ago

Hi 👋 can someone help take a look? @ewbankkit @johnsonaj @bflad @breathingdust . Thanks a lot 🙏

ewbankkit commented 1 year ago

@crazyo Thanks for the contribution :tada: :clap:.

crazyo commented 1 year ago

Awesome! No problem and thanks for merging it! @ewbankkit will you also be releasing a new version of terraform-provider-aws with aws-cloudformation-resource-schema-sdk-go bumped to this version?

ewbankkit commented 1 year ago

@crazyo Yes, I will get https://github.com/hashicorp/terraform-provider-aws/pull/27935 merged today and it will be included in v4.41.0 of the Terraform AWS Provider later this week (most likely Thursday).

crazyo commented 1 year ago

Sounds good. Thank you!