株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

メモだよ。
CloudFormationを使って自動構築をするお仕事をするので勉強しているよ。

yuta@PROVIDENCE:~$ aws cloudformation create-stack --stack-name rdstest --template-body file:///mnt/c/Users/yuta/Desktop/rds.json  --parameters ParameterKey=KeyName,ParameterValue=awskujirai
{
    "StackId": "arn:aws:cloudformation:ap-northeast-1:522221352138:stack/rdstest/a704b620-6771-11e9-b9eb-0e72822fc3e0"
}

以下のようなParamatersで指定している箇所は、–Parametersで指定する

テンプレートのバリデーションチェックもできる。便利。

yuta@PROVIDENCE:~$ aws cloudformation validate-template --template-body file:///mnt/c/Users/yuta/Desktop/rds.json
{
    "Description": "AWS CloudFormation Test Template vpc_single_instance_in_subnet.template: Create a VPC and add an EC2 instance with a security group. ",
    "Parameters": [
        {
            "NoEcho": false,
            "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instance",
            "ParameterKey": "KeyName"
        },
        {
            "DefaultValue": "0.0.0.0/0",
            "NoEcho": false,
            "Description": " The IP address range that can be used to SSH to the EC2 instances",
            "ParameterKey": "SSHLocation"
        },
        {
            "DefaultValue": "t2.micro",
            "NoEcho": false,
            "Description": "EC2 instance type",
            "ParameterKey": "InstanceType"
        }
    ]
}
yuta@PROVIDENCE:~$ echo $?
0
yuta@PROVIDENCE:~$

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)