繁体   English   中英

在CloudFormation模板中命名EC2实例?

[英]Name an EC2 Instance in the CloudFormation template?

我有一个模板可以工作并生成一个堆栈,但我找不到要设置的属性或其他允许我给我创建的EC2实例提供名称的东西。 生成时,名称为空。

您需要将具有键Name的标记添加到云形成模板。 像这样...

"ec2-instance" : {
    "Type" : "AWS::EC2::Instance",
    "Properties" : {
        "ImageId" : "ami-0102022,
        "SecurityGroupIds" : [{ "Ref" : "SecurityGroup" }],
        "SubnetId" : { "Ref" : "Subnet" },
        "InstanceType" : "m1.medium",
        "Tags" : [
            {"Key" : "Name", "Value" : "Instance name"},
            {"Key" : "Environment", "Value" : { "Ref" : "Environment" }},
            {"Key" : "Owner", "Value" : { "Ref" : "Owner" }}
        ]
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM