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?

More than 5 years have passed since last update.

[MAC]aws-cliでiamアカウントの接続設定

0
Posted at

はじめに

awsを8年以上前に使って、再度仕事で触ったので、覚書。
個人でもそろそろ使ってみようと思ってる。

CLIインストール

homebrewにてインストール

% brew install awscli

インストールされたかの確認とバージョンチェック

% aws --version

ここでバージョンが表示されたら成功

アクセスキーとシークレットキーの取得

awsのマネージメント画面のユーザページより「認証情報」タグで「アクセスキーの作成」を押下する。
そこでキーを二つ取得できる。

cli接続

configureコマンドで対話式に情報を登録する。

% aws configure
AWS Access Key ID [None]: [アクセスキー]
AWS Secret Access Key [None]: [シークレットキー]
Default region name [None]: [リージョン(ap-northeast-1)]
Default output format [None]:[フォーマット(json)]

~/.awsにconfigとcredentialsの2ファイルができる。

% ls ~/.aws
config      credentials

configureで設定した四項目が記載されている。
credentialsにはアクセスキーとシークレットキー。

あとは

あとはs3にコマンドでバケット作成などguiでできることができる。
https://docs.aws.amazon.com/ja_jp/cli/latest/userguide/cli-services-s3-commands.html

ci環境でバケットに配布物を自動化で送るなどできる

ついで

静的ページをホスティングするときに閲覧制限をかけたい場合に、バケットポリシーで出来そうかと思っていたがこれは無理だった。basic認証であれば、Lambda + CloudFrontを使うと良いらしい

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?