5.2.1 AMI creation
Function
This plugin creates an AMI from an instance in an Amazon EC2 environment.
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. AWS Tools transfers the plugin to, and executes it on, this server.
- Instance
A standard virtual server, with a virtual host in an Amazon EC2 environment
The script within this plugin executes the following AWS Tools commandlets:
- New-EC2Image -InstanceId "Instance ID (AWS.instanceId property value)"
- Name "AMI name (AWS.amiName property value)"
- Description "AMI description (AWS.amiDescription property value)"
- NoReboot "Instance reboot suppression (AWS.instanceNoReboot property value)"
- Force
After executing these commandlets, verify that the state of the created AMI is "available".
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 AMI from an instance that has been customized in an Amazon EC2 environment.
Prerequisites
For the latest support information about [Required products for the service template execution server], [Prerequisite OS for the required products for the service template execution server], and [Required products for the service template execution system], 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
[Required products for the service template execution system]
None
[Operating conditions for required products for the service template execution system]
(1) Instance conditions
The state of the instance to be used must be "running" or "stopped".
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 AMI name in the AWS.amiName property. Specifying an existing AMI 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 action:
- Creating images
Version
02.01.00
Plug-in tags
Add VM Template,AWS
Plug-in name displayed in the task log
awsCreateImage
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.instanceId |
Instance ID |
Specify the ID of the instance. |
-- |
Input |
R |
AWS.amiName |
AMI name |
Specify a name for the AMI to be created. |
-- |
Input |
R |
AWS.amiDescription |
AMI description |
Specify a description for the AMI to be created. |
-- |
Input |
O |
AWS.instanceNoReboot |
Suppress instance restart |
If true is specified, the instance will be stopped before creating the AMI. If a value other than true is specified, the instance will be stopped and then restarted after creating the AMI. |
-- |
Input |
O |
AWS.checkAmiCreationCount |
Frequency of AMI creation completion check |
Specify the number of times to check whether AMI creation is complete. This parameter, along with the interval for AMI creation completion check, indicates the maximum waiting time. |
-- |
Input |
R |
AWS.checkAmiCreationInterval |
Interval for AMI creation completion check |
Specify the interval in seconds to check whether AMI creation is complete. |
-- |
Input |
R |
AWS.amiIdOutput |
AMI ID |
Contains the ID of a created AMI |
-- |
Output |
O |
common.returnValue |
Return value for the plugin |
The return value of this plugin stored. |
-- |
Output |
O |