मेरे पास नीचे जैसा क्लाउड फॉर्मेशन टेम्प्लेट है। यहां मैं वॉल्यूम को सभी DeleteOnT Terminal को सत्य बनाना चाहता हूं। इसे प्राप्त करने के लिए मैंने केवल BlockDeviceMappings अनुभाग को शामिल किया है जो DeleteOnT Terminal के लिए मान सेट करने की अनुमति देता है। लेकिन मुझे त्रुटि मिल रही है: unixDevice के लिए अमान्य मान '/ dev/sdf'। अनुलग्नक बिंदु /dev/sdf पहले से उपयोग में है

मैं क्या गलत कर रहा हूं? क्या मुझे /dev/sdf को वॉल्यूम सेक्शन से हटा देना चाहिए और इसे केवल BlockDeviceMappings में रखना चाहिए?

"Resources":{ 
   "INSc42a7c2eed094a79acd851bdc9772a13":{ 
      "Type":"AWS::EC2::Instance",
      "Properties":{ 
         "InstanceType":"t2.micro",
         "BlockDeviceMappings":[ 
            { 
               "DeviceName":"/dev/sda1",
               "Ebs":{ 
                  "VolumeSize":"50",
                  "DeleteOnTermination":"true"
               }
            },
            { 
               "DeviceName":"/dev/sdf",
               "Ebs":{ 
                  "VolumeSize":"100",
                  "DeleteOnTermination":"true"
               }
            }
         ],
         "ImageId":"ami-6871a115",
         "KeyName":"${aws_key_pair.KP6a0efc01a84c4103b648b57b425b0ca2.key_name}",
         "NetworkInterfaces":[ 
            { 
               "AssociatePublicIpAddress":"true",
               "DeviceIndex":"0",
               "SubnetId":"subnet-07f722e24335cea6f",
               "GroupSet":[ 
                  "sg-0ed40ed2e6af3db09"
               ]
            }
         ],
         "Volumes":[ 
            { 
               "Device":"/dev/sdf",
               "VolumeId":{ 
                  "Ref":"Volume67430dc919ab486a887388695720e574"
               }
            }
         ],
         "Tags":[ 
            { 
               "Key":"Name",
               "Value":"jagaranteamvoltest"
            },
            { 
               "Key":"vid",
               "Value":"c42a7c2e-ed09-4a79-acd8-51bdc9772a13"
            }
         ]
      }
   },
   "Alias60d46c3715ee4a72a4d3739b951bd4e0":{ 
      "Type":"AWS::KMS::Alias",
      "Properties":{ 
         "AliasName":"alias/KmsKeyVolTest",
         "TargetKeyId":{ 
            "Ref":"KmsKey60d46c3715ee4a72a4d3739b951bd4e0"
         }
      }
   },
   "KmsKey60d46c3715ee4a72a4d3739b951bd4e0":{ 
      "Type":"AWS::KMS::Key",
      "Properties":{ 
         "Description":"key description sample",
         "KeyPolicy":{ 
            "Version":"2012-10-17",
            "Statement":[ 
               { 
                  "Sid":"Allow access for Key Administrators",
                  "Effect":"Allow",
                  "Principal":{ 
                     "AWS":[ 
                        "${data.aws_caller_identity.current.arn}"
                     ]
                  },
                  "Action":[ 
                     "kms:Create*",
                     "kms:Describe*",
                     "kms:Enable*",
                     "kms:List*",
                     "kms:Put*",
                     "kms:Update*",
                     "kms:Revoke*",
                     "kms:Disable*",
                     "kms:Get*",
                     "kms:Delete*",
                     "kms:TagResource",
                     "kms:UntagResource",
                     "kms:ScheduleKeyDeletion",
                     "kms:CancelKeyDeletion",
                     "kms:Encrypt",
                     "kms:Decrypt",
                     "kms:ReEncrypt*",
                     "kms:GenerateDataKey*",
                     "kms:CreateGrant",
                     "kms:ListGrants",
                     "kms:DescribeKey",
                     "ec2:*"
                  ],
                  "Resource":"*"
               }
            ]
         }
      }
   },
   "Volume67430dc919ab486a887388695720e574":{ 
      "Type":"AWS::EC2::Volume",
      "DeletionPolicy":"Delete",
      "Properties":{ 
         "AutoEnableIO":"false",
         "AvailabilityZone":"us-east-1a",
         "Encrypted":"true",
         "KmsKeyId":{ 
            "Ref":"KmsKey60d46c3715ee4a72a4d3739b951bd4e0"
         },
         "Size":"15",
         "VolumeType":"standard",
         "Tags":[ 
            { 
               "Key":"vid",
               "Value":"67430dc9-19ab-486a-8873-88695720e574"
            }
         ]
      }
   }
},
"Outputs":{ 
   "caceedaacdbdca":{ 
      "Description":"Instance ID",
      "Value":{ 
         "Ref":"INSc42a7c2eed094a79acd851bdc9772a13"
      }
   },
   "dceeaadbbde":{ 
      "Description":"KMS Id",
      "Value":{ 
         "Ref":"KmsKey60d46c3715ee4a72a4d3739b951bd4e0"
      }
   }
}
}
0
nightfly 9 पद 2019, 14:39

1 उत्तर

सबसे बढ़िया उत्तर

अपने टेम्पलेट में केवल एक /dev/sdf रखें। या तो "AWS::EC2::Volume" या BlockDeviceMappings से या एक ड्राइव के लिए नाम बदलें। आप एक ही नाम के दो खंड नहीं रख सकते।

1
Sanny Patel 9 पद 2019, 11:47