Skip to content

ebs_block_device - # forces replacement #374

@AGirin

Description

@AGirin

Description

This hit me many times at this point.

Code:

      ebs_block_device = [
        {
          device_name = "/dev/sdl"
          volume_type = "gp3"
          volume_size = local.disk_size
          tags        = local.tags
        }
      ]

Instance builds OK with no issues. EBS device is attached and of correct size. Without doing anything I re-run terraform plan and get this (like 100% of the times):

    - ebs_block_device { # forces replacement
          - delete_on_termination = true -> null
          - device_name           = "/dev/sdl" -> null
          - encrypted             = true -> null
          - iops                  = 3000 -> null
          - kms_key_id            = "arn:aws:kms:xxxx:xxxxxkey/" -> null
          - snapshot_id           = "snap-xxxxxx" -> null
          - tags                  = {
              - "Application" = "xxxxxx"
              - "Environment" = "xxxxxx"
              - "Name"        = "xxxxx"
              - "cost-center" = "xxxxx"
              - "retention"   = "xxxxxx"
              - "terraform"   = "xxxxxx"
              - "vpc"         = "xxxxx"
            } -> null
          - throughput            = 125 -> null
          - volume_id             = "vol-xxxxx" -> null
          - volume_size           = xxx -> null
          - volume_type           = "gp3" -> null
        }

I use latest module and terraform versions... The above happens on Linux or Windows servers... And I have no idea why module is trying to replace the drive...

I am force to comment out this section after instance is created and create/import aws_ebs_volume and aws_volume_attachment resources to stop instance replacement on every terraform plan/apply...

Versions

Module: 5.6.0

Terraform v1.7.0
on linux_amd64

  • provider registry.terraform.io/hashicorp/aws v5.32.1
  • provider registry.terraform.io/hashicorp/tls v4.0.5

Expected Behavior:

terraform plan shows no changes as nothing have changed..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions