terraform-aws-modules / terraform-aws-ec2-instance

Terraform module to create AWS EC2 instance(s) resources πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/ec2-instance/aws
Apache License 2.0
754 stars 1.87k forks source link

unable to modify volume type from gp2 to gp3 for ebs_volumes #322

Closed mwimpelberg28 closed 1 year ago

mwimpelberg28 commented 1 year ago

Description

Under the variable ebs_volumes_db01 which is utilized by ebs_block_device, I created an ebs volume called xvdb with type gp2. When I change the volume type to gp3, no change is reflected in tf for that device.

Versions

Reproduction Code [Required]

variable "ebs_volumes_db01" {
  default = [
    {
      device_name = "xvdb"
      volume_type = "gp3"
      volume_size = 10
      encrypted   = true
    }
  ]
}

variable "ebs_optimized_db01" {
  default = false
}

variable "root_block_device" {
  default = [
    {
      volume_type = "gp3"
      volume_size = 150
      encrypted   = true
    }
  ]
}

module "ec2-db01" {
  source  = "github.com/terraform-aws-modules/terraform-aws-ec2-instance.git?ref=v4.3.0"
  name                        = "test-instance"
  ami                         = "ami-0d1feff6b88eb18bd"
  instance_type               = "t3.medium"
  subnet_id                   = "subnet-01b149f7dbd1588cc"
  vpc_security_group_ids      = ["sg-027b3e41152846307"]
  associate_public_ip_address = false
  key_name                    = "test-keypair"
  monitoring                  = false
  root_block_device = var.root_block_device
  ebs_block_device = var.ebs_volumes_db01
}

Steps to reproduce the behavior:

No

Yes

I changed the variable from gp2 to gp3

Expected behavior

I expect the volume type to change for all volumes.

Actual behavior

Only the root volume showed a change

  # module.ec2-db01.aws_instance.this[0] will be updated in-place
  ~ resource "aws_instance" "this" {
        id                                   = "i-041828532d8825372"
        tags                                 = {
            "Name" = "test-instance"
        }
        # (31 unchanged attributes hidden)

      ~ root_block_device {
            tags                  = {}
          ~ volume_type           = "gp2" -> "gp3"
            # (8 unchanged attributes hidden)
        }

        # (8 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 1 year ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 1 year ago

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.