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

Mark state machine type immutable #31

Closed jormello closed 2 years ago

jormello commented 2 years ago

Issue#: https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/671

Description of changes: The StateMachineType property is being included under createOnlyProperties, as the type of the state machine should not be changed after the resource is created.

This change makes it so that any updates to StateMachineType will result in resource replacement.

Testing: Successfully tested by running cfn submit --region ap-northeast-3 --no-role --set-default, then attempting a StateMachineType update on an existing stack. The state machine resource was replaced and the new resource had the correct type.

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

wong-a commented 2 years ago

Remember to link the related GitHub issue when there is one (hopefully that's the case 100% of the time).

https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/671

wong-a commented 2 years ago

What was the behaviour before? Does it fail or do nothing? UpdateStateMachine doesn't have a stateMachineType parameter.

jormello commented 2 years ago

What was the behaviour before? Does it fail or do nothing? UpdateStateMachine doesn't have a stateMachineType parameter.

The current behavior is that the resource update succeeds, but without actually applying the modified StateMachineType. Any updates to the state machine definition will go through.

jormello commented 2 years ago

Do we have tests done for this PR? Would love to confirm:

  1. Before this change, update this property results in failure
  2. After this change, when this property got updated, the state machine will be replaced.

These changes will be tested through our integration test suite.