![](/img/trans.png)
[英]Not able to SSH into the EC2 Instance with CloudFormation Template
[英]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.