5.2.12 Shut down a virtual server
Function
This plugin can stop instances in an Amazon EC2 environment.
The required server is shown as follows:
- AWS control server (execution-target server)
This is a server on which AWS Tools for Windows PowerShell (hereinafter referred to as "AWS Tools") is installed. This product can forward plugins to the server to be executed.
- Instance
This is a regular virtual server in an Amazon EC2 environment.
The scripts in this plugin execute the following AWS Tools commandlets:
- Stop-EC2Instance -Instance instance-ID (the value of the AWS.instanceId property)
After executing the above commandlets, make sure that the status of the stopped instance is "stopped".
For details about the AWS Tools commandlets, refer to "AWS Tools for Windows PowerShell Cmdlet Reference" in the AWS document.
Use situation
Use this plugin to stop instances in an Amazon EC2 environment.
Prerequisites
For the most recent information about the prerequisite products on the execution-target server, supported OSs for the prerequisite products on the execution-target server, and prerequisite products on the execution-target system, see the Release Notes.
In addition, the following OS and products use abbreviations. For the abbreviations of OS and products, see the "Preface".
Prerequisite products on the execution-target server:
- AWS Tools for Windows PowerShell
- Microsoft .Net Framework 3.5 or later
Supported OSs for the prerequisite products on the execution-target server:
- Windows Server
Prerequisite products in the execution-target system:
None.
Cautions
(1) Do not specify character strings that include a double quotation mark (") or a single quotation mark (') for the properties of this plugin.
(2) If you execute this plugin, data being edited by the instance is not saved.
(3) An instance will be stopped even if a user logs in to the instance.
(4) For additional remarks, refer to "AWS Tools for Windows PowerShell Cmdlet Reference" in the AWS document.
Execution privilege
(1) The policy must be set to allow an IAM user to log in to AWS to perform the following actions:
- Stopping instances and obtaining instance statuses
Version
02.00.00
Plug-in tags
Control VM,AWS
Plug-in name displayed in the task log
awsShutdownVM
Return code
0: Normal
12: Error (mistake by user) Invalid property
23: Error (invalid environment) The environment requirements have not been met.
27: Error (Check with the task log regarding the error details.) Unidentified error
41: Error (error detected in the component) Property not entered (An error was detected in the component 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.checkInstanceDisabledCount |
Instance status (stopped) check count |
Specify the number of times to check whether the instance has stopped. The maximum waiting time is determined by combining this count and the instance status (stopped) check interval. |
-- |
Input |
R |
AWS.checkInstanceDisabledInterval |
Instance status (stopped) check interval |
Specify the interval (in seconds) to check whether the instance has stopped. |
-- |
Input |
R |
AWS.instanceState |
Instance status |
Stores the instance status. |
-- |
Output |
O |
common.returnValue |
Return value for the plugin |
The return value of this plugin stored. |
-- |
Output |
O |