← 返回命令列表

Linux command

aws-cloudformation 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Create a new stack

aws cloudformation create-stack --stack-name [my-stack] --template-body file://[template.yaml]

Update an existing stack

aws cloudformation update-stack --stack-name [my-stack] --template-body file://[template.yaml]

Delete a stack

aws cloudformation delete-stack --stack-name [my-stack]

Describe stack status

aws cloudformation describe-stacks --stack-name [my-stack]

Validate a template

aws cloudformation validate-template --template-body file://[template.yaml]

Create a change set

aws cloudformation create-change-set --stack-name [my-stack] --change-set-name [my-changes] --template-body file://[template.yaml]

Deploy a template

aws cloudformation deploy --template-file [template.yaml] --stack-name [my-stack] --capabilities CAPABILITY_IAM

List all stacks

aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE UPDATE_COMPLETE

Package a template

aws cloudformation package --template-file [template.yaml] --s3-bucket [my-bucket] --output-template-file [packaged.yaml]

说明

aws cloudformation is the AWS CLI interface for AWS CloudFormation, an infrastructure-as-code service that lets you model and provision AWS resources using templates. Templates define resources declaratively in YAML or JSON format, and CloudFormation handles provisioning and configuration. CloudFormation manages resources as stacks, creating, updating, and deleting all resources together while automatically handling dependencies. Change sets allow previewing modifications before applying them.

FAQ

What is the aws-cloudformation command used for?

aws cloudformation is the AWS CLI interface for AWS CloudFormation, an infrastructure-as-code service that lets you model and provision AWS resources using templates. Templates define resources declaratively in YAML or JSON format, and CloudFormation handles provisioning and configuration. CloudFormation manages resources as stacks, creating, updating, and deleting all resources together while automatically handling dependencies. Change sets allow previewing modifications before applying them.

How do I run a basic aws-cloudformation example?

Run `aws cloudformation create-stack --stack-name [my-stack] --template-body file://[template.yaml]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more aws-cloudformation examples?

This page includes 9 examples for aws-cloudformation, plus related commands for nearby Linux tasks.