AWS Resource Interaction Methods 試験頻度 ⭐⭐⭐⭐⭐

AWS Resource 操作|Console・CLI・SDK・IaC

AWS Management Console / AWS CLI / AWS SDK / Infrastructure as Code

devopsAWS CLIAWS SDKIaC
最終整理

4 方式はすべて AWS API を呼びますが、Interface、Credential、Automation Level が異なります。

一言で理解

Console、CLI、SDK、IaC はすべて AWS API を呼びます。違いは Click、Command、Application Code、Declarative Template のどれから操作するかです。

方式適した用途主な Credential
Console探索、手動操作Password + MFA、SSO Session
CLIBatch、定型 AutomationIdentity Center、Role、Profile
SDKApplication IntegrationCredential Provider Chain
CloudFormation / IaC再現可能な InfrastructureCaller Permission、Service Role

Region Selector は Regional Resource の表示を変えます。Resource が見つからない場合は Account、Identity、Region、List / Describe Permission、Filter / State の順で確認します。Multi-session は Login Context を並行保持するだけです。

Local CLI は Local Credential を使用し、CloudShell は現在の Console Identity の Temporary Credentials を取得します。aws configure は Profile の Credential、Default Region、Output Format を保存するだけで IAM 権限を付与しません。

Access Key ID は識別子、Secret Access Key は署名用秘密、Temporary Credentials は Session Token も必要です。People は Identity Center、Workload は Role を優先します。

Role と Credential Provider Chain

EC2 上で動く CLI / SDK は Instance Profile 経由で IAM Role を利用し、IMDS からローテーションされる Temporary Credentials を取得します。Instance 内で aws configure を実行して長期 Secret を保存しません。Role を Service に渡す操作には通常、範囲を限定した iam:PassRole が必要で、現在の User 自身が Role を Assume する操作とは異なります。

CloudShell の境界

CloudShell は現在の Console Identity に基づく Temporary Credentials を取得し、AWS CLI と Region ごとに分離された永続 HOME Storage を提供します。各 Command は —region で Default Region を上書きできますが、Region の選択で IAM Policy を回避することはできません。一時的な管理・トラブルシューティング向けであり、独立した Identity や高権限入口ではありません。