Terraform-provider-aws: No change when modifying aws_instance.ebs_block_device.volume_size

Created on 3 Apr 2018  ·  4Comments  ·  Source: hashicorp/terraform-provider-aws

_This issue was originally opened by @adaranutsa as hashicorp/terraform#17769. It was migrated here as a result of the provider split. The original body of the issue is below._


I'm trying to resize the EBS volume within an ebs_block_device on an EC2 instance. Running plan or apply shows no changes are needed.

Terraform Version

Terraform v0.11.5
+ provider.aws v1.13.0

Affected Resource(s)

  • aws_instance

Terraform Configuration Files

resource "aws_instance" "main" {
  ami                    = "ami-12345678"
  instance_type          = "t2.micro"
  vpc_security_group_ids = ["sg-12345678"]
  subnet_id              = "subnet-12345678"

  ebs_block_device {
    device_name = "xvdf"
    volume_size = "50"
    volume_type = "gp2"
    snapshot_id = "snap-1234567890abcdefg"
  }

  ebs_block_device {
    device_name = "xvdd"
    volume_size = "35"
    volume_type = "gp2"
    snapshot_id = "snap-1234567890abcdefg"
  }

  ebs_block_device {
    device_name = "xvde"
    volume_size = "40"
    volume_type = "gp2"
    snapshot_id = "snap-1234567890abcdefg"
  }
}

Expected Behavior


The EBS volume size should have been modified.

Actual Behavior


Nothing happens.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Steps to Reproduce

  • terraform apply
  • Change any ebs_block_device.volume_size to 100
  • terraform apply
  • Additional Context


    I'm launching the instance from an AMI that already has the volumes configured. I'm simply creating the ebs_block_device blocks to match to the device_name on the AMI so that I can control the volume size. It works fine when deploying from scratch but when I try to change the volume size after the instance already exists, nothing happens.

    References


    This issue is the same as the following which seems to have been fixed but not for aws_instance.

    14826

    bug servicec2 waiting-response

    Most helpful comment

    Any update on this issue?
    Would be nice if a fix was included in the next version...

    All 4 comments

    Hey there @adaranutsa – sorry to say that I believe this is a known limitation of Terraform with regards to block devices and aws_instance:

    See the note on that page, copied here for reference:

    NOTE: Currently, changes to *_block_device configuration of existing resources cannot be automatically detected by Terraform. After making updates to block device configuration, resource recreation can be manually triggered by using the taint command.

    Sorry for the trouble!

    I'm going to ping @bflad to see if hey can verify this limitation still exists.

    Closing for now

    Any update on this issue?
    Would be nice if a fix was included in the next version...

    I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

    If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

    Was this page helpful?
    0 / 5 - 0 ratings