簡體   English   中英

aws cli 不遵守默認區域配置

[英]aws cli not honouring default region configuration

我在~/.aws/config文件中設置了默認區域:

[default]
region=us-west-2

但是,當我為某些特定配置文件嘗試describe-instances命令時,它失敗並顯示以下消息:

$ aws ec2 describe-instances --profile my_profile
You must specify a region. You can also configure your region by running "aws configure".

它不應該使用~/.aws/config文件中配置的默認配置文件嗎? 我在這里想念什么?

aws configure list的 Output :

      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                <not set>             None    None
access_key     ******************** shared-credentials-file
secret_key     ******************** shared-credentials-file
    region                us-west-2      config-file    ~/.aws/config

aws configure list --profile my_profile

      Name                    Value             Type    Location
      ----                    -----             ----    --------
   profile                my_profile           manual    --profile
access_key     ******************** shared-credentials-file
secret_key     ******************** shared-credentials-file
    region                <not set>             None    None

ps是AWS的新手。 如果這是一個非常基本的問題,請原諒我。

您正在使用命名配置文件,默認情況下使用default配置文件。 就像您configure默認值一樣,您可以/需要配置您的配置文件。

aws configure --profile my_profile

它將提示您填寫access keysecret access keyAWS Regionoutput format ,如此所述

您可以通過指定 --profile 選項並分配名稱來創建可以使用名稱引用的其他配置。 以下示例創建一個名為 produser 的配置文件。 您可以指定來自與其他配置文件完全不同的賬戶和區域的憑證。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM