Terraform aws_instance - 更改 volume_size [英] Terraform aws_instance - changing volume_size

查看:17
本文介绍了Terraform aws_instance - 更改 volume_size的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试增加我的 ami ami-0d013c5896434b38a 的根卷的大小 - 我正在使用 terraform 来配置它.

I am trying to increase size of my root volume for my ami ami-0d013c5896434b38a - I am using terraform to provision this.

澄清一下 - 我只有 1 个实例.而且我想确保如果我需要增加磁盘空间,我不必先破坏机器.弹性 (EC2) 是我相信它是可行的理由.

Just to clarify - I have only 1 instance. And I want to make sure that if I need to increase the disk space, I don't have to destroy the machine first. Elasticity (EC2) is my reason to believe that it's doable.

有人知道这是否可行吗?是的,我可以简单地执行 terraform plan 并进行试运行,但只是仔细检查.

Does anyone know whether this is doable? Yes, I could simply do terraform plan and do a dry-run, but just double-checking.

推荐答案

ebs_block_device -(可选)一个或多个配置块以及附加 EBS 块设备以附加到实例.块设备配置仅适用于资源创建.

ebs_block_device - (Optional) One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation.

因此,根据文档,ebs_block_device 只能在创建资源期间应用.在您的情况下,它是一个需要重新创建的 EC2 实例.

So, as per documentation, ebs_block_device can only be applied during creation of the resource. In your case it is an EC2 instance which needs to be re-created.

这篇关于Terraform aws_instance - 更改 volume_size的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆