使用EC2实例创建JSON云形成模板,该实例也附加EBS卷...

时间:2015-08-27 20:22:01

标签: templates cloud amazon

我对编程一般都很陌生......所以,如果我的问题非常广泛,请原谅我,因为老实说,我不知道自己在做什么。任何指导或指示将不胜感激!

2 个答案:

答案 0 :(得分:0)

关闭我在网上观看的一些培训视频;这就是我作为模板的基础/基础......我是在正确的轨道上吗?老实说,我不知道我在做什么...... :(

AWS::EC2::Instance

{

    "Resources" : {`enter code here`
        "AWSCloudFormationTemplate" : {
            "Type" : "AWS::EC2::Instance"
        }
    }
}

{
    "Type" : "AWS::EC2::Instance",
    "Properties" : {
    "Availability Zone" : String,
    "BlockDeviceMappings" : [EC2 Block Device Mapping, ...],
    "Disabled ApiTermination" : Boolean,
    "Ebsptimized" : Boolean,
    "IamInstanceProfile" : String,
    "ImageId" : String,
    "InstanceInitiatedShutdownBehavior" : String,
    "InstanceType" : String,
    "KernelId" : String,
    "KeyName" : String,
    "Monitoring" : Boolean,
    "NetworkInterfaces" : [ EC2 Network Interface, ...],
    "PlacementGroupName" : String,
    "PrivateIpAddress" :  String,
    "RamdiskId" : String,
    "SecurityGroupIds" : [ String, ...],
    "SecurityGroups" : [String, ...],
    "SourceDestCheck" : Boolean,
    "SubnetId" :  String,
    "Tags" : [ Resource Tag, ...],
    "Tenancy" : String,
    "UserData" : String,
    "Volumes" : [EC2 MountPoint, ...],
    "AdditionalInfo" : String

    }


}
}

答案 1 :(得分:0)

使用 BlockDeviceMappings 这个剪辑会创建具有专用200Gb SSD卷的实例:


      "MASTER" : {
      "Type" : "AWS::EC2::Instance",
      "Properties" : {
        "Tags":[{"Key":"Name", "Value":"MASTER"}],
        "SecurityGroups" : [ { "Ref" : "InstanceSecurityGroup" } ],
        "KeyName" : "mykey",
        "BlockDeviceMappings": [
                 {
                        "DeviceName": "/dev/sda1",
                        "Ebs": {
                            "VolumeSize": "200",
                            "VolumeType": "io1",
                            "Iops": "2000"
                            }
                        }
                ],
        "ImageId" : "ami-a25415cb",
        "InstanceType": "m1.large"
      }
      }