CloudFormationClient.create_stack
rboto-cloudformation==0.4.0 · Service index · Types
Model summary (excerpt): Creates a stack as specified in the template. After the call completes successfully, the stack creation starts. You can check the status of the stack through the DescribeStacks operation. For more information about creating a stack and monitoring stack progress, see Managing Amazon Web Services resources as a single unit with CloudFormation stacks in the CloudFormation User Guide .
Install and imports
from rboto import CloudFormationClient
from collections.abc import Sequence
from rboto_cloudformation.types import (
Capability,
CreateStackOutput,
DeploymentConfig,
OnFailure,
Parameter,
RollbackConfiguration,
Tag,
)
Signature
async def create_stack(
*,
stack_name: str,
template_body: str | None = None,
template_url: str | None = None,
parameters: Sequence[Parameter] | None = None,
disable_rollback: bool | None = None,
rollback_configuration: RollbackConfiguration | None = None,
timeout_in_minutes: int | None = None,
notification_arns: Sequence[str] | None = None,
capabilities: Sequence[Capability] | None = None,
resource_types: Sequence[str] | None = None,
role_arn: str | None = None,
on_failure: OnFailure | None = None,
stack_policy_body: str | None = None,
stack_policy_url: str | None = None,
tags: Sequence[Tag] | None = None,
client_request_token: str | None = None,
enable_termination_protection: bool | None = None,
retain_except_on_create: bool | None = None,
deployment_config: DeploymentConfig | None = None,
disable_validation: bool | None = None,
) -> CreateStackOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
stack_name |
Yes | The name that's associated with the stack. The name must be unique in the Region in which you are creating the stack. A stack name can contain only alphanumeric characters (case sensitive) and hyphens. It must start with an alphabetical character and can't be longer than 128 characters. |
template_body |
No | 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 TemplateBody or TemplateURL , but not both. |
template_url |
No | The URL of a file that contains the template body. The URL must point to a template (max 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:// . URLs from S3 static websites are not supported. Conditional: You must specify either the TemplateBody or the TemplateURL parameter, but not both. |
parameters |
No | A list of Parameter structures that specify input parameters for the stack. For more information, see the Parameter data type. |
disable_rollback |
No | Set to true to disable rollback of the stack if stack creation failed. You can specify either DisableRollback or OnFailure , but not both. Default: false |
rollback_configuration |
No | The rollback triggers for CloudFormation to monitor during stack creation and updating operations, and for the specified monitoring period afterwards. |
timeout_in_minutes |
No | The amount of time that can pass before the stack status becomes CREATE_FAILED ; if DisableRollback is not set or is set to false , the stack will be rolled back. |
notification_arns |
No | The Amazon SNS topic ARNs to publish stack related events. You can find your Amazon SNS topic ARNs using the Amazon SNS console or your Command Line Interface (CLI). |
capabilities |
No | In some cases, you must explicitly acknowledge that your stack template contains certain capabilities in order for CloudFormation to create the stack. CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some 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, you must explicitly acknowledge this... |
resource_types |
No | Specifies which resource types you can work with, such as AWS::EC2::Instance or Custom::MyCustomInstance . If the list of resource types doesn't include a resource that you're creating, the stack creation fails. By default, CloudFormation grants permissions to all resource types. IAM uses this parameter for CloudFormation-specific condition keys in IAM policies. For more information, see... |
role_arn |
No | The Amazon Resource Name (ARN) of an IAM role that CloudFormation assumes to create the stack. CloudFormation uses the role's credentials to make calls on your behalf. CloudFormation always uses this role for all future operations on the stack. Provided that users have permission to operate on the stack, CloudFormation uses this role even if the users don't have permission to pass it. Ensure... |
on_failure |
No | Determines what action will be taken if stack creation fails. This must be one of: DO_NOTHING , ROLLBACK , or DELETE . You can specify either OnFailure or DisableRollback , but not both. Although the default setting is ROLLBACK , there is one exception. This exception occurs when a StackSet attempts to deploy a stack instance and the stack instance fails to create successfully. In this case,... |
stack_policy_body |
No | Structure that contains the stack policy body. For more information, see Prevent updates to stack resources in the CloudFormation User Guide . You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both. |
stack_policy_url |
No | Location of a file that contains the stack policy. The URL must point to a policy (maximum size: 16 KB) located in an S3 bucket in the same Region as the stack. The location for an Amazon S3 bucket must start with https:// . URLs from S3 static websites are not supported. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both. |
tags |
No | Key-value pairs to associate with this stack. CloudFormation also propagates these tags to the resources created in the stack. A maximum number of 50 tags can be specified. |
client_request_token |
No | A unique identifier for this CreateStack request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to create a stack with the same name. You might retry CreateStack requests to ensure that CloudFormation successfully received them. All events initiated by a given stack operation are assigned the same client request token, which you can... |
enable_termination_protection |
No | Whether to enable termination protection on the specified stack. If a user attempts to delete a stack with termination protection enabled, the operation fails and the stack remains unchanged. For more information, see Protect CloudFormation stacks from being deleted in the CloudFormation User Guide . Termination protection is deactivated on stacks by default. For nested stacks , termination... |
retain_except_on_create |
No | When set to true , newly created resources are deleted when the operation rolls back. This includes newly created resources marked with a deletion policy of Retain . Default: false |
deployment_config |
No | The deployment configuration for this stack operation, including the deployment mode. |
disable_validation |
No | Set to true to disable pre-deployment validations in changeset or stack operations. Default: false |
Output
CreateStackOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
stack_id |
str | None |
Always present | — |
operation_id |
str | None |
Always present | — |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
Capability, CreateStackOutput, DeploymentConfig, OnFailure, Parameter, RollbackConfiguration, Tag
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
No output stream.
Errors
Import from rboto_cloudformation.exceptions:
AlreadyExistsError, InsufficientCapabilitiesError, LimitExceededError, TokenAlreadyExistsError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.