BE CAREFUL WITH AWS CREDENTIALS
This is a simple plugin that allows you to input your EC2 instance ID, the power action you want to do, and your AWS creds, to control the EC2 instance.
The valid actions are:
- stop
- force_stop
- start
- reboot
- terminate
Examples are in the input
folder.
After installing the poetry dependencies, run all unit tests via:
# Run all unit tests
python -m unittest tests.test_ec2_plugin
You can change this plugin's image version tag in
.github/workflows/carpenter.yaml
by editing the
IMAGE_TAG
variable, and pushing that change to the
branch designated in that workflow.
Runs AWS EC2 actions
Type: | scope | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Root object: | NodeActionParams | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties | action (
|
Name: | action |
---|---|
Description: | The action to execute. |
Required: | Yes |
Type: | enum[string] |
Values
|
aws_access_key_id (string
)
Name: | aws_access_public_key |
---|---|
Description: | The AWS public key/key id. |
Required: | Yes |
Type: | string |
aws_access_private_key (string
)
Name: | aws_access_private_key |
---|---|
Description: | The AWS private/access key. |
Required: | Yes |
Type: | string |
aws_region (string
)
Name: | aws_region |
---|---|
Description: | The AWS region the instance is in. |
Required: | Yes |
Type: | string |
instance_id (string
)
Name: | addr |
---|---|
Description: | The AWS instance ID. |
Required: | Yes |
Type: | string |
wait (bool
)
Name: | wait |
---|---|
Description: | Whether to wait for it to complete its action. |
Required: | Yes |
Type: | bool |
wait_timeout (int
)
Name: | wait_timeout |
---|---|
Description: | The amount of time in seconds to spend waiting for the desired state. |
Required: | No |
Default (JSON encoded): |
|
Type: | int |
Objects
NodeActionParams (object
)
Type: | object | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties | action (
|
Name: | action |
---|---|
Description: | The action to execute. |
Required: | Yes |
Type: | enum[string] |
Values
|
aws_access_key_id (string
)
Name: | aws_access_public_key |
---|---|
Description: | The AWS public key/key id. |
Required: | Yes |
Type: | string |
aws_access_private_key (string
)
Name: | aws_access_private_key |
---|---|
Description: | The AWS private/access key. |
Required: | Yes |
Type: | string |
aws_region (string
)
Name: | aws_region |
---|---|
Description: | The AWS region the instance is in. |
Required: | Yes |
Type: | string |
instance_id (string
)
Name: | addr |
---|---|
Description: | The AWS instance ID. |
Required: | Yes |
Type: | string |
wait (bool
)
Name: | wait |
---|---|
Description: | Whether to wait for it to complete its action. |
Required: | Yes |
Type: | bool |
wait_timeout (int
)
Name: | wait_timeout |
---|---|
Description: | The amount of time in seconds to spend waiting for the desired state. |
Required: | No |
Default (JSON encoded): |
|
Type: | int |
Type: | scope | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Root object: | ErrorOutput | ||||||||||||
Properties | error (
|
Name: | Error |
---|---|
Description: | An explanation why the execution failed. |
Required: | Yes |
Type: | string |
Objects
ErrorOutput (object
)
Type: | object | ||||||||
---|---|---|---|---|---|---|---|---|---|
Properties | error (
|
Name: | Error |
---|---|
Description: | An explanation why the execution failed. |
Required: | Yes |
Type: | string |
Type: | scope | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Root object: | SuccessOutput | ||||||||||||
Properties | final_power_state_on (
|
Required: | Yes |
---|---|
Type: | bool |
ms_duration (int
)
Required: | Yes |
---|---|
Type: | int |
Objects
SuccessOutput (object
)
Type: | object | ||||||||
---|---|---|---|---|---|---|---|---|---|
Properties | final_power_state_on (
|
Required: | Yes |
---|---|
Type: | bool |
ms_duration (int
)
Required: | Yes |
---|---|
Type: | int |