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

....................................................................................................................................................... xiv 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 ................................................................... 28 Next steps ............................................................................................................................................... 28 Past releases ................................................................................................................................................ 28 Troubleshooting AWS CLI install and uninstall errors ................................................................... 46 Next steps ............................................................................................................................................... 47 Build and install from source .................................................................................................................. 47 Why build from source? ...................................................................................................................... 47 Quicksteps .............................................................................................................................................. 48 Step 1: Setup all requirements .......................................................................................................... 51 Step 2: Configuring the AWS CLI source installation .................................................................... 55 Step 3: Building the AWS CLI ............................................................................................................. 61 Step 4: Installing the AWS CLI ........................................................................................................... 62 Step 5: Verifying the AWS CLI installation ...................................................................................... 64 Workflow examples .............................................................................................................................. 64 Troubleshooting AWS CLI install and uninstall errors ................................................................... 67 Next steps ............................................................................................................................................... 67 Amazon ECR Public/Docker ..................................................................................................................... 68 Prerequisites ........................................................................................................................................... 68 Deciding between Amazon ECR Public and Docker Hub .............................................................. 68

iii

AWS Command Line Interface

User Guide for Version 2

Run the official images ........................................................................................................................ 69 Notes on interfaces and backwards compatibility of the official images .................................. 70 Use specific versions and tags ........................................................................................................... 70 Update to the latest official image ................................................................................................... 71 Share host files, credentials, environment variables, and configuration ................................... 72 Shorten the docker run command .................................................................................................... 78 Setup ............................................................................................................................................................. 81 Gather your credential information for programmatic access .................................................... 81 Setting up new configuration and credentials ............................................................................... 82 Using existing configuration and credentials files ......................................................................... 91 Configure the AWS CLI .................................................................................................................. 92 Configuration and credentials precedence ........................................................................................... 92 Additional topics in this section ............................................................................................................. 93 Configuration and credential file settings ............................................................................................ 94 Format of the configuration and credential files ........................................................................... 94 Where are configuration settings stored? ..................................................................................... 102 Using named profiles ......................................................................................................................... 103 Set and view configuration settings using commands ............................................................... 104 Setting new configuration and credentials command examples .............................................. 107 Supported config file settings ...................................................................................................... 110 Environment Variables ............................................................................................................................ 129 How to set environment variables .................................................................................................. 129 AWS CLI supported environment variables ................................................................................... 130 Command line options ........................................................................................................................... 141 How to use command line options ................................................................................................ 141 AWS CLI supported global command line options ...................................................................... 141 Common uses of command line options ....................................................................................... 146 Command completion ............................................................................................................................ 147 How it works ....................................................................................................................................... 147 Configuring command completion on Linux or macOS ............................................................. 148 Configuring command completion on Windows ......................................................................... 152 Retries ......................................................................................................................................................... 153 Available retry modes ........................................................................................................................ 153 Configuring a retry mode ................................................................................................................. 156 Viewing logs of retry attempts ....................................................................................................... 157 Use an HTTP proxy .................................................................................................................................. 158

iv

AWS Command Line Interface

User Guide for Version 2

Using the examples ............................................................................................................................ 158 Authenticating to a proxy ................................................................................................................. 159 Using a proxy on Amazon EC2 instances ...................................................................................... 160 Troubleshooting .................................................................................................................................. 161 Endpoints ................................................................................................................................................... 161 Set endpoint for a single command ............................................................................................... 161 Set global endpoint for all AWS services ...................................................................................... 161 Set to use FIPs endpoints for all AWS services ............................................................................ 163 Set to use dual-stack endpoints for all AWS services ................................................................. 164 Set service-specific endpoints .......................................................................................................... 165 Endpoint configuration and settings precedence ........................................................................ 207 Authentication and access credentials ....................................................................................... 209 Configuration and credential precedence ........................................................................................... 210 Additional topics in this section ........................................................................................................... 211 IAM Identity Center authentication ..................................................................................................... 211 Prerequisites ........................................................................................................................................ 212 Configure your profile with the aws configure sso wizard ............................................... 213 Configure only your sso-session section with aws configure sso-session wizard .................................................................................................................................................... 216 Manual configuration using the config file ................................................................................ 216 Sign in to an IAM Identity Center session ..................................................................................... 219 Run a command with your IAM Identity Center profile ............................................................. 220 Sign out of your IAM Identity Center sessions ............................................................................. 220 Troubleshooting .................................................................................................................................. 220 Related resources ................................................................................................................................ 221 IAM Identity Center concepts .......................................................................................................... 221 Tutorial: AWS IAM Identity Center and Amazon S3 .................................................................... 225 Short-term credentials ............................................................................................................................ 231 IAM roles .................................................................................................................................................... 232 Prerequisites ........................................................................................................................................ 232 Overview of using IAM roles ............................................................................................................ 232 Configuring and using a role ........................................................................................................... 234 Using MFA ............................................................................................................................................ 236 Cross-account roles and external ID ............................................................................................... 237 Specifying a role session name for easier auditing ..................................................................... 238 Assume role with web identity ........................................................................................................ 238

v

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

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

Google Online Preview   Download