update_stack_set
async
¶
update_stack_set(
*,
config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
stack_set_name: Optional[StackSetName] = None,
description: Optional[Description] = None,
template_body: Optional[TemplateBody] = None,
template_url: Optional[TemplateURL] = None,
use_previous_template: Optional[UsePreviousTemplate] = None,
parameters: Optional[Parameters] = None,
capabilities: Optional[Capabilities] = None,
tags: Optional[Tags] = None,
operation_preferences: Optional[StackSetOperationPreferences] = None,
administration_role_arn: Optional[RoleARN] = None,
execution_role_name: Optional[ExecutionRoleName] = None,
deployment_targets: Optional[DeploymentTargets] = None,
permission_model: Optional[PermissionModels] = None,
auto_deployment: Optional[AutoDeployment] = None,
operation_id: Optional[ClientRequestToken] = None,
accounts: Optional[AccountList] = None,
regions: Optional[RegionList] = None,
call_as: Optional[CallAs] = None,
managed_execution: Optional[ManagedExecution] = None,
) -> UpdateStackSetOutput
Updates the StackSet and associated stack instances in the specified accounts and Amazon Web Services Regions.
Even if the StackSet operation created by updating the StackSet fails (completely or partially, below or above a specified failure tolerance), the StackSet is updated with your changes. Subsequent CreateStackInstances calls on the specified StackSet use the updated StackSet.
The maximum number of organizational unit (OUs) supported by a UpdateStackSet operation is 50.
If you need more than 50, consider the following options:
-
Batch processing: If you don't want to expose your OU hierarchy, split up the operations into multiple calls with less than 50 OUs each.
-
Parent OU strategy: If you don't mind exposing the OU hierarchy, target a parent OU that contains all desired child OUs.
Parameters:
-
stack_set_name(Optional[StackSetName], default:None) –The name or unique ID of the StackSet that you want to update.
-
description(Optional[Description], default:None) –A brief description of updates that you are making.
-
template_body(Optional[TemplateBody], default:None) –The structure that contains the template body, with a minimum length of 1 byte and a maximum length of 51,200 bytes.
Conditional: You must specify only one of the following parameters:
TemplateBodyorTemplateURL—or setUsePreviousTemplateto true. -
template_url(Optional[TemplateURL], default:None) –The URL of a file that contains the template body. The URL must point to a template (maximum size: 1 MB) that is located in an Amazon S3 bucket or a Systems Manager document. The location for an Amazon S3 bucket must start with
https://. S3 static website URLs are not supported.Conditional: You must specify only one of the following parameters:
TemplateBodyorTemplateURL—or setUsePreviousTemplateto true. -
use_previous_template(Optional[UsePreviousTemplate], default:None) –Use the existing template that's associated with the StackSet that you're updating.
Conditional: You must specify only one of the following parameters:
TemplateBodyorTemplateURL—or setUsePreviousTemplateto true. -
parameters(Optional[Parameters], default:None) –A list of input parameters for the StackSet template.
-
capabilities(Optional[Capabilities], default:None) –In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order for CloudFormation to update the StackSet and its associated stack instances.
-
CAPABILITY_IAMandCAPABILITY_NAMED_IAMSome stack templates might include resources that can affect permissions in your Amazon Web Services account, for example, by creating new IAM users. For those stacks sets, you must explicitly acknowledge this by specifying one of these capabilities.
The following IAM resources require you to specify either the
CAPABILITY_IAMorCAPABILITY_NAMED_IAMcapability.-
If you have IAM resources, you can specify either capability.
-
If you have IAM resources with custom names, you must specify
CAPABILITY_NAMED_IAM. -
If you don't specify either of these capabilities, CloudFormation returns an
InsufficientCapabilitieserror.
If your stack template contains these resources, we recommend that you review all permissions associated with them and edit their permissions if necessary.
For more information, see Acknowledging IAM resources in CloudFormation templates.
-
-
CAPABILITY_AUTO_EXPANDSome templates reference macros. If your StackSet template references one or more macros, you must update the StackSet directly from the processed template, without first reviewing the resulting changes in a change set. To update the StackSet directly, you must acknowledge this capability. For more information, see Perform custom processing on CloudFormation templates with template macros.
StackSets with service-managed permissions do not currently support the use of macros in templates. (This includes the AWS::Include and AWS::Serverless transforms, which are macros hosted by CloudFormation.) Even if you specify this capability for a StackSet with service-managed permissions, if you reference a macro in your template the StackSet operation will fail.
-
-
tags(Optional[Tags], default:None) –The key-value pairs to associate with this StackSet and the stacks created from it. CloudFormation also propagates these tags to supported resources that are created in the stacks. You can specify a maximum number of 50 tags.
If you specify tags for this parameter, those tags replace any list of tags that are currently associated with this StackSet. This means:
-
If you don't specify this parameter, CloudFormation doesn't modify the stack's tags.
-
If you specify any tags using this parameter, you must specify all the tags that you want associated with this StackSet, even tags you've specified before (for example, when creating the StackSet or during a previous update of the StackSet.). Any tags that you don't include in the updated list of tags are removed from the StackSet, and therefore from the stacks and resources as well.
-
If you specify an empty value, CloudFormation removes all currently associated tags.
If you specify new tags as part of an
UpdateStackSetaction, CloudFormation checks to see if you have the required IAM permission to tag resources. If you omit tags that are currently associated with the StackSet from the list of tags you specify, CloudFormation assumes that you want to remove those tags from the StackSet, and checks to see if you have permission to untag resources. If you don't have the necessary permission(s), the entireUpdateStackSetaction fails with anaccess deniederror, and the StackSet is not updated. -
-
operation_preferences(Optional[StackSetOperationPreferences], default:None) –Preferences for how CloudFormation performs this StackSet operation.
-
administration_role_arn(Optional[RoleARN], default:None) –[Self-managed permissions] The Amazon Resource Name (ARN) of the IAM role to use to update this StackSet.
Specify an IAM role only if you are using customized administrator roles to control which users or groups can manage specific StackSets within the same administrator account. For more information, see Grant self-managed permissions in the CloudFormation User Guide.
If you specified a customized administrator role when you created the StackSet, you must specify a customized administrator role, even if it is the same customized administrator role used with this StackSet previously.
-
execution_role_name(Optional[ExecutionRoleName], default:None) –[Self-managed permissions] The name of the IAM execution role to use to update the stack set. If you do not specify an execution role, CloudFormation uses the
AWSCloudFormationStackSetExecutionRolerole for the StackSet operation.Specify an IAM role only if you are using customized execution roles to control which stack resources users and groups can include in their StackSets.
If you specify a customized execution role, CloudFormation uses that role to update the stack. If you do not specify a customized execution role, CloudFormation performs the update using the role previously associated with the StackSet, so long as you have permissions to perform operations on the StackSet.
-
deployment_targets(Optional[DeploymentTargets], default:None) –[Service-managed permissions] The Organizations accounts in which to update associated stack instances.
To update all the stack instances associated with this StackSet, do not specify
DeploymentTargetsorRegions.If the StackSet update includes changes to the template (that is, if
TemplateBodyorTemplateURLis specified), or theParameters, CloudFormation marks all stack instances with a status ofOUTDATEDprior to updating the stack instances in the specified accounts and Amazon Web Services Regions. If the StackSet update doesn't include changes to the template or parameters, CloudFormation updates the stack instances in the specified accounts and Regions, while leaving all other stack instances with their existing stack instance status. -
permission_model(Optional[PermissionModels], default:None) –Describes how the IAM roles required for StackSet operations are created. You cannot modify
PermissionModelif there are stack instances associated with your stack set.-
With
self-managedpermissions, you must create the administrator and execution roles required to deploy to target accounts. For more information, see Grant self-managed permissions. -
With
service-managedpermissions, StackSets automatically creates the IAM roles required to deploy to accounts managed by Organizations. For more information, see Activate trusted access for StackSets with Organizations.
-
-
auto_deployment(Optional[AutoDeployment], default:None) –[Service-managed permissions] Describes whether StackSets automatically deploys to Organizations accounts that are added to a target organization or organizational unit (OU). For more information, see Enable or disable automatic deployments for StackSets in Organizations in the CloudFormation User Guide.
If you specify
AutoDeployment, don't specifyDeploymentTargetsorRegions. -
operation_id(Optional[ClientRequestToken], default:None) –The unique ID for this StackSet operation.
The operation ID also functions as an idempotency token, to ensure that CloudFormation performs the StackSet operation only once, even if you retry the request multiple times. You might retry StackSet operation requests to ensure that CloudFormation successfully received them.
If you don't specify an operation ID, CloudFormation generates one automatically.
Repeating this StackSet operation with a new operation ID retries all stack instances whose status is
OUTDATED. -
accounts(Optional[AccountList], default:None) –[Self-managed permissions] The accounts in which to update associated stack instances. If you specify accounts, you must also specify the Amazon Web Services Regions in which to update StackSet instances.
To update all the stack instances associated with this StackSet, don't specify the
AccountsorRegionsproperties.If the StackSet update includes changes to the template (that is, if the
TemplateBodyorTemplateURLproperties are specified), or theParametersproperty, CloudFormation marks all stack instances with a status ofOUTDATEDprior to updating the stack instances in the specified accounts and Amazon Web Services Regions. If the StackSet update does not include changes to the template or parameters, CloudFormation updates the stack instances in the specified accounts and Amazon Web Services Regions, while leaving all other stack instances with their existing stack instance status. -
regions(Optional[RegionList], default:None) –The Amazon Web Services Regions in which to update associated stack instances. If you specify Regions, you must also specify accounts in which to update StackSet instances.
To update all the stack instances associated with this StackSet, do not specify the
AccountsorRegionsproperties.If the StackSet update includes changes to the template (that is, if the
TemplateBodyorTemplateURLproperties are specified), or theParametersproperty, CloudFormation marks all stack instances with a status ofOUTDATEDprior to updating the stack instances in the specified accounts and Regions. If the StackSet update does not include changes to the template or parameters, CloudFormation updates the stack instances in the specified accounts and Regions, while leaving all other stack instances with their existing stack instance status. -
call_as(Optional[CallAs], default:None) –[Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.
By default,
SELFis specified. UseSELFfor StackSets with self-managed permissions.-
If you are signed in to the management account, specify
SELF. -
If you are signed in to a delegated administrator account, specify
DELEGATED_ADMIN.Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see Register a delegated administrator in the CloudFormation User Guide.
-
-
managed_execution(Optional[ManagedExecution], default:None) –Describes whether CloudFormation performs non-conflicting operations concurrently and queues conflicting operations.
Raises:
-
InvalidOperationException–The specified operation isn't valid.
-
OperationIdAlreadyExistsException–The specified operation ID already exists.
-
OperationInProgressException–Another operation is currently in progress for this StackSet. Only one operation can be performed for a stack set at a given time.
-
StackInstanceNotFoundException–The specified stack instance doesn't exist.
-
StackSetNotFoundException–The specified StackSet doesn't exist.
-
StaleRequestException–Another operation has been performed on this StackSet since the specified operation was performed.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 | |