amazon-web-services - Terraform:无法指定加密标志,因为设备 /dev/sda1 已指定快照
问题描述
我正在迁移我的Autoscaling 组以使用launch_template而不是launch_configuration。(支持T2无限)
下面是我的代码片段。
resource "aws_launch_template" "test_launch_template" {
image_id = "ami_id"
name_prefix = "test-pref"
instance_type = "t2.small"
key_name = "jayesh"
vpc_security_group_ids = ["sg-23423432","sg-23452115"]
user_data = "${base64encode(data.template_file.user_data.rendered)}"
iam_instance_profile {
name = "test"
}
disable_api_termination = true
instance_initiated_shutdown_behavior = "terminate"
block_device_mappings {
device_name = "/dev/sda1"
ebs {
delete_on_termination = true
volume_size = "${var.volume_size}"
}
}
credit_specification {
cpu_credits = "unlimited"
}
lifecycle {
create_before_destroy = "true"
}
}
运行 terraform apply 时出现以下错误。
发生 1 个错误:
aws_autoscaling_group.test_asg:发生 1 个错误:
aws_autoscaling_group.test_asg:创建 AutoScaling 组时出错:
ValidationError:您必须使用有效的全格式启动模板。无法指定加密标志,因为设备 /dev/sda1 已指定快照。
状态码:400,请求 ID:7902a390-58de-11e8-af77-87d327f8b121
可能是缺少任何参数,但我不确定是哪一个。
根据错误,它看起来指定了加密参数。但我还没有通过。那么为什么会出现这个错误呢?
提前致谢!
解决方案
推荐阅读
- azure - 如何将 ACR 存储库中的所有图像导入不同租户中的另一个 ACR
- c# - 为什么我在可脚本化对象上的 for 循环会丢失对象
- google-apps-script - 在 Google 表格插件的前端捕获 onSelectionChange
- c# - 从 XSD 文件生成多个 C# 类
- python - 如何将浮点数转换为整数以便可以在 randint 中使用
- reactjs - 在没有表单的情况下处理 React 中的输入
- javascript - 如何在特定列下的 Datatables 中添加新行?
- ipython - 安装 ipython 命令显示错误消息
- r - 如何替换异常值?
- java - 了解java中的堆栈递归