AWS Command Line Interface

User Guide for Version 2

AWS Command Line Interface

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

AWS Command Line Interface

AWS Command Line Interface: User Guide for Version 2

User Guide for Version 2

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 Command Line Interface

Table of Contents

User Guide for Version 2

......................................................................................................................................................... ix About the AWS CLI .......................................................................................................................... 1

About AWS CLI version 2 ............................................................................................................................ 1 Maintenance and support for SDK major versions ................................................................................ 2 About Amazon Web Services ..................................................................................................................... 2 About the examples ..................................................................................................................................... 2 Additional documentation and resources ................................................................................................ 4

AWS CLI documentation and resources .............................................................................................. 4 Other AWS SDKs and tools ................................................................................................................... 4 Get started ....................................................................................................................................... 6 Prerequisites .................................................................................................................................................. 7 Create an IAM or IAM Identity Center administrative account ...................................................... 7 Next steps ................................................................................................................................................. 8 Install/Update ................................................................................................................................................ 8 AWS CLI install and update instructions ............................................................................................ 9 Troubleshooting AWS CLI install and uninstall errors ................................................................... 22 Next steps ............................................................................................................................................... 23 Past releases ................................................................................................................................................ 23 Troubleshooting AWS CLI install and uninstall errors ................................................................... 41 Next steps ............................................................................................................................................... 41 Build and install from source .................................................................................................................. 41 Why build from source? ...................................................................................................................... 42 Quicksteps .............................................................................................................................................. 42 Step 1: Setup all requirements .......................................................................................................... 45 Step 2: Configuring the AWS CLI source installation .................................................................... 49 Step 3: Building the AWS CLI ............................................................................................................. 55 Step 4: Installing the AWS CLI ........................................................................................................... 56 Step 5: Verifying the AWS CLI installation ...................................................................................... 58 Workflow examples .............................................................................................................................. 58 Troubleshooting AWS CLI install and uninstall errors ................................................................... 61 Next steps ............................................................................................................................................... 61 Amazon ECR Public/Docker ..................................................................................................................... 62 Prerequisites ........................................................................................................................................... 62 Deciding between Amazon ECR Public and Docker Hub .............................................................. 62

iii

AWS Command Line Interface

User Guide for Version 2

Run the official images ........................................................................................................................ 63 Notes on interfaces and backwards compatibility of the official images .................................. 64 Use specific versions and tags ........................................................................................................... 64 Update to the latest official image ................................................................................................... 65 Share host files, credentials, environment variables, and configuration ................................... 66 Shorten the docker run command .................................................................................................... 72 Setup ............................................................................................................................................................. 75 Gather your credential information for programmatic access .................................................... 75 Setting up new configuration and credentials ............................................................................... 76 Using existing configuration and credentials files ......................................................................... 85 Configure the AWS CLI .................................................................................................................. 86 Configuration and credentials precedence ........................................................................................... 86 Additional topics in this section ............................................................................................................. 87 Configuration and credential file settings ............................................................................................ 88 Format of the configuration and credential files ........................................................................... 88 Where are configuration settings stored? ....................................................................................... 96 Using named profiles ........................................................................................................................... 97 Set and view configuration settings using commands ................................................................. 98 Setting new configuration and credentials command examples .............................................. 101 Supported config file settings ...................................................................................................... 104 Environment Variables ............................................................................................................................ 123 How to set environment variables .................................................................................................. 123 AWS CLI supported environment variables ................................................................................... 124 Command line options ........................................................................................................................... 135 How to use command line options ................................................................................................ 135 AWS CLI supported global command line options ...................................................................... 135 Common uses of command line options ....................................................................................... 140 Command completion ............................................................................................................................ 141 How it works ....................................................................................................................................... 141 Configuring command completion on Linux or macOS ............................................................. 142 Configuring command completion on Windows ......................................................................... 146 Retries ......................................................................................................................................................... 147 Available retry modes ........................................................................................................................ 147 Configuring a retry mode ................................................................................................................. 150 Viewing logs of retry attempts ....................................................................................................... 151 Use an HTTP proxy .................................................................................................................................. 152

iv

AWS Command Line Interface

User Guide for Version 2

Using the examples ............................................................................................................................ 152 Authenticating to a proxy ................................................................................................................. 153 Using a proxy on Amazon EC2 instances ...................................................................................... 154 Troubleshooting .................................................................................................................................. 155 Endpoints ................................................................................................................................................... 155 Set endpoint for a single command ............................................................................................... 155 Set global endpoint for all AWS services ...................................................................................... 155 Set to use FIPs endpoints for all AWS services ............................................................................ 157 Set to use dual-stack endpoints for all AWS services ................................................................. 158 Set service-specific endpoints .......................................................................................................... 159 Endpoint configuration and settings precedence ........................................................................ 201 Authentication and access credentials ....................................................................................... 203 Configuration and credential precedence ........................................................................................... 204 Additional topics in this section ........................................................................................................... 205 IAM Identity Center authentication ..................................................................................................... 205 Prerequisites ........................................................................................................................................ 206 Configure your profile with the aws configure sso wizard ............................................... 207 Configure only your sso-session section with aws configure sso-session wizard .................................................................................................................................................... 210 Manual configuration using the config file ................................................................................ 210 Sign in to an IAM Identity Center session ..................................................................................... 213 Run a command with your IAM Identity Center profile ............................................................. 214 Sign out of your IAM Identity Center sessions ............................................................................. 214 Troubleshooting .................................................................................................................................. 214 Related resources ................................................................................................................................ 215 IAM Identity Center concepts .......................................................................................................... 215 Tutorial: AWS IAM Identity Center and Amazon S3 .................................................................... 219 Short-term credentials ............................................................................................................................ 225 IAM roles .................................................................................................................................................... 226 Prerequisites ........................................................................................................................................ 226 Overview of using IAM roles ............................................................................................................ 226 Configuring and using a role ........................................................................................................... 228 Using MFA ............................................................................................................................................ 230 Cross-account roles and external ID ............................................................................................... 231 Specifying a role session name for easier auditing ..................................................................... 232 Assume role with web identity ........................................................................................................ 232

v

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

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

Google Online Preview   Download