LoginSignup
8
3

More than 5 years have passed since last update.

YAMLでCloudFormation Templateを書く

Last updated at Posted at 2018-05-26

CloudFormation Template

VSCodeとYAML schemaを使って、簡単かつ高速でTemplateを書くことができます。
IntelliSense、AutoComplete、Validateもやってくれますの、超ハッピー:grin:

事前準備

VSCodeの設定

  • [Ctrl + Shift + X] > [YAML入力] > [YAML Support by Red Hat]
    • インストール完了 > 読込ボタンクリック
  • Settings (Ctrl + Comma) > 下記設定を追加
"yaml.schemas": {
    "https://raw.githubusercontent.com/awslabs/goformation/master/schema/cloudformation.schema.json": [
        "cf.yaml",
        "cf.yml"
    ]
},
"yaml.validate": false

使用方法

  • *cf.yaml*cf.ymlのファイルは対象になる、[Ctrl + Space]でIntelliSense超楽
  • 注意点:Resources sectionは任意のLogicIdを入力してから、IntelliSenseが効く
  • 注意点:IntelliSense効くのは最後の行のみ

YAMLスキーマについて

他も色々ありますので、興味ある方は下記サイトをご覧ください。
http://schemastore.org/json/

validateについて

組み込み関数(Fn::xxx)はうまく動作しないため、validateを無効にします。
validateはaws-cliを使ってやるしかいない。。。

8
3
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
8
3