我有一个CloudFormation模板,它创建了在我的环境中托管Web应用程序所需的基础结构。这包括AutoScaling组和启动配置:
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({extended:false}));
app.use(bodyParser.json());
漏洞扫描程序标记了由于上述启动配置中的实例的启动卷未加密而导致的风险。
当我尝试通过更改模板中的配置来加密启动卷时,如下所示:
"LaunchConfiguration": {
"Type": "AWS::AutoScaling::LaunchConfiguration",
"Properties": {
"AssociatePublicIpAddress": false,
"IamInstanceProfile": {
"Ref": "InstanceRoleInstanceProfile"
},
"ImageId": {
"Ref": "WindowsImage"
},
"InstanceType": {
"Ref": "InstanceType"
},
"SecurityGroups": [
{
...
}
],
"KeyName": {
"Ref": "KeyPairName"
},
"UserData": {
...
},
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": {
"VolumeType": "gp2"
}
}
]
},
"Metadata": {
...
}
}
我收到以下错误:
启动新的EC2实例。状态原因:加密标志不能 指定,因为设备/ dev / sda1指定了快照。 启动EC2实例失败。
我读过您可以通过
加密启动卷我需要CloudFormation来创建已加密的EC2实例。知道这是否可行?