Skip to content

flyweightrocks/aws-ec2-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Action for AWS EC2 Start and Stop

Start and Stop AWS EC2 Instances with the AWS CLI.

This action executes the following commands to change an EC2 instance and outputs returned states:

Start:

aws ec2 start-instances --instance-ids <instance-id>

Wait:

aws ec2 wait instance-running --instance-ids <instance-id>

Stop:

aws ec2 stop-instances --instance-ids <instance-id>

Usage

uses: flyweightrocks/aws-ec2-action@v1
with:
  instance-id: 'Your Instance ID'
  wait-instance-running: true
  stop-instance: true

Inputs

instance-id

The instance ID of the EC2 container.

Required: true

wait-instance-running

Wait until the instance is running.

Default: true

stop-instance

Stop the instance during post job cleanup.

Default: true

Outputs

current-state

The current state of the instance.

previous-state

The previous state of the instance.

Credentials

The AWS credentials and region environment variables must have been set before running this action. The environment variables can be configured with the Configure AWS Credentials Action for GitHub Actions.

License

This code is made available under the MIT license.