aws-solutions / aws-control-tower-customizations

The Customizations for AWS Control Tower solution combines AWS Control Tower and other highly-available, trusted AWS services to help customers more quickly set up a secure, multi-account AWS environment using AWS best practices.
https://docs.aws.amazon.com/controltower/latest/userguide/cfct-overview.html
Apache License 2.0
360 stars 205 forks source link

Use EnvVar values for updating stacksets #50

Closed GraemeKnights closed 3 years ago

GraemeKnights commented 3 years ago

Alter the update_stack_set function to use self.failed_tolerance_percent and self.max_concurrent_percent (which are both sourced from OS EnvVars) like the update_stack_instances and delete_stack_set functions do

Issue #, if available: No issue Description of changes: The update_stack_set function doesn't respect the FAILED_TOLERANCE_PERCENT and MAX_CONCURRENT_PERCENT environment variables that are set on the lambda in the same way that the update_stack_instances and delete_stack_set functions do.

Currently this function is invoked from the update_stack_set function in state_machine_handler.py, but even this function does not pass any failed_tolerance_percent or max_concurrent_percent variables through meaning they are effectively hardcoded as failed_tolerance_percent=0 and max_concurrent_percent=100.

This change modifies the update_stack_set function to use self.failed_tolerance_percent and self.max_concurrent_percent instead, which are both sourced from the lambdas environment variables (if any, otherwise they use a default value)

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

groverlalit commented 3 years ago

@GraemeKnights The requested PR change is already in v1.2.0 release. For details see commit details.

GraemeKnights commented 3 years ago

@groverlalit I can see how this was implemented in 1.2.0 for all the StackSet functions /except/ 'update_stack_set' in cloudformation.py. I'm running the 1.2.0 code in my environment currently and was not able to update my StackSets with a custom failure tolerance specified until I made this change.

Perhaps that particular function was missed? Or maybe I'm missing something obvious. If you are quite certain the issue has been fixed in a release after 1.2.0 then I guess we can just close this off. :)

groverlalit commented 3 years ago

@GraemeKnights Apologies for the confusion. You are correct that we missed this change for Update stack set API . We will apply this change in the next release. Thanks for opening the pull request.

groverlalit commented 3 years ago

This change was released in v2.1.0.