2015-03-10 23 views
8

AW2 CLI'yi EC2 örneğim içinden kullanırken Örnek profil kimlik bilgilerini kullanmak istediğimi nasıl belirtebilirim?AWS CLI kullanarak Örnek Profil Kimlik Bilgileri

Instance profile credentials – these credentials can be used on EC2 
instances with an assigned instance role, and are delivered through 
the Amazon EC2 metadata service. 

bu otomatik mi yoksa meta veri servisini arayıp ~/.aws/credentials dosyaya döndü kimlik bilgilerini kaydetmek ... daha sonra arama yapmak gerekiyor: docs demek?

cevap

9

IAM Roles hakkında konuşuyorsunuz. Bunlar EC2 örneğine eklenir ve tuşlar dört saatte bir döner/döndürülür.

'u, örnek meta verilerinden alıp aws-cli veya SDK'ya göndermeniz gerekir, otomatik olarak çeker.

Eğer --debug bayrağıyla aws-cli çalıştırırsanız, kimlik bilgileri aldı varlık görmelisiniz:

$ aws --debug s3 ls 
... 
2015-03-10 18:15:04,459 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: iam-role 
2015-03-10 18:15:04,465 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTP connection (1): 169.254.169.254 
2015-03-10 18:15:04,466 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - DEBUG - "GET /latest/meta-data/iam/security-credentials/ HTTP/1.1" 200 37 
2015-03-10 18:15:04,468 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTP connection (1): 169.254.169.254 
2015-03-10 18:15:04,469 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - DEBUG - "GET /latest/meta-data/iam/security-credentials/myrole-snipped HTTP/1.1" 200 898 
2015-03-10 18:15:04,469 - MainThread - botocore.credentials - INFO - Found credentials from IAM Role: myrole-snipped 
İlgili konular