amazon-web-servicesamazon-ec2terraform

aws_instance - changing volume_size


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

Just to clarify - I have only one 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.

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


Solution

  • 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.

    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.