boto3_cfn¶
Connection module for Amazon Cloud Formation using boto3.¶
Renamed from
boto_cfntoboto3_cfnand rewritten to use the boto3cloudformationclient APIs directly viasaltext.boto3.utils.boto3mod. The legacy boto2 code path (object-style access, retry loops) has been removed.
- depends:
boto3 >= 1.28.0
botocore >= 1.31.0
- configuration:
This module accepts explicit Cloud Formation credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html
If IAM roles are not used you need to specify them either in the minion’s config file or as a profile. For example, to specify them in the minion’s config file:
cfn.keyid: GKTADJGHEIQSXMKKRBJ08H
cfn.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
A region may also be specified in the configuration:
cfn.region: us-east-1
It’s also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:
myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
Added in version 1.0.0.
- saltext.boto3.modules.boto3_cfn.exists(name, region=None, key=None, keyid=None, profile=None)[source]¶
Check to see if a stack exists.
- name (str):
The name of the CloudFormation stack.
- region (str, optional):
The AWS region where the CloudFormation stack is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_cfn.exists mystack region=us-east-1
- saltext.boto3.modules.boto3_cfn.describe(name, region=None, key=None, keyid=None, profile=None)[source]¶
Describe a stack.
- name (str):
The name of the CloudFormation stack.
- region (str, optional):
The AWS region where the CloudFormation stack is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_cfn.describe mystack region=us-east-1
- saltext.boto3.modules.boto3_cfn.create(name, template_body=None, template_url=None, parameters=None, notification_arns=None, disable_rollback=None, timeout_in_minutes=None, capabilities=None, tags=None, on_failure=None, stack_policy_body=None, stack_policy_url=None, region=None, key=None, keyid=None, profile=None)[source]¶
Create a CFN stack.
- name (str):
The name of the CloudFormation stack.
- template_body (str, optional):
The body of the CloudFormation template.
- template_url (str, optional):
The URL of the CloudFormation template.
- parameters (dict, optional):
A dictionary of parameters to pass to the CloudFormation stack.
- notification_arns (list, optional):
A list of SNS topic ARNs to send notifications to.
- disable_rollback (bool, optional):
Whether to disable rollback on stack creation failure.
- timeout_in_minutes (int, optional):
The amount of time that can pass before the stack status becomes CREATE_FAILED.
- capabilities (list, optional):
A list of capabilities that the stack requires.
- tags (dict, optional):
A dictionary of tags to associate with the stack.
- on_failure (str, optional):
The action to take if stack creation fails.
- stack_policy_body (str, optional):
The body of the stack policy.
- stack_policy_url (str, optional):
The URL of the stack policy.
- region (str, optional):
The AWS region where the CloudFormation stack is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_cfn.create mystack template_url='https://s3.amazonaws.com/bucket/template.cft' region=us-east-1
- saltext.boto3.modules.boto3_cfn.update_stack(name, template_body=None, template_url=None, parameters=None, notification_arns=None, capabilities=None, tags=None, use_previous_template=None, stack_policy_during_update_body=None, stack_policy_during_update_url=None, stack_policy_body=None, stack_policy_url=None, region=None, key=None, keyid=None, profile=None)[source]¶
Update a CFN stack.
- name (str):
The name of the CloudFormation stack.
- template_body (str, optional):
The body of the CloudFormation template.
- template_url (str, optional):
The URL of the CloudFormation template.
- parameters (dict, optional):
A dictionary of parameters to pass to the CloudFormation stack.
- notification_arns (list, optional):
A list of SNS topic ARNs to send notifications to.
- capabilities (list, optional):
A list of capabilities that the stack requires.
- tags (dict, optional):
A dictionary of tags to associate with the stack.
- use_previous_template (bool, optional):
Whether to use the previous template.
- stack_policy_during_update_body (str, optional):
The body of the stack policy during update.
- stack_policy_during_update_url (str, optional):
The URL of the stack policy during update.
- stack_policy_body (str, optional):
The body of the stack policy.
- stack_policy_url (str, optional):
The URL of the stack policy.
- region (str, optional):
The AWS region where the CloudFormation stack is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_cfn.update_stack mystack template_url='https://s3.amazonaws.com/bucket/template.cft' region=us-east-1
- saltext.boto3.modules.boto3_cfn.delete(name, region=None, key=None, keyid=None, profile=None)[source]¶
Delete a CFN stack.
- name (str):
The name of the CloudFormation stack.
- region (str, optional):
The AWS region where the CloudFormation stack is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_cfn.delete mystack region=us-east-1
- saltext.boto3.modules.boto3_cfn.get_template(name, region=None, key=None, keyid=None, profile=None)[source]¶
Retrieve the template body of a CFN stack.
- name (str):
The name of the CloudFormation stack.
- region (str, optional):
The AWS region where the CloudFormation stack is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_cfn.get_template mystack
- saltext.boto3.modules.boto3_cfn.validate_template(template_body=None, template_url=None, region=None, key=None, keyid=None, profile=None)[source]¶
Validate cloudformation template.
- template_body (str, optional):
The body of the CloudFormation template.
- template_url (str, optional):
The URL of the CloudFormation template.
- region (str, optional):
The AWS region where the CloudFormation stack is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_cfn.validate_template mystack-template