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

The CloudFormation Resource Provider Package For AWS CloudFormation
https://aws.amazon.com/cloudformation/
Apache License 2.0
48 stars 35 forks source link

SkyTrain-NS-259 Bugfix: Ensure same client request token is used when register-type is resent #65

Closed MalikAtalla-AWS closed 3 years ago

MalikAtalla-AWS commented 3 years ago

The CreateHandler is being called multiple times by the CloudFormation framework (documented for example here), so we have to make sure it's idempotent. To do that we ensure the same clientRequestToken is sent along with the register type call. The current bug is triggered because the random clientRequestTokens cause the hash of the RegisterTypeRequest to be different between CreateHandler invokation which causes CFN to resend the request (see hashing of the request here)

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