hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.74k stars 9.1k forks source link

[Bug]: `aws_ec2_tag` will sometime be marked as failed even though the tag is created #36444

Open dmaclaury opened 6 months ago

dmaclaury commented 6 months ago

Terraform Core Version

1.7.5

AWS Provider Version

5.41.0

Affected Resource(s)

Expected Behavior

The tag is successfully created, and terraform marks it as a success

Actual Behavior

Intermittently, the tag is successfully created, but Terraform marks it as failed. On the next plan/apply the tag is deleted and re-created.

Relevant Error/Panic Output Snippet

Error: reading ec2 resource (vpc-<resource id>) tag (tag-key): empty result with aws_ec2_tag.this[5]

Terraform Configuration Files

resource "aws_ec2_tag" "this" { count = length(local.cross_account_tagging)

provider = aws.other-account resource_id = local.cross_account_tagging[count.index].resource_id key = local.cross_account_tagging[count.index].tag_key value = local.cross_account_tagging[count.index].tag_value }

Steps to Reproduce

  1. Create shared VPC/subnets in account A
  2. In account B create aws_ec2_tag resources to the shared resources

Debug Output

No response

Panic Output

No response

Important Factoids

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 6 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue