aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.53k stars 4.12k forks source link

CodeDeploy: Unable to locate credentials #1825

Closed calvn closed 8 years ago

calvn commented 8 years ago
$ sudo aws deploy install --config-file codedeploy.onpremises.yml --region us-east-1
Creating the on-premises instance configuration file... DONE
Hit http://security.ubuntu.com trusty-security InRelease
Hit http://security.ubuntu.com trusty-security/main Sources   
Hit http://security.ubuntu.com trusty-security/universe Sources             
Hit http://security.ubuntu.com trusty-security/main amd64 Packages            
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages         
Hit http://security.ubuntu.com trusty-security/main Translation-en             
Hit http://security.ubuntu.com trusty-security/universe Translation-en         
Ign http://archive.ubuntu.com trusty InRelease                 
Hit http://archive.ubuntu.com trusty-updates InRelease
Hit http://archive.ubuntu.com trusty-backports InRelease
Hit http://archive.ubuntu.com trusty Release.gpg   
Get:1 http://archive.ubuntu.com trusty-updates/main Sources [261 kB]
Get:2 http://archive.ubuntu.com trusty-updates/restricted Sources [5,352 B]
Get:3 http://archive.ubuntu.com trusty-updates/universe Sources [150 kB]
Get:4 http://archive.ubuntu.com trusty-updates/multiverse Sources [5,547 B]
Get:5 http://archive.ubuntu.com trusty-updates/main amd64 Packages [712 kB]
Get:6 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [15.9 kB]
Get:7 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [338 kB]
Get:8 http://archive.ubuntu.com trusty-updates/multiverse amd64 Packages [13.2 kB]
Hit http://archive.ubuntu.com trusty-updates/main Translation-en
Hit http://archive.ubuntu.com trusty-updates/multiverse Translation-en
Hit http://archive.ubuntu.com trusty-updates/restricted Translation-en
Hit http://archive.ubuntu.com trusty-updates/universe Translation-en
Hit http://archive.ubuntu.com trusty-backports/main Sources
Hit http://archive.ubuntu.com trusty-backports/restricted Sources
Hit http://archive.ubuntu.com trusty-backports/universe Sources
Hit http://archive.ubuntu.com trusty-backports/multiverse Sources
Hit http://archive.ubuntu.com trusty-backports/main amd64 Packages
Hit http://archive.ubuntu.com trusty-backports/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty-backports/universe amd64 Packages
Hit http://archive.ubuntu.com trusty-backports/multiverse amd64 Packages
Hit http://archive.ubuntu.com trusty-backports/main Translation-en
Hit http://archive.ubuntu.com trusty-backports/multiverse Translation-en       
Hit http://archive.ubuntu.com trusty-backports/restricted Translation-en       
Hit http://archive.ubuntu.com trusty-backports/universe Translation-en         
Hit http://archive.ubuntu.com trusty Release                                   
Hit http://archive.ubuntu.com trusty/main Sources                              
Hit http://archive.ubuntu.com trusty/restricted Sources                        
Hit http://archive.ubuntu.com trusty/universe Sources                          
Hit http://archive.ubuntu.com trusty/multiverse Sources                        
Hit http://archive.ubuntu.com trusty/main amd64 Packages                       
Hit http://archive.ubuntu.com trusty/restricted amd64 Packages                 
Hit http://archive.ubuntu.com trusty/universe amd64 Packages                   
Hit http://archive.ubuntu.com trusty/multiverse amd64 Packages                 
Hit http://archive.ubuntu.com trusty/main Translation-en                       
Hit http://archive.ubuntu.com trusty/multiverse Translation-en                 
Hit http://archive.ubuntu.com trusty/restricted Translation-en                 
Hit http://archive.ubuntu.com trusty/universe Translation-en                   
Ign http://archive.ubuntu.com trusty/main Translation-en_US                    
Ign http://archive.ubuntu.com trusty/multiverse Translation-en_US              
Ign http://archive.ubuntu.com trusty/restricted Translation-en_US              
Ign http://archive.ubuntu.com trusty/universe Translation-en_US                
Fetched 1,501 kB in 10s (148 kB/s)                                             
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ruby2.0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 92 not upgraded.
Installing the AWS CodeDeploy Agent... ERROR
Unable to locate credentials
Install the AWS CodeDeploy Agent on the on-premises instance by following the instructions in "Configure Existing On-Premises Instances by Using AWS CodeDeploy" in the AWS CodeDeploy User Guide.

The codedeploy.onpremises.yml is a file automatically created by aws deploy register.


---
region: us-east-1
iam_user_arn: arn:aws:iam::123709812981:user/AWS/CodeDeploy/VagrantBox003
aws_access_key_id: <removed>
aws_secret_access_key: <removed>

The other oddity is that somehow aws deploy install doesn't use the region even though it's specified in the yml file.

$ sudo aws deploy install --config-file codedeploy.onpremises.yml

Region not specified.
kyleknap commented 8 years ago

We will look into this issue. Also what version of the CLI are you running? You can figure this out by running aws --version.

calvn commented 8 years ago

Host: aws-cli/1.10.8 Python/2.7.10 Darwin/15.3.0 botocore/1.3.30 On-prem: aws-cli/1.10.8 Python/2.7.6 Linux/3.13.0-68-generic botocore/1.3.30

feverLu commented 8 years ago

Hope this helps you. Thanks!

calvn commented 8 years ago

@feverLu No, I did not run aws configure, but once I did it worked correctly. Thanks for pointing out the different meaning for the aws-region flag and the one in the YAML file. I wouldn't mind if I need to provide a region to the aws deploy install command.