aws_ec2_transit_gateway_peering_attachment wants to replace if no `options` block is supplied

Author: tmccombsCreated Sep 23, 2026Updated Sep 26, 2026
Labelsbugneeds-triageservice/transitgateway

Terraform and AWS Provider Version

bash
OpenTofu v1.12.6
on linux_amd64
+ provider registry.opentofu.org/hashicorp/aws v6.66.0

Affected Resource(s) or Data Source(s)

  • aws_ec2_transit_gateway_peering_attachment

Expected Behavior

I should be able to leave off the optional options block without terraform wanting to replace (destroy and create) the resource.

Actual Behavior

I created a aws_ec2_transit_gateway_peering_attachment, and didn't specify the optional options block.

Today, terraform started saying it needed to replace the resource, because in AWS it had an options block, but the configuration didn't.

Relevant Error/Panic Output

n/a

Sample Terraform Configuration

Click to expand configuration
hcl
resource "aws_ec2_transit_gateway_peering_attachment" "main" {
  region = var.region

  peer_account_id         = var.dest.owner_id
  peer_region             = var.peer_region
  peer_transit_gateway_id = var.dest.id

  transit_gateway_id = var.src.id

  tags = {
    Name = var.attachment_name
  }
}

Steps to Reproduce

  1. Apply the above config (or use an existing resource with the options block)
  2. Run a plan (possibly it only happens in some regions, I'm not sure)

Debug Logging

GenAI / LLM Assisted Development

n/a

Important Facts and References

I am highly suspicious that this started happening because AWS started returning an empty Options object in the API responses (at least in some regions), whereas previously the Options were either null, or missing in that case.

The provider should probably treat an empty options as equivalent to no options.

This was also mentioned in #41360, but this seems like it is a different (although possibly related) issue.

Workaround

It is possible to workaround this by adding an ignore_changes for the options.

terraform
lifecycle {
    ignore_changes = [options]
  }

Would you like to implement a fix?

No response

Source: hashicorp/terraform-provider-aws