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?

AWS CDKの初期設定(Typescript)

0
Posted at

備忘録としてCDKの使い方を残します

AWS CLIのインストール

(Macの場合)

brew install awscli

下記コマンドでバージョンが確認できればOK

aws --version

AWS 設定

下記コマンドで、設定を行います

aws configure
AWS Access Key ID: 発行されたアクセスキーを入力
AWS Secret Access Key: 発行されたシークレットアクセスキーを入力
Default region name: デフォルトで使用するリージョン(例: 東京リージョンは ap-northeast-1)を入力
Default output format: デフォルトの出力形式(json, text, table など。通常は json)を入力

下記コマンドで設定を確認します

aws sts get-caller-identity

CDKのインストール

(Macの場合)

brew install aws-cdk 

下記コマンドでバージョンが確認できればOK

cdk --version

プロジェクトの作成

任意のディレクトリで下記のコマンドを実行(今回はTypeScriptを使用)

cdk init app --language typescript

ディレクトリ配下に、bin,lib等のディレクトリが作成されます

AWS環境をブートストラップ

下記のコマンドで、AWS環境のデプロイ準備をします

cdk bootstrap aws://$(aws sts get-caller-identity --query Account --output text)/$(aws configure get region)

CloudFormationテンプレートを合成

下記コマンドで実行します

cdk synth

cdk.out/が作成されます

終わり

以上が初期設定になります

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?