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.86k stars 9.21k forks source link

[Bug]: aws_glue_connection stuck in creation loop #38076

Open Spyhuntr opened 5 months ago

Spyhuntr commented 5 months ago

Terraform Core Version

1.8.5

AWS Provider Version

5.54.1

Affected Resource(s)

On my windows EC2, when trying to deploy an aws_glue_connection (either vpc or non-vpc) into the aws us-west-2 for a redshift serverless connection, terraform apply gets stuck in a creation loop until the script times out after an hour. Using the same parameters, I can manually create the connection in the aws glue console. I also tried to manually create the glue connection and then use tf import and it has the same symptom.

I am able to create other glue resources with this provider so this seems isolated to just this resource.

Expected Behavior

The glue connection should be created as normal after a few seconds.

Actual Behavior

The TF script plan works but when applying it, it gets stuck in a creation loop. The trace file doesn't show any error but just repeats this section over and over till the timeout occurs.

2024-06-22T11:29:39.998-0400 [TRACE] dag/walk: vertex "provider[\"registry.terraform.io/hashicorp/aws\"] (close)" is waiting for "aws_glue_connection.rs-test"
2024-06-22T11:29:40.005-0400 [TRACE] dag/walk: vertex "root" is waiting for "provider[\"registry.terraform.io/hashicorp/aws\"] (close)"

There is one warning that i'm noticing.

2024-06-19T09:13:18.453-0400 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for aws_glue_connection.test, but we are tolerating it because
 it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .connection_type: planned value cty.StringVal("JDBC") for a non-computed attribute

Relevant Error/Panic Output Snippet

2024-06-19T09:13:18.453-0400 [WARN]  Provider "registry.terraform.io/hashicorp/aws" produced an invalid plan for aws_glue_connection.test, but we are tolerating it because
 it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .connection_type: planned value cty.StringVal("JDBC") for a non-computed attribute
2024-06-22T11:29:39.998-0400 [TRACE] dag/walk: vertex "provider[\"registry.terraform.io/hashicorp/aws\"] (close)" is waiting for "aws_glue_connection.rs-test"
2024-06-22T11:29:40.005-0400 [TRACE] dag/walk: vertex "root" is waiting for "provider[\"registry.terraform.io/hashicorp/aws\"] (close)"

Terraform Configuration Files

provider "aws" {
  region  = "us-west-2"
}

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "5.54.1"
    }
  }
}

resource "aws_glue_connection" "test" {
  connection_properties = {
    JDBC_CONNECTION_URL = "jdbc:redshift://<redshift cluster jdbc url>"
    PASSWORD            = "test"
    USERNAME            = "test"
  }

  name = "test"

}

Steps to Reproduce

With the above code, terraform apply into the us-west-2 region. The apply will run but get's stuck in a creation loop.

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

justinretzolk commented 5 months ago

Hey @Spyhuntr 👋 Thank you for taking the time to raise this! Given the nature of this resource, I suspect that debug logging will be particularly important for whoever happens to look into this issue once it gets prioritized. Are you able to supply a more complete set of debug logs (redacted as needed)?

Spyhuntr commented 4 months ago

Morning! Apologies for my delayed response, I've attached a trace file from the terraform apply. I let it run for a minute or two before exiting.

An interesting note, I was attempting to create a glue crawler and ran into what looks like a similar issue as it too ran till timeout. I'm wondering if it is something specific to the glue service itself.

tf_log.txt

Spyhuntr commented 1 month ago

Morning! Wanted to see if there was any thoughts on this issue? Looks like it is still occurring.