0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AWS CloudFormationを動かすためのAWS CLIの設定

0
Last updated at Posted at 2020-10-27

この記事でわかること

  • AWS CloudFormationを動かすためのAWS CLIの設定 で扱う作業の全体像
  • 手順を進める前に確認したい前提
  • 今の環境で試すときに気をつけたい点

はじめに

AWS CloudFormationを動かすための事前準備として、AWS CLIの設定が必要です。

設定方法

  • Amazon Linux 2
    ※デフォルトでAWS CLIが利用できます。

    1. AdministratorAccessポリシー関連付けたIAMロールを作成し、EC2インスタンスにアタッチします。
    2. ~/.bashrcにexport AWS_DEFAULT_REGION=ap-northeast-1を追記します。
    3. source ~/.bashrcを実行してください。
  • Mac

  1. brew install awscliを実行し、AWS CLIをインストールします。

  2. IAMユーザーを作成し、アクセスキーとシークレットキーを発行しましす。

  3. aws 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


## 関連記事

CLI設定のあとにCloudFormationテンプレートを実行する場合や、AWSインフラ構築の工程全体を整理したい場合は、次の記事も参考になります。

- [AWSインフラ工程を5ステップで整理する 要件定義・設計・実装・検証](https://qiita.com/s_horikoshi/items/63f4525e64c3cac45415)
- [はじめてのAWS CloudFormationテンプレートを理解する](https://qiita.com/s_horikoshi/items/eb7b0fa1675b5199b9b7)

## 実務で使うときの確認ポイント

- AWSアカウント、リージョン、IAM権限、料金影響を確認してから実行する。
- CloudFormationやTerraformを使う場合は、変更差分を確認してから反映する。
- 検証環境で動作確認し、不要なリソースは削除する。
- サービス仕様、上限、推奨設定は変わるため、公式ドキュメントで現在の内容を確認する。

## おわりに

ここまで読んでいただきありがとうございました。
Wealthy Designでは、AWS・Webシステム開発・AI活用など、現場で使える技術を大切にしています。

会社の取り組みは、会社サイトにまとめています。
https://wealthy-design.com/
0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?