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_detective_member`with organization accounts - unexpected state 'ENABLED', wanted target 'INVITED' #35317

Open javierbeaumont opened 8 months ago

javierbeaumont commented 8 months ago

Terraform Core Version

1.6.6

AWS Provider Version

5.32.1

Affected Resource(s)

Expected Behavior

Resource creation is expected without output errors in Terraform.

Actual Behavior

The resource is created correctly, but there is an output error in Terraform:

Error: waiting for Detective Member () invited: unexpected state 'ENABLED', wanted target 'INVITED'. last error: %!s(<nil>)

Relevant Error/Panic Output Snippet

│ Error: waiting for Detective Member () invited: unexpected state 'ENABLED', wanted target 'INVITED'. last error: %!s(<nil>)
│ 
│   with aws_detective_member.this,
│   on main.tf line 1, in resource "aws_detective_member" "this":
│    1: resource "aws_detective_member" "this" {

Terraform Configuration Files

resource "aws_detective_organization_admin_account" "this" {
  account_id = "012345678901"
}

resource "aws_detective_member" "this" {
  account_id                 = "123456789012"
  disable_email_notification = true
  email_address              = "email@example.org"
  graph_arn                  = "arn:aws:detective:us-east-1:012345678901:graph:231684d34gh74g4bae1dbc7bd807d02d/123456789012"

  depends_on = [aws_detective_organization_admin_account.this]
}

Steps to Reproduce

terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

The bug was originally requested and corrected here: Enhance aws_detective_member to be compatible with organization accounts

Would you like to implement a fix?

None

github-actions[bot] commented 8 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 8 months ago

Hey @javierbeaumont 👋 Thank you for taking the time to raise this! Are you able to supply debug logs (redacted as needed), in case whoever looks into this needs that information?

para0056 commented 1 month ago

Also running into this. What sort of debug logs would you need?