1
0

More than 1 year has passed since last update.

EC2インスタンスのキーペアCFnで作れるようになったらしい

Last updated at Posted at 2022-09-27

CFnを書いてみる

Resources に書いてみました。
結構簡単ですね。

test-key.yaml
---
AWSTemplateFormatVersion: "2010-09-09"
Description: "test"

Resources:
    TestKeyPair:
        Type: AWS::EC2::KeyPair
        Properties:
            KeyName: Test-Key
            KeyType: rsa

CFnを実行してみる

  • スタックを作成します

1CloudFormation - スタック - Google Chrome 2022-09-27 2.png

  • スタックの名前を記載しました

これ以外はデフォルトで実行しました。

2CloudFormation - スタック - Google Chrome 2022-09-27 2.png

  • 実行完了しました

3CloudFormation - スタック test-key - Google Chrome 202.png

  • キーペア作れていました

4キーペア _ EC2 Management Console - Google Chrome 2022.png

  • 秘密鍵確認

AWS Systems Manager > パラメータストア へ移動します

5AWS Systems Manager - Parameter Store - Google Chr.png

値の表示をクリックすると値が表示されます。
こちらからコピーして使用します。

6AWS Systems Manager - Parameter Store - Google Chr.png

勉強後イメージ

案外普通にできた・・・今度からはCFnで作ろう!

参考

1
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
1
0