Skip to content

[Bug]: Ignore tags not working with aws instance ebs volume #29182

Open
@mpostument

Description

Terraform Core Version

1.3.6

AWS Provider Version

4.48.0

Affected Resource(s)

aws_instance

Expected Behavior

On AWS provider i have defined list of ignored tags

  ignore_tags {
    keys         = ["tag-compliant"]
    key_prefixes = ["kubernetes.io/"]
  }

But every time when i run terraform apply i see this

! resource "aws_instance" "this" {
        }
        # (31 unchanged attributes hidden)

!       root_block_device {
!           tags                  = {
-               "tag-compliant" = "yes" -> null
                # (9 unchanged elements hidden)
            }
            # (9 unchanged attributes hidden)
        }

        # (6 unchanged blocks hidden)
    }

Actual Behavior

No changes reported

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_instance" "this" {
  ami                    = var.ami_id
  availability_zone      = var.availability_zone
  instance_type          = var.instance_type
  vpc_security_group_ids = var.security_group
  subnet_id              = var.subnet

  root_block_device {
    volume_type           = var.root_volume_type
    volume_size           = var.oot_volume_size
    delete_on_termination = true
    encrypted             = true

    tags = var.default_tags
  }

  tags = var.default_tags

  lifecycle {
    ignore_changes = [
      #   ami,
      tags["tag-compliant"],
      tags_all["tag-compliant"]
    ]
  }
}

Steps to Reproduce

Create instance and then manually add tag tag-compliant

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/ec2Issues and PRs that pertain to the ec2 service.staleOld or inactive issues managed by automation, if no further action taken these will get closed.tagsPertains to resource tagging.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions