Json CloudFormation EC2 Windows脚本
我只是从云的形成开始。我正在尝试创建两个具有自定义属性(VPC、安全组、子网和标记)的Windows EC2实例,但我不知道如何设置,我从标准AWS模板开始,并对其进行了修改,但失败了Json CloudFormation EC2 Windows脚本,json,windows,amazon-web-services,amazon-ec2,amazon-cloudformation,Json,Windows,Amazon Web Services,Amazon Ec2,Amazon Cloudformation,我只是从云的形成开始。我正在尝试创建两个具有自定义属性(VPC、安全组、子网和标记)的Windows EC2实例,但我不知道如何设置,我从标准AWS模板开始,并对其进行了修改,但失败了 { "cxawsprodnew01": { "Type": "AWS::EC2::Instance", "DeletionPolicy": "Retain", "Tags&qu
{
"cxawsprodnew01": {
"Type": "AWS::EC2::Instance",
"DeletionPolicy": "Retain",
"Tags": [{ "tag": "" }],
"Properties": {
"ImageId": {
"Fn::FindInMap": ["WindowsRegionMap", { "Ref": "AWS::Region" }, "AMI"]
},
"InstanceType": "r4.large",
"InstanceInitiatedShutdownBehavior": "stop",
"DisableApiTermination": "true",
"VPCId": { "Type": "AWS::EC2::VPC::Id", "Ref": "vpc-9b34b5fd" },
"SubnetId": { "Ref": "VpcSubnet1" },
"SGUtilized": {
"Type": "AWS::EC2::SecurityGroup::Id",
"Ref": "ProdOctopusSG"
},
"BlockDeviceMappings": {
"DeviceName": "/dev/sda1",
"Ebs": {
"VolumeType": "standard",
"DeleteOnTermination": "false",
"VolumeSize": "50"
}
}
}
}
}
我如何修改它以允许我添加所需的属性?否,我必须首先将它们设置为参数以调用它们?是的,您可以在“属性”部分声明属性并引用它
{
"Properties": {
"VpcId": {
"Type": "WS::EC2::VPC::Id"
}
},
"Resources":
{
"cxawsprodnew01":
{
"Type": "AWS::EC2::Instance",
"DeletionPolicy": "Retain",
"Tags": [{ "" }],
"Properties":
{
...
"VPCId": { "Ref": "VpcId" },
....
},
},
},
}