Create and manage stacksCreate a stack from an example template fileTo create a stack, or template, from an example template
file, run following command:$heat stack-create mystack --template-file=/path/to/heat/templates/WordPress_Single_Instance.template \
--parameters="InstanceType=m1.large;DBUsername=wp;DBPassword=verybadpassword;KeyName=heat_key;LinuxDistribution=F17"The --parameters values that you specify
depend on which parameters are defined in the
template. If the template file is hosted on a website,
you can specify the URL with
--template-url parameter
instead of the --template-file
parameter.The command returns the following output:+--------------------------------------+---------------+--------------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+---------------+--------------------+----------------------+
| 4c712026-dcd5-4664-90b8-0915494c1332 | mystack | CREATE_IN_PROGRESS | 2013-04-03T23:22:08Z |
+--------------------------------------+---------------+--------------------+----------------------+You can also use the stack-create
command to validate a template file without creating a
stack from it.To do so, run the following command:$heat stack-create mystack --template-file=/path/to/heat/templates/WordPress_Single_Instance.templateIf validation fails, the response returns an error
message.Get information about stacksTo explore the state and history of a particular stack, you can
run a number of commands.To see which stacks are visible to the current user,
run the following command:
$heat stack-list+--------------------------------------+---------------+-----------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+---------------+-----------------+----------------------+
| 4c712026-dcd5-4664-90b8-0915494c1332 | mystack | CREATE_COMPLETE | 2013-04-03T23:22:08Z |
| 7edc7480-bda5-4e1c-9d5d-f567d3b6a050 | my-otherstack | CREATE_FAILED | 2013-04-03T23:28:20Z |
+--------------------------------------+---------------+-----------------+----------------------+To show the details of a stack, run the following
command:$heat stack-show mystackA stack consists of a collection of resources. To list the
resources and their status, run the following
command:$heat resource-list mystack+---------------------+--------------------+-----------------+----------------------+
| logical_resource_id | resource_type | resource_status | updated_time |
+---------------------+--------------------+-----------------+----------------------+
| WikiDatabase | AWS::EC2::Instance | CREATE_COMPLETE | 2013-04-03T23:25:56Z |
+---------------------+--------------------+-----------------+----------------------+To show the details for the specified resource in a
stack, run the following command:$heat resource-show mystack WikiDatabaseSome resources have associated metadata which can
change throughout the life-cycle of a resource:$heat resource-metadata mystack WikiDatabaseA series of events is generated during the life-cycle of a
stack. This command displays those events:$heat event-list mystack+---------------------+----+------------------------+-----------------+----------------------+
| logical_resource_id | id | resource_status_reason | resource_status | event_time |
+---------------------+----+------------------------+-----------------+----------------------+
| WikiDatabase | 1 | state changed | IN_PROGRESS | 2013-04-03T23:22:09Z |
| WikiDatabase | 2 | state changed | CREATE_COMPLETE | 2013-04-03T23:25:56Z |
+---------------------+----+------------------------+-----------------+----------------------+To show the details for a particular event, run the following
command:$heat event-show WikiDatabase 1Update stacksTo update an existing stack from a modified template
file, run the following command:$heat stack-update mystack --template-file=/path/to/heat/templates/WordPress_Single_Instance_v2.template
--parameters="InstanceType=m1.large;DBUsername=wp;DBPassword=verybadpassword;KeyName=heat_key;LinuxDistribution=F17"+--------------------------------------+---------------+-----------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+---------------+-----------------+----------------------+
| 4c712026-dcd5-4664-90b8-0915494c1332 | mystack | UPDATE_COMPLETE | 2013-04-03T23:22:08Z |
| 7edc7480-bda5-4e1c-9d5d-f567d3b6a050 | my-otherstack | CREATE_FAILED | 2013-04-03T23:28:20Z |
+--------------------------------------+---------------+-----------------+----------------------+Some resources are updated in-place, while others
are replaced with new resources.