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.85k stars 9.2k forks source link

[Bug]: Removing existing invocation_http_parameters block in aws_cloudwatch_event_connection creates permanent diff #37814

Open asheynkmantyler opened 5 months ago

asheynkmantyler commented 5 months ago

Terraform Core Version

1.8.4

AWS Provider Version

5.52.0

Affected Resource(s)

aws_cloudwatch_event_connection

Expected Behavior

Here is a sequence of events:

  1. Create aws_cloudwatch_event_connection with invocation_http_parameters present and run terraform apply
  2. Remove invocation_http_parameters and run terraform apply.
  3. run terraform apply again. At this stage, I expect no differences

Actual Behavior

After step 2 any terraform apply will report that it attempts to remove invocation_http_parameters block from config, producing permanent diff

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_cloudwatch_event_connection" “conn” {
  name               = "test"
  authorization_type = "OAUTH_CLIENT_CREDENTIALS"
  auth_parameters {
    invocation_http_parameters {
      header {
        key = "foo"
        value = "bar"
      }
    }
    oauth {
      authorization_endpoint = "https://example.com"
      http_method            = "POST"

      client_parameters {
        client_id     = "id"
        client_secret = "secret"
      }
      oauth_http_parameters {
        body {
          key             = "grant_type"
          value           = "client_credentials"
          is_value_secret = false
        }
      }
    }
  }
}

Steps to Reproduce

  1. Run code above to create connection with invocation_http_parameters block
  2. Remove invocation_http_parameters block and run terraform apply again
  3. Run terraform apply for the third time, and see terraform reporting that it has to remove invocation_http_parameters block

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 5 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue