Manage AWS from Windows 10 using AWS Tools for PowerShell

If you are primarily a Microsoft sysadmin and are also responsible for looking after an AWS environment the AWS Tools for PowerShell will come in useful.  In this post we will go through how to connect PowerShell your AWS environment and run a simple command.

To start with you will need to download and install the AWS Tools for PowerShell from here.

Once installed open your ISE (or just a PowerShell window if you prefer) and run the below command to check that the module is installed correctly.

Get-Module -ListAvailable

 

Then if you can see the awspowershell module listed load the module:

import-module awspowershell

 

You then need to some login credentials to connect you your AWS environment. You may want to go to the IAM console in AWS and create a specific user account for this purpose. You can then create some API credentials to use below:

Set-AWSCredential -AccessKey ' Your AWS Accesskey' -SecretKey 'Your AWS secretkey'

 

Then check your AWS region from the console and add it below:

Set-DefaultAWSRegion -Region eu-west-1

 

To see a list of all the commands you can now run in your AWS environement run:

get-command -module awspowershell

 

Run the below command to see what you can do within EC2

help ec2instance

 

To output a list of all of your EC2 instances run the below:

get-ec2instance | Out-GridView 




Leave a Reply

Your email address will not be published. Required fields are marked *