5.2.2 Stack creation
Function
This plugin creates a stack from a template file stored in an Amazon S3 bucket in an AWS CloudFormation environment. Creating a stack causes the AWS resource specified in the template file to be created by AWS CloudFormation.
The resource ID of the AWS resource that has been created is stored in the AWS.resourceId property. If multiple resources are created, each resource ID is output, separated by a comma.
However, if the total length of resource IDs exceeds 1,024 characters, the resource IDs after the 1,024th character will be truncated.
This plugin assumes the following server:
- AWS control server (execution target server)
A server on which AWS Tools for Windows PowerShell (abbreviated hereafter to "AWS Tools") is installed. This product transfers the plugin to and executes it on this server.
The script within this plugin executes the following AWS Tools commandlet:
- New-CFNStack -StackName "Stack name (AWS.stackName property value)"
- OnFailure "Behavior at stack creation failure (AWS.actionStackCreationFail property value)"
- TemplateURL "URL of the template file stored in Amazon S3 bucket" (#1)
[-Parameter "Values specified for parameters in the template file"] (#2)
-Capability "CAPABILITY_IAM"
-Force
#1: A value combining a bucket name (AWS.bucketName property) and a key name (AWS.keyName property)
#2: A value combining a template parameter key (AWS.templateParameterKey property) and a template parameter value (AWS.templateParameterValue property). A maximum of 20 pairs can be specified.
After executing these commandlets, verify that the state of the created stack is "CREATE_COMPLETE".
For details about AWS Tools commandlets, see the AWS document "AWS Tools for Windows PowerShell Cmdlet Reference".
Use situation
This plugin can be used to create an AWS resource from a template file in an AWS CloudFormation environment.
Prerequisites
For the latest support information about [Required products for the service template execution server], and [Prerequisite OS for the required products for the service template execution server], see the Release Notes.
In addition, the following OS and products use abbreviations. For the abbreviations of OS and products, see the "Preface".
[Required products for the service template execution server]
- AWS Tools for Windows PowerShell
- Microsoft .Net Framework 3.5 or later
[Prerequisite OS for the required products for the service template execution server]
- Windows Server
[Operating conditions for execution target system]
(1) Stack conditions
- The template file used for creating a stack must be stored in an Amazon S3 bucket.
Cautions
(1) Do not specify character strings containing double quotation marks (") or single quotation marks (') in the properties of this plugin.
(2) Do not specify an existing stack name in the AWS.stackName property. Specifying an existing stack name terminates the task abnormally.
(3) For other notes, see the notes in the AWS document "AWS Tools for Windows PowerShell Cmdlet Reference".
Execution privilege
(1) Policies must be set up so that IAM users logging in to AWS can perform the following actions:
- Creating stacks and obtaining information
- Manipulating files to be uploaded to an Amazon S3 bucket
- Creating AWS resources
Version
02.01.00
Plug-in tags
Add VM,AWS
Plug-in name displayed in the task log
awsCreateStack
Return code
0: Normal
12: Error (User error) Invalid property
23: Error (Invalid environment) Required environment is invalid
27: Error (Check task logs for the nature of error)
41: Error (Error detected in plugin) Missing property (Error detected in plugin script)
Property list
The following table lists the properties:
Property key |
Property name |
Description |
Default value |
I/O type |
Required |
---|---|---|---|---|---|
plugin.destinationHost |
Host name of the execution target server |
Specify the host name or IP address of the server on which this plugin will be executed. IPv6 addresses are not supported. |
-- |
Input |
R |
AWS.accessKeyId |
Access key ID |
Specify the access key ID for connecting to AWS. |
-- |
Input |
R |
AWS.secretAccessKey |
Secret access key |
Specify the secret access key for connecting to AWS. |
-- |
Input |
R |
AWS.region |
Region |
Specify an AWS region that is a connection destination. |
-- |
Input |
R |
AWS.bucketName |
Bucket name |
Specifies the name of the bucket used to upload the template file |
-- |
Input |
R |
AWS.keyName |
Key name |
Specifies the key name set in the uploaded template file |
-- |
Input |
R |
AWS.stackName |
Stack name |
Specify the name of a stack. |
-- |
Input |
R |
AWS.actionStackCreationFail |
Behavior in case of failed stack creation |
Specify the behavior to be performed if stack creation fails. The valid values are DO_NOTHING, ROLLBACK, or DELETE. |
-- |
Input |
R |
AWS.checkStackCreationCount |
Frequency of stack creation completion check |
Specify the number of times to check whether stack creation is complete. This parameter, along with the interval for stack creation completion check, indicates the maximum waiting time. |
-- |
Input |
R |
AWS.checkStackCreationInterval |
Interval for stack creation completion check |
Specify the interval in seconds to check whether stack creation is complete. |
-- |
Input |
R |
AWS.templateParameterKey1 |
Template parameter key 1 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue1 |
Template parameter value 1 |
Specify a value for template parameter key 1. |
-- |
Input |
O |
AWS.templateParameterKey2 |
Template parameter key 2 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue2 |
Template parameter value 2 |
Specify a value for template parameter key 2. |
-- |
Input |
O |
AWS.templateParameterKey3 |
Template parameter key 3 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue3 |
Template parameter value 3 |
Specify a value for template parameter key 3. |
-- |
Input |
O |
AWS.templateParameterKey4 |
Template parameter key 4 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue4 |
Template parameter value 4 |
Specify a value for template parameter key 4. |
-- |
Input |
O |
AWS.templateParameterKey5 |
Template parameter key 5 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue5 |
Template parameter value 5 |
Specify a value for template parameter key 5. |
-- |
Input |
O |
AWS.templateParameterKey6 |
Template parameter key 6 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue6 |
Template parameter value 6 |
Specify a value for template parameter key 6. |
-- |
Input |
O |
AWS.templateParameterKey7 |
Template parameter key 7 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue7 |
Template parameter value 7 |
Specify a value for template parameter key 7. |
-- |
Input |
O |
AWS.templateParameterKey8 |
Template parameter key 8 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue8 |
Template parameter value 8 |
Specify a value for template parameter key 8. |
-- |
Input |
O |
AWS.templateParameterKey9 |
Template parameter key 9 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue9 |
Template parameter value 9 |
Specify a value for template parameter key 9. |
-- |
Input |
O |
AWS.templateParameterKey10 |
Template parameter key 10 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue10 |
Template parameter value 10 |
Specify a value for template parameter key 10. |
-- |
Input |
O |
AWS.templateParameterKey11 |
Template parameter key 11 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue11 |
Template parameter value 11 |
Specify a value for template parameter key 11. |
-- |
Input |
O |
AWS.templateParameterKey12 |
Template parameter key 12 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue12 |
Template parameter value 12 |
Specify a value for template parameter key 12. |
-- |
Input |
O |
AWS.templateParameterKey13 |
Template parameter key 13 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue13 |
Template parameter value 13 |
Specify a value for template parameter key 13. |
-- |
Input |
O |
AWS.templateParameterKey14 |
Template parameter key 14 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue14 |
Template parameter value 14 |
Specify a value for template parameter key 14. |
-- |
Input |
O |
AWS.templateParameterKey15 |
Template parameter key 15 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue15 |
Template parameter value 15 |
Specify a value for template parameter key 15. |
-- |
Input |
O |
AWS.templateParameterKey16 |
Template parameter key 16 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue16 |
Template parameter value 16 |
Specify a value for template parameter key 16. |
-- |
Input |
O |
AWS.templateParameterKey17 |
Template parameter key 17 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue17 |
Template parameter value 17 |
Specify a value for template parameter key 17. |
-- |
Input |
O |
AWS.templateParameterKey18 |
Template parameter key 18 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue18 |
Template parameter value 18 |
Specify a value for template parameter key 18. |
-- |
Input |
O |
AWS.templateParameterKey19 |
Template parameter key 19 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue19 |
Template parameter value 19 |
Specify a value for template parameter key 19. |
-- |
Input |
O |
AWS.templateParameterKey20 |
Template parameter key 20 |
Specify the key name of the parameter defined in the template file. |
-- |
Input |
O |
AWS.templateParameterValue20 |
Template parameter value 20 |
Specify a value for template parameter key 20. |
-- |
Input |
O |
AWS.resourceId |
Resource ID |
Contains the IDs of one or more created resources; if multiple resources are created, their IDs are separated with a comma. |
-- |
Output |
O |
common.returnValue |
Return value for the plugin |
The return value of this plugin stored. |
-- |
Output |
O |