AWS CloudFormation Command Line Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 2: Line 2:


* [[AWS_CloudFormation_Operations#Command_Line_Operations|CloudFormation Operations]]
* [[AWS_CloudFormation_Operations#Command_Line_Operations|CloudFormation Operations]]
=Validate Templates=
{{External|https://docs.aws.amazon.com/cli/latest/reference/cloudformation/validate-template.html}}
{{External|https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ValidateTemplate.html}}
aws cloudformation validate-template


=Create a Stack=
=Create a Stack=

Revision as of 17:13, 21 March 2019

Internal

Validate Templates

https://docs.aws.amazon.com/cli/latest/reference/cloudformation/validate-template.html
https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ValidateTemplate.html
aws cloudformation validate-template

Create a Stack

aws cloudformation create-stack --stack-name stack-name --template-body file://.../stack-template.yml [--parameters ParameterKey=Parm1,ParameterValue=test1 ParameterKey=Parm2,ParameterValue=test2]

If the template is supposed to create IAM roles, the command line will fail with a message similar to "An error occurred (InsufficientCapabilitiesException) when calling the CreateStack operation: Requires capabilities : [CAPABILITY_NAMED_IAM]", unless the capability is explicitly provided on command line with:

aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM ...

Delete a Stack

aws cloudformation delete-stack --stack-name stack-name

Describe a Stack

aws cloudformation describe-stacks

Organizatorium

aws cloudformation package --template-file deployment-stack.yaml --s3-bucket $TARGET_BUCKET --output-template-file new-deployment-stack.yaml