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?

🚀 MacにAWS CLIをインストール

Last updated at Posted at 2025-01-26

🤔 AWS CLIってなに?

AWS CLI(AWS Command Line Interface)はAWSのサービスをコマンドラインから操作するための便利なツールです。

🍺 Homebrewをインストール

ターミナルを開き以下のコマンドを実行します

brew --version

インストールされていない場合はこちらを参照しインストールします。

🔑 AWSアカウントのアクセスキーとシークレットキーを準備

AWS CLIを使うには、アクセスキーとシークレットキーが必要です。

これらはAWSリソースにアクセスするための認証情報です。まだ準備していない方は、以下の手順を行いましょう。

1)AWSコンソールにログイン

2)IAMでユーザーを作成または選択

3)アクセスキーを生成して保存✨

※ 詳細は公式ドキュメント📚をご参照ください。

🛠️ インストール

HomebrewでAWS CLIをインストールします。

brew install awscli

以下のコマンドでAWS CLIのバージョンを確認し、インストールされていることを確認します。

aws --version

以下のようにバージョンが出力されたら成功です🎉

aws-cli/2.23.2 Python/3.12.8 Darwin/24.1.0 source/arm64

⚙️ 初期設定

🔧 設定コマンドを実行
aws configure

以下の項目について順番に設定していきます。

設定項目 内容
AWS Access Key ID アクセスキーIDを入力
AWS Secret Access Key シークレットキーを入力
Default region name 利用するリージョンを入力(例: ap-northeast-1)
Default output format JSON, table, textのいずれかを選択(通常はJSON)
🔍 設定確認

以下を実行して設定を確認できます。

cat ~/.aws/config

✅ 動作検証

AWS CLIが正しく設定されているか確認するため、以下のコマンドを実行します。

aws s3 ls

正常に設定されていれば、S3バケットの一覧が表示されます。

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?