AWS Tools for PowerShell

AWS Tools for PowerShell

User Guide

AWS Tools for PowerShell User Guide

AWS Tools for PowerShell: User Guide

Copyright ? 2023 Amazon Web Services, Inc. and/or its affiliates. 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 affiliated 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 .......................................................................... 1 AWS.Tools ............................................................................................................................... 1 Core .............................................................................................................. 2 AWSPowerShell .......................................................................................................................... 2 How to use this guide ................................................................................................................ 3

Installation ........................................................................................................................................ 4 Installing on Windows ................................................................................................................ 4 Prerequisites ...................................................................................................................... 4 Install AWS.Tools ............................................................................................................. 5 Install Core ............................................................................................ 6 Install AWSPowerShell ........................................................................................................ 7 Enable Script Execution ...................................................................................................... 7 Versioning ......................................................................................................................... 8 Updating AWS Tools for PowerShell ..................................................................................... 9 Installing on Linux or macOS ..................................................................................................... 11 Overview of Setup ........................................................................................................... 11 Prerequisites ...................................................................................................................... 4 Install AWS.Tools ............................................................................................................ 11 Install Core .......................................................................................... 13 Script Execution ................................................................................................................. 7 Configuring the PowerShell Console ................................................................................... 15 Initialize Your PowerShell Session ....................................................................................... 15 Versioning ......................................................................................................................... 8 Updating the AWS Tools for PowerShell on Linux or macOS ................................................... 16 Related Information .......................................................................................................... 16 Migrating from AWS Tools for PowerShell Version 3.3 to Version 4 ................................................. 17 New Fully Modularized AWS.Tools Version ......................................................................... 17 New Get-AWSService cmdlet .......................................................................................... 17 New -Select Parameter to Control the Object Returned by a Cmdlet .................................... 18 More Consistent Limiting of the Number of Items in the Output ............................................. 19 Easier to Use Stream Parameters ........................................................................................ 19 Extending the Pipe by Property Name ................................................................................ 19 Static Common Parameters ............................................................................................... 20 AWS.Tools Declares and Enforces Manadatory Parameters ................................................... 20 All Parameters Are Nullable ............................................................................................... 20 Removing Previously Deprecated Features ........................................................................... 21

Get started ...................................................................................................................................... 22 Configure tool authentication .................................................................................................... 22 Enable and configure IAM Identity Center ........................................................................... 22 Configure the Tools for PowerShell to use IAM Identity Center. .............................................. 23 Start an AWS access portal session ..................................................................................... 23 Example .......................................................................................................................... 24 Additional information ...................................................................................................... 24 Specify AWS Regions ................................................................................................................ 24 Specifying a Custom or Nonstandard Endpoint .................................................................... 26 Configure federated identity ...................................................................................................... 26 Prerequisites .................................................................................................................... 26 How an Identity-Federated User Gets Federated Access to AWS Service APIs ............................. 27 How SAML Support Works in the AWS Tools for PowerShell ................................................... 28 How to Use the PowerShell SAML Configuration Cmdlets ...................................................... 29 Additional Reading ........................................................................................................... 32 Cmdlet discovery and aliases ..................................................................................................... 32 Cmdlet Discovery ............................................................................................................. 32

iii

AWS Tools for PowerShell User Guide

Cmdlet Naming and Aliases ............................................................................................... 36 Pipelining and $AWSHistory ...................................................................................................... 38

$AWSHistory .................................................................................................................... 39 Credential and profile resolution ................................................................................................ 41

Credentials Search Order ................................................................................................... 41 Users and roles ........................................................................................................................ 42

Users and permission sets ................................................................................................. 42 Service roles .................................................................................................................... 43 Using legacy credentials ............................................................................................................ 43 Important warnings and guidelines ..................................................................................... 43 AWS Credentials ............................................................................................................... 44 Shared Credentials ........................................................................................................... 50 Work with AWS services .................................................................................................................... 54 PowerShell File Concatenation Encoding ..................................................................................... 54 Returned Objects for the PowerShell Tools .................................................................................. 54 Amazon EC2 ............................................................................................................................ 55 Amazon S3 .............................................................................................................................. 55 AWS Lambda and AWS Tools for PowerShell ............................................................................... 55 Amazon SNS and Amazon SQS .................................................................................................. 55 CloudWatch ............................................................................................................................. 55 See Also .................................................................................................................................. 55 Topics ..................................................................................................................................... 56 Amazon S3 and Tools for Windows PowerShell ............................................................................ 56 Create an Amazon S3 Bucket, Verify Its Region, and Optionally Remove It ................................ 56 Configure an Amazon S3 Bucket as a Website and Enable Logging .......................................... 57 Upload Objects to an Amazon S3 Bucket ............................................................................ 57 Delete Amazon S3 Objects and Buckets .............................................................................. 59 Upload In-Line Text Content to Amazon S3 ......................................................................... 60 Amazon EC2 and Tools for Windows PowerShell .......................................................................... 60 Create a Key Pair ............................................................................................................. 61 Create a Security Group .................................................................................................... 62 Find an AMI ..................................................................................................................... 65 Launch an Instance ........................................................................................................... 67 AWS Lambda and AWS Tools for PowerShell ............................................................................... 70 Prerequisites ...................................................................................................................... 4 Install the AWSLambdaPSCore Module ................................................................................ 71 See Also .......................................................................................................................... 55 Amazon SQS, Amazon SNS and Tools for Windows PowerShell ...................................................... 71 Create an Amazon SQS queue and get queue ARN ............................................................... 72 Create an Amazon SNS topic ............................................................................................. 72 Give permissions to the SNS topic ...................................................................................... 72 Subscribe the queue to the SNS topic ................................................................................. 73 Give permissions .............................................................................................................. 73 Verify results ................................................................................................................... 73 CloudWatch from the AWS Tools for Windows PowerShell ............................................................. 74 Publish a Custom Metric to Your CloudWatch Dashboard ....................................................... 74 See Also .......................................................................................................................... 55 Using ClientConfig .................................................................................................................... 75 Using the ClientConfig parameter .................................................................................. 75 Using an undefined property ............................................................................................. 75 Specifying the AWS Region ............................................................................................... 76 Security ........................................................................................................................................... 77 Data protection ........................................................................................................................ 77 Data encryption ............................................................................................................... 78 Identity and Access Management ............................................................................................... 78 Audience ......................................................................................................................... 78 Authenticating with identities ............................................................................................ 79

iv

AWS Tools for PowerShell User Guide Managing access using policies .......................................................................................... 81 How AWS services work with IAM ....................................................................................... 83 Troubleshooting AWS identity and access ............................................................................ 83 Compliance Validation .............................................................................................................. 84 Enforcing a minimum TLS version .............................................................................................. 85 Cmdlet reference .............................................................................................................................. 86 Document history ............................................................................................................................. 87

v

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download