AWS Tools for PowerShell
User Guide
AWS Tools for PowerShell
Copyright ? 2024 Amazon Web Services, Inc. and/or its a?liates. All rights reserved.
AWS Tools for PowerShell
User Guide
AWS Tools for PowerShell: User Guide
Copyright ? 2024 Amazon Web Services, Inc. and/or its a?liates. All rights reserved.
Amazon's trademarks and trade dress may not be used in connection with any product or service
that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any
manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are
the property of their respective owners, who may or may not be a?liated with, connected to, or
sponsored by Amazon.
AWS Tools for PowerShell
User Guide
Table of Contents
What are the AWS Tools for PowerShell? ...................................................................................... 1
Maintenance and support for SDK major versions ................................................................................ 2
AWS.Tools ....................................................................................................................................................
Core .............................................................................................................................
AWSPowerShell .............................................................................................................................................
How to use this guide .................................................................................................................................
Installation .......................................................................................................................................
Installing on Windows .................................................................................................................................
Prerequisites .............................................................................................................................................
2
3
3
4
5
5
6
Install AWS.Tools .................................................................................................................................. 6
Install Core ........................................................................................................... 9
Install AWSPowerShell ......................................................................................................................... 10
Enable Script Execution ....................................................................................................................... 11
Versioning ............................................................................................................................................... 13
Updating AWS Tools for PowerShell ................................................................................................ 14
Installing on Linux or macOS .................................................................................................................. 16
Overview of Setup ................................................................................................................................ 16
Prerequisites ............................................................................................................................................. 6
Install AWS.Tools ................................................................................................................................ 17
Install Core ......................................................................................................... 20
Script Execution ..................................................................................................................................... 11
Con?guring the PowerShell Console ................................................................................................ 22
Initialize Your PowerShell Session ..................................................................................................... 22
Versioning ............................................................................................................................................... 13
Updating the AWS Tools for PowerShell on Linux or macOS ...................................................... 24
Related Information ............................................................................................................................. 25
Migrating from AWS Tools for PowerShell Version 3.3 to Version 4 ............................................... 25
New Fully Modularized AWS.Tools Version ................................................................................... 25
New Get-AWSService cmdlet ......................................................................................................... 26
New -Select Parameter to Control the Object Returned by a Cmdlet ...................................
More Consistent Limiting of the Number of Items in the Output ..............................................
Easier to Use Stream Parameters ......................................................................................................
Extending the Pipe by Property Name ............................................................................................
Static Common Parameters ................................................................................................................
26
28
29
29
30
iii
AWS Tools for PowerShell
User Guide
AWS.Tools Declares and Enforces Manadatory Parameters ...................................................... 30
All Parameters Are Nullable ............................................................................................................... 30
Removing Previously Deprecated Features ..................................................................................... 31
Get started ..................................................................................................................................... 32
Con?gure tool authentication ................................................................................................................. 32
Enable and con?gure IAM Identity Center ...................................................................................... 33
Con?gure the Tools for PowerShell to use IAM Identity Center. ................................................ 33
Start an AWS access portal session .................................................................................................. 35
Example ................................................................................................................................................... 36
Additional information ........................................................................................................................ 36
Use the AWS CLI ................................................................................................................................... 37
Specify AWS Regions ................................................................................................................................. 41
Specifying a Custom or Nonstandard Endpoint ............................................................................. 42
Additional information ........................................................................................................................ 43
Con?gure federated identity ................................................................................................................... 43
Prerequisites ........................................................................................................................................... 43
How an Identity-Federated User Gets Federated Access to AWS Service APIs ......................... 44
How SAML Support Works in the AWS Tools for PowerShell ...................................................... 45
How to Use the PowerShell SAML Con?guration Cmdlets .......................................................... 46
Additional Reading ............................................................................................................................... 51
Cmdlet discovery and aliases .................................................................................................................. 51
Cmdlet Discovery .................................................................................................................................. 51
Cmdlet Naming and Aliases ............................................................................................................... 57
Pipelining and $AWSHistory .................................................................................................................... 62
$AWSHistory .......................................................................................................................................... 62
Credential and pro?le resolution ............................................................................................................ 66
Credentials Search Order .................................................................................................................... 66
Users and roles ........................................................................................................................................... 67
Users and permission sets .................................................................................................................. 67
Service roles ........................................................................................................................................... 68
Using legacy credentials ........................................................................................................................... 69
Important warnings and guidelines .................................................................................................. 69
AWS Credentials .................................................................................................................................... 70
Shared Credentials ................................................................................................................................ 79
Work with AWS services ............................................................................................................... 85
PowerShell File Concatenation Encoding .............................................................................................. 85
iv
AWS Tools for PowerShell
User Guide
Returned Objects for the PowerShell Tools ......................................................................................... 86
Amazon EC2 ................................................................................................................................................ 86
Amazon S3 ................................................................................................................................................... 86
AWS Lambda and AWS Tools for PowerShell ...................................................................................... 87
Amazon SNS and Amazon SQS ............................................................................................................... 87
CloudWatch ................................................................................................................................................. 87
See Also ........................................................................................................................................................ 87
Topics ............................................................................................................................................................
Amazon S3 and Tools for Windows PowerShell ..................................................................................
Create an Amazon S3 Bucket, Verify Its Region, and Optionally Remove It .............................
Con?gure an Amazon S3 Bucket as a Website and Enable Logging ..........................................
87
88
89
90
Upload Objects to an Amazon S3 Bucket ....................................................................................... 90
Delete Amazon S3 Objects and Buckets .......................................................................................... 92
Upload In-Line Text Content to Amazon S3 ................................................................................... 94
Amazon EC2 and Tools for Windows PowerShell ............................................................................... 94
Create a Key Pair .................................................................................................................................. 95
Create a Security Group ...................................................................................................................... 97
Find an AMI ......................................................................................................................................... 100
Launch an Instance ............................................................................................................................ 103
AWS Lambda and AWS Tools for PowerShell .................................................................................... 106
Prerequisites ............................................................................................................................................. 6
Install the AWSLambdaPSCore Module ......................................................................................... 107
See Also .................................................................................................................................................. 87
Amazon SQS, Amazon SNS and Tools for Windows PowerShell ................................................... 108
Create an Amazon SQS queue and get queue ARN .................................................................... 108
Create an Amazon SNS topic ........................................................................................................... 108
Give permissions to the SNS topic ................................................................................................. 109
Subscribe the queue to the SNS topic ........................................................................................... 109
Give permissions ................................................................................................................................. 110
Verify results ........................................................................................................................................ 110
CloudWatch from the AWS Tools for Windows PowerShell ............................................................ 111
Publish a Custom Metric to Your CloudWatch Dashboard ......................................................... 111
See Also .................................................................................................................................................. 87
Using ClientCon?g ................................................................................................................................... 112
Using the ClientConfig parameter ............................................................................................ 112
Using an unde?ned property ........................................................................................................... 113
v
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.