create_stack_set
async
¶
create_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,
stack_id: Optional[StackId] = None,
parameters: Optional[Parameters] = None,
capabilities: Optional[Capabilities] = None,
tags: Optional[Tags] = None,
administration_role_arn: Optional[RoleARN] = None,
execution_role_name: Optional[ExecutionRoleName] = None,
permission_model: Optional[PermissionModels] = None,
auto_deployment: Optional[AutoDeployment] = None,
call_as: Optional[CallAs] = None,
client_request_token: Optional[ClientRequestToken] = None,
managed_execution: Optional[ManagedExecution] = None,
execution_role_template_body: Optional[TemplateBody] = None,
execution_role_template_url: Optional[TemplateURL] = None,
stack_set_output_bucket: Optional[StackSetOutputBucket] = None,
) -> CreateStackSetOutput
Creates a StackSet.
Parameters:
-
stack_set_name(Optional[StackSetName], default:None) –The name to associate with the StackSet. The name must be unique in the Region where you create your StackSet.
A stack name can contain only alphanumeric characters (case-sensitive) and hyphens. It must start with an alphabetic character and can't be longer than 128 characters.
-
description(Optional[Description], default:None) –A description of the StackSet. You can use the description to identify the StackSet's purpose or other important information.
-
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 either the
TemplateBodyor theTemplateURLparameter, but not both. -
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's 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 either the
TemplateBodyor theTemplateURLparameter, but not both. -
stack_id(Optional[StackId], default:None) –The stack ID you are importing into a new StackSet. Specify the Amazon Resource Name (ARN) of the stack.
-
parameters(Optional[Parameters], default:None) –The input parameters for the StackSet template.
-
capabilities(Optional[Capabilities], default:None) –In some cases, you must explicitly acknowledge that your StackSet template contains certain capabilities in order for CloudFormation to create the StackSet and related 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 StackSets, 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 create the StackSet directly from the processed template, without first reviewing the resulting changes in a change set. To create the StackSet directly, you must acknowledge this capability. For more information, see Perform custom processing on CloudFormation templates with template macros.
With service-managed permissions, CloudFormation can process macros, nested stacks, and transforms in your StackSet template only when you provide a custom execution role template. (Macros include the AWS::Include and AWS::Serverless transforms, which are macros hosted by CloudFormation.) The default service-managed execution role can't provision them: if you reference a macro in your template, the StackSet operation fails even when you specify this capability.
To use macros, nested stacks, or transforms with service-managed permissions, specify a custom execution role template in
ExecutionRoleTemplateBodyorExecutionRoleTemplateUrl, and specify bothCAPABILITY_NAMED_IAMandCAPABILITY_AUTO_EXPAND.
-
-
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. A maximum number of 50 tags can be specified.
If you specify tags as part of a
CreateStackSetaction, CloudFormation checks to see if you have the required IAM permission to tag resources. If you don't, the entireCreateStackSetaction fails with anaccess deniederror, and the StackSet is not created. -
administration_role_arn(Optional[RoleARN], default:None) –The Amazon Resource Name (ARN) of the IAM role to use to create 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.
Valid only if the permissions model is
SELF_MANAGED. -
execution_role_name(Optional[ExecutionRoleName], default:None) –The name of the IAM execution role that CloudFormation uses for StackSet operations in your target accounts.
[Self-managed permissions] 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.[Service-managed permissions] Set this name when you use custom execution roles. The role that your custom execution role template provisions in your target accounts must have this same name, and the name must begin with
stacksets-exec-custom-. -
permission_model(Optional[PermissionModels], default:None) –Describes how the IAM roles required for StackSet operations are created. By default,
SELF-MANAGEDis specified.-
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) –Describes whether StackSets automatically deploys to Organizations accounts that are added to the target organization or organizational unit (OU). For more information, see Enable or disable automatic deployments for StackSets in Organizations in the CloudFormation User Guide.
Required if the permissions model is
SERVICE_MANAGED. (Not used with self-managed permissions.) -
call_as(Optional[CallAs], default:None) –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.-
To create a StackSet with service-managed permissions while signed in to the management account, specify
SELF. -
To create a StackSet with service-managed permissions while signed in to a delegated administrator account, specify
DELEGATED_ADMIN.Your Amazon Web Services account must be registered as a delegated admin in the management account. For more information, see Register a delegated administrator in the CloudFormation User Guide.
StackSets with service-managed permissions are created in the management account, including StackSets that are created by delegated administrators.
Valid only if the permissions model is
SERVICE_MANAGED. -
-
client_request_token(Optional[ClientRequestToken], default:None) –A unique identifier for this
CreateStackSetrequest. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to create another StackSet with the same name. You might retryCreateStackSetrequests to ensure that CloudFormation successfully received them.If you don't specify an operation ID, the SDK generates one automatically.
-
managed_execution(Optional[ManagedExecution], default:None) –Describes whether CloudFormation performs non-conflicting operations concurrently and queues conflicting operations.
-
execution_role_template_body(Optional[TemplateBody], default:None) –The body of the template that creates a custom execution role in target accounts. This parameter applies only when the permissions model is
SERVICE_MANAGED.Conditional: Specify either
ExecutionRoleTemplateBodyorExecutionRoleTemplateUrl, but not both. If you don't specify either, CloudFormation uses the default service-managed execution role in target accounts. -
execution_role_template_url(Optional[TemplateURL], default:None) –The URL of an Amazon S3 object that contains the template that creates a custom execution role in target accounts. This parameter applies only when the permissions model is
SERVICE_MANAGED.Conditional: Specify either
ExecutionRoleTemplateBodyorExecutionRoleTemplateUrl, but not both. If you don't specify either, CloudFormation uses the default service-managed execution role in target accounts. -
stack_set_output_bucket(Optional[StackSetOutputBucket], default:None) –The name of the Amazon S3 bucket that stores the execution role stack template body. CloudFormation uses this bucket only when you specify a custom execution role template.
Raises:
-
CreatedButModifiedException–The specified resource exists, but has been changed.
-
LimitExceededException–The quota for the resource has already been reached.
For information about resource and stack limitations, see CloudFormation quotas in the CloudFormation User Guide.
-
NameAlreadyExistsException–The specified name is already in use.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 | |