cloudformation-cli
cloudformation-cli copied to clipboard
Contract tests security token expire for publishing contract test logs and metrics
We are currently working on an CFN resource which has long running contract tests (~4hrs in total). And we found when we run contract tests through cfn submit, the contract lambda logs uploaded to cloudwatch is incomplete and sometimes we can see this log messge:
an error occurred while publishing metrics: The security token included in the request is expired (Service: CloudWatch, Status Code: 400, Request ID: f7185979-e0b0-4a3f-80f4-5771a0ac9abc, Extended Request ID: null)
I did some investigation, looks like since this PR, the security token expire issue is fixed for caller credentials, however, the provider credential request_body["requestData"]["providerCredentials"] used for log and metric publishing is not refreshed in each handler invocation and can timeout for resources with long running contract tests, and in this case we are not able to see the complete lambda logs.