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

The CloudFormation Resource Provider Package For AWS Step Functions
https://aws.amazon.com/step-functions/
Apache License 2.0
6 stars 4 forks source link

Add static stabilization to Activity Delete handler #54

Closed hongkuntian closed 5 months ago

hongkuntian commented 5 months ago

Issue #, if available: N/A

Description of changes:

Remove dynamic stabilization (revert) and subsequently

Add static stabilization to AWS::StepFunctions::Activity resource's Delete handler

DescribeActivity operation is eventually consistent. The results are best effort and may not reflect very recent updates and changes. This results in the Read handler not always retrieving the correct state after the deletion of an activity. (e.g. Invoke Delete handler, and the immediately invoking Read handler may return the activity details despite the activity having been deleted)

This change makes it so that our resource strictly adheres to CloudFormation's resource type handler contract:

A read handler MUST return FAILED with a NotFound error code if the resource doesn't exist.

A delete handler MUST return FAILED with a NotFound error code if the resource didn't exist before the delete request.

This change adds the following logic to stabilize the deletion:

Testing:

mvn test succeeds, and ran pre-commit run --all-files

Ran contract tests locally and all runs have succeeded.

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