https://github.com/ucdavis/aws_ec2_instances_status_checks_ps
PowerShell script to check the statuses of EC2 instances
https://github.com/ucdavis/aws_ec2_instances_status_checks_ps
aws-ec2 powershell
Last synced: 11 months ago
JSON representation
PowerShell script to check the statuses of EC2 instances
- Host: GitHub
- URL: https://github.com/ucdavis/aws_ec2_instances_status_checks_ps
- Owner: ucdavis
- Created: 2022-05-17T15:39:14.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-05-17T15:42:19.000Z (about 4 years ago)
- Last Synced: 2025-02-18T12:01:41.120Z (over 1 year ago)
- Topics: aws-ec2, powershell
- Language: PowerShell
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## AWS EC2 Instances Status Checks
A quick PowerShell script to check the status of AWS EC2 instances.
### Scenario
You have an EC2 instances that need to start once a day and perform some data processing tasks and then shutdown.
Designed to be run periodically through out the day, this script will check the current hour and start the system if it's powered off. If running it will make sure it doesn't run longer than 12 hours.
### Required Setup
The AWS Tools for PowerShell on Windows module must be installed on the system.
```powershell
# Make sure the AWS PowerShell module is located in one of the module paths
# View Module Paths
$Env:PSModulePath
```
Check Version of AWS PowerShell Module
```powershell
# Check AWS PowerShell Version
Get-AWSPowerShellVersion
```
Configure the AWS credentials
```powershell
# Setup the default profie credentials to be used during calls. Only run if not already configured
Set-AWSCredential -AccessKey NnNnNnNn -SecretKey NnNnNnNn -StoreAs default
```
Check AWS credentials
```powershell
# Check credentials
Get-AWSCredential -ListProfileDetail
```