[Bug fix] fix expanding process for operation_preferences.region_order in CloudFormation StackSet #41810
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
To resolve the issue reported by [Enhancement]: aws_cloudformation_stack_set_instance #41767.
fix a process of expanding (i.e. deserializing from terraform configuration) "region_order" in operation_preferences used in
aws_cloudformation_stack_set
,aws_cloudformation_stack_instances
andaws_cloudformation_stack_set_instance
.tabito-hara@bff75ff
The original one:
It has been modified as:
Add acctests for the
region_order
attribute.region_order
are correctly implemented. (Even without the modifications in this branch, the acctests still pass.) However, these tests help observe changes in behavior, such as modifications to the request body of actions.operational_preferences
block (which includesregion_order
) is not refreshed during Terraform's read process; it exists solely as an internal attribute within Terraform.region_order
is correctly retained in the Terraform state (tfstate
), not that the resource is created according to the configuration specified in theoperation_preference
block.DescribeStackSetOperation
returns attributes inoperational_preferences
, but only during operations. This action describes the operational configuration of a specific operation, requiring anoperationId
to request it.region_order
is effective only whenauto_deployment
is set tofalse
. In tests related toregion_order
,auto_deployment
is explicitly set tofalse
.Verification
The following acctests were conducted with TF_LOG=DEBUG environment variables.
CreateStackInstances
in TestAccCloudFormationStackSetInstance_regionOrder is as follows:You do not find "OperationPreferences.RegionOrder" in the request parameters.
And the response of
DescribeStackSetOperation
, called to check progress in the test, includes empty RegionOrder as follows:RegionOrder
is empty.On the other hand, with the modification of this branch, "OperationPreferences.RegionOrder" is included in the request body of
CreateStackInstances
:the response of
DescribeStackSetOperation
showsRegionOrders
as expected.You can find the same result in running
TestAccCloudFormationStackInstances_regionOrder
.Relations
Closes #41767
References
Cloudformation API Reference -- StackSetOperationPreferences
Output from Acceptance Testing
CloudFormationStackSet
CloudFormationStackInstances
CloudFormationStackSetInstance