AWS Tools for PowerShell

User Guide

AWS Tools for PowerShell

Copyright ? 2024 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.

AWS Tools for PowerShell

AWS Tools for PowerShell: User Guide

User Guide

Copyright ? 2024 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

Table of Contents

User Guide

What are the AWS Tools for PowerShell? ...................................................................................... 1 Maintenance and support for SDK major versions ................................................................................ 2 AWS.Tools .................................................................................................................................................... 2 Core ............................................................................................................................. 3 AWSPowerShell ............................................................................................................................................. 3 How to use this guide ................................................................................................................................. 4

Installation ....................................................................................................................................... 5 Installing on Windows ................................................................................................................................. 5 Prerequisites ............................................................................................................................................. 6 Install AWS.Tools .................................................................................................................................. 6 Install Core ........................................................................................................... 8 Install AWSPowerShell ......................................................................................................................... 10 Enable Script Execution ....................................................................................................................... 10 Versioning ............................................................................................................................................... 12 Updating AWS Tools for PowerShell ................................................................................................ 14 Installing on Linux or macOS .................................................................................................................. 15 Overview of Setup ................................................................................................................................ 15 Prerequisites ............................................................................................................................................. 6 Install AWS.Tools ................................................................................................................................ 16 Install Core ......................................................................................................... 19 Script Execution ..................................................................................................................................... 10 Configuring the PowerShell Console ................................................................................................ 21 Initialize Your PowerShell Session ..................................................................................................... 21 Versioning ............................................................................................................................................... 12 Updating the AWS Tools for PowerShell on Linux or macOS ...................................................... 23 Related Information ............................................................................................................................. 24 Migrating from AWS Tools for PowerShell Version 3.3 to Version 4 ............................................... 24 New Fully Modularized AWS.Tools Version ................................................................................... 24 New Get-AWSService cmdlet ......................................................................................................... 25 New -Select Parameter to Control the Object Returned by a Cmdlet ................................... 25 More Consistent Limiting of the Number of Items in the Output .............................................. 27 Easier to Use Stream Parameters ...................................................................................................... 28 Extending the Pipe by Property Name ............................................................................................ 28 Static Common Parameters ................................................................................................................ 29

iii

AWS Tools for PowerShell

User Guide

AWS.Tools Declares and Enforces Manadatory Parameters ...................................................... 29 All Parameters Are Nullable ............................................................................................................... 29 Removing Previously Deprecated Features ..................................................................................... 30 Get started ..................................................................................................................................... 31 Configure tool authentication ................................................................................................................. 31 Enable and configure IAM Identity Center ...................................................................................... 32 Configure the Tools for PowerShell to use IAM Identity Center. ................................................ 32 Start an AWS access portal session .................................................................................................. 34 Example ................................................................................................................................................... 35 Additional information ........................................................................................................................ 35 Use the AWS CLI ................................................................................................................................... 36 Specify AWS Regions ................................................................................................................................. 40 Specifying a Custom or Nonstandard Endpoint ............................................................................. 41 Additional information ........................................................................................................................ 42 Configure federated identity ................................................................................................................... 42 Prerequisites ........................................................................................................................................... 42 How an Identity-Federated User Gets Federated Access to AWS Service APIs ......................... 43 How SAML Support Works in the AWS Tools for PowerShell ...................................................... 44 How to Use the PowerShell SAML Configuration Cmdlets .......................................................... 45 Additional Reading ............................................................................................................................... 50 Cmdlet discovery and aliases .................................................................................................................. 50 Cmdlet Discovery .................................................................................................................................. 50 Cmdlet Naming and Aliases ............................................................................................................... 56 Pipelining and $AWSHistory .................................................................................................................... 61 $AWSHistory .......................................................................................................................................... 61 Credential and profile resolution ............................................................................................................ 65 Credentials Search Order .................................................................................................................... 65 Users and roles ........................................................................................................................................... 66 Users and permission sets .................................................................................................................. 66 Service roles ........................................................................................................................................... 67 Using legacy credentials ........................................................................................................................... 68 Important warnings and guidelines .................................................................................................. 68 AWS Credentials .................................................................................................................................... 69 Shared Credentials ................................................................................................................................ 78 Work with AWS services ............................................................................................................... 84 PowerShell File Concatenation Encoding .............................................................................................. 84

iv

AWS Tools for PowerShell

User Guide

Returned Objects for the PowerShell Tools ......................................................................................... 85 Amazon EC2 ................................................................................................................................................ 85 Amazon S3 ................................................................................................................................................... 85 AWS Lambda and AWS Tools for PowerShell ...................................................................................... 86 Amazon SNS and Amazon SQS ............................................................................................................... 86 CloudWatch ................................................................................................................................................. 86 See Also ........................................................................................................................................................ 86 Topics ............................................................................................................................................................ 86 Amazon S3 and Tools for Windows PowerShell .................................................................................. 87

Create an Amazon S3 Bucket, Verify Its Region, and Optionally Remove It ............................. 88 Configure an Amazon S3 Bucket as a Website and Enable Logging .......................................... 89 Upload Objects to an Amazon S3 Bucket ....................................................................................... 89 Delete Amazon S3 Objects and Buckets .......................................................................................... 91 Upload In-Line Text Content to Amazon S3 ................................................................................... 93 Amazon EC2 and Tools for Windows PowerShell ............................................................................... 93 Create a Key Pair .................................................................................................................................. 94 Create a Security Group ...................................................................................................................... 96 Find an AMI ......................................................................................................................................... 100 Launch an Instance ............................................................................................................................ 104 AWS Lambda and AWS Tools for PowerShell .................................................................................... 108 Prerequisites ............................................................................................................................................. 6 Install the AWSLambdaPSCore Module ......................................................................................... 109 See Also .................................................................................................................................................. 86 Amazon SQS, Amazon SNS and Tools for Windows PowerShell ................................................... 110 Create an Amazon SQS queue and get queue ARN .................................................................... 110 Create an Amazon SNS topic ........................................................................................................... 110 Give permissions to the SNS topic ................................................................................................. 111 Subscribe the queue to the SNS topic ........................................................................................... 111 Give permissions ................................................................................................................................. 112 Verify results ........................................................................................................................................ 112 CloudWatch from the AWS Tools for Windows PowerShell ............................................................ 113 Publish a Custom Metric to Your CloudWatch Dashboard ......................................................... 113 See Also .................................................................................................................................................. 86 Using ClientConfig ................................................................................................................................... 114 Using the ClientConfig parameter ............................................................................................ 114 Using an undefined property ........................................................................................................... 115

v

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

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

Google Online Preview   Download