AWS CloudFormation
User Guide (API Version 2010-05-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

cfn-get-template

Description

Get the template used to create a running or deleted stack.

This command will return the text of the template used to create a stack.

Note

The cfn-get-template command returns template information from a deleted stack for 90 days after the stack has been deleted.

Syntax

cfn-get-template StackName common-options

Options

NameDescriptionRequired

StackName

The name of the stack whose template you want to get. You can also set this value using --stack-name.

Type: String

Default: None

No

Output

The command returns the template body, enclosed in double quotes.

AWS CloudFormation displays errors on stderr.

Examples

Example Request

This example gets the template used with the example-template stack.

PROMPT> cfn-get-template example-template

"
  {
    "AWSTemplateFormatVersion" : "2010-04-01",
    "Resources" : {
      "myEC2SGrpOne" : {
        "Type" : "AWS::SecurityGroup","Version" : "2009-11-30","Properties" : {
          "GroupDescription" : "foo"
        }
      }
    }
 }
"