terraform-provider-awscc icon indicating copy to clipboard operation
terraform-provider-awscc copied to clipboard

Ignore empty patch document for Cloud Control API UpdateResource

Open wellsiau-aws opened this issue 6 months ago • 0 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the CloudFormation Open Coverage Roadmap.

Description

In some cases, AWSCC provider might generate empty patch document for update resource. For example, issues #1216 can cause unnecessary drift where plan modifiers will cancel the drift, generating an empty patch document.

Currently the patch document is taken by comparing desired vs current state (https://github.com/hashicorp/terraform-provider-awscc/blob/v1.10.0/internal/generic/resource.go#L572). However, it didnt take into account for an empty patch document.

As result, its possible that AWSCC sent empty payload to CCAPI UpdateResource. Each resources in CCAPI act differently when it gets empty patch, for example it might automatically returning 400 error or in worst-case scenario, continuously loop until timeout.

New or Affected Resource(s)

I propose that we add conditional in the Update handler to ignore empty patch document.

References

  • #1216

wellsiau-aws avatar Aug 19 '24 16:08 wellsiau-aws