0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CloudShellからAWSCLIでAssumeRoleするには

Last updated at Posted at 2025-03-17
  1. CloudShell起動
  2. .awsのconfigを修正
    vi ~/.aws/config
    
  3. credential_sourceにEcsContainerを設定すると、CloudShellコンテナの認証情報でAssumeRole可能
    [default]
    region = ap-northeast-1
    output = json
    
    [profile ARole]
    eole_arn = arn:aws:iam::AAAAAAAAAAAA:role/ARole
    credential_source = EcsContainer
    
    [profile BRole]
    role_arn = arn:aws:iam::BBBBBBBBBBBB:role/BRole
    credential_source = EcsContainer
    
  4. --profileをつけてコマンド実行
    aws s3 ls --profile ARole
    

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?