cloud:aws:awscli
差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
| cloud:aws:awscli [2017/12/01 08:06] – [Route53のAレコード更新] hayashi | cloud:aws:awscli [2024/01/12 07:58] (現在) – [インストール] hayashi | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| + | ====== AWS コマンドラインインターフェイス(CLI) ====== | ||
| + | ===== インストール ===== | ||
| + | |||
| + | < | ||
| + | |||
| + | pipでもインストールできるがAWSの推奨に従いダウンロードしてインストールする | ||
| + | |||
| + | |||
| + | <code bash> | ||
| + | curl " | ||
| + | unzip awscliv2.zip | ||
| + | sudo ./ | ||
| + | aws --version | ||
| + | </ | ||
| + | |||
| + | ===== AWS CLI の設定 ===== | ||
| + | 普通は、aws configure コマンドが簡単 | ||
| + | |||
| + | aws configure | ||
| + | AWS Access Key ID [None]: < | ||
| + | AWS Secret Access Key [None]: < | ||
| + | Default region name [None]: us-west-2 | ||
| + | Default output format [None]: json | ||
| + | |||
| + | ===== コマンド ===== | ||
| + | |||
| + | 使用可能なオプションとサービスのリストを表示 | ||
| + | |||
| + | # aws help | ||
| + | |||
| + | ===== EC2 ===== | ||
| + | [Name]tagの一覧 | ||
| + | |||
| + | $ aws ec2 describe-instances --query ' | ||
| + | instance IDを追加 | ||
| + | $ aws ec2 describe-instances --query ' | ||
| + | |||
| + | tag名と値でフィルタ | ||
| + | |||
| + | $ aws ec2 describe-instances --filters ' | ||
| + | OR | ||
| + | $ aws ec2 describe-instances --filters ' | ||
| + | |||
| + | ===== S3 ===== | ||
| + | バケットのリスト表示 | ||
| + | |||
| + | aws s3 ls s3:// | ||
| + | |||
| + | バケットから、ローカルへダウンロード | ||
| + | |||
| + | aws s3 cp s3:// | ||
| + | |||
| + | ==== デフォルト暗号化 ==== | ||
| + | 状態の取得:設定されていない場合にはErrorになる | ||
| + | $aws s3api get-bucket-encryption --bucket < | ||
| + | |||
| + | 設定 | ||
| + | $aws s3api put-bucket-encryption --bucket < | ||
| + | |||
| + | <code json conf.json> | ||
| + | { | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | ] | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | **既存ファイルは暗号化されないので注意** | ||
| + | ===== Route53のAレコード更新 ===== | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ===== 参考 ===== | ||
| + | |||
| + | * [[http:// | ||
