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.72k stars 9.08k forks source link

[Bug]: Updating a streaming glue job with timeout set to null doesn't get recognized #38361

Open psripathi44 opened 1 month ago

psripathi44 commented 1 month ago

Terraform Core Version

1.3.9

AWS Provider Version

5.58.0

Affected Resource(s)

Resource: aws_glue_job, Type: gluestreaming

Expected Behavior

The job's timeout value should be set to null, allowing it to run longer than 10080 minutes as per the updated configuration.

Actual Behavior

The timeout value of the job remains set to the previous value of 10 years despite the terraform apply command.

Relevant Error/Panic Output Snippet

I tried changing the value of timeout to null from AWS Glue console, and then hit terraform plan with timeout parameter removed from the aws_glue_job terraform configuration. Then the plan produces the below changes -

  ~ resource "aws_glue_job" "streaming_extraction" {
      ~ default_arguments         = {
          + "--enable-auto-scaling"                   = "false"
          - "--enable-job-insights"                   = "true" -> null
          + "--enable-metrics"                        = "false"
          - "--enable-observability-metrics"          = "false" -> null
          + "--enable-spark-ui"                       = "false"
            # (13 unchanged elements hidden)
        }
      - execution_class           = "STANDARD" -> null
        id                        = "streaming-extraction-event1"
        name                      = "streaming-extraction-event1"
        # (14 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

Terraform Configuration Files

resource "aws_glue_job" "streaming_extraction" {
  for_each = var.tables

  name     = "streaming_extraction-${each.key}"
  role_arn = data.aws_iam_role.glue_job_role.arn

  command {
    name            = "gluestreaming"
    python_version  = "3"
    script_location = "s3://${data.aws_s3_bucket_object.script.id}"
  }

  maintenance_window = "Sun:04"
  #timeout            = null    # You can try by setting this to null as well
}

Steps to Reproduce

  1. Create an aws_glue_job resource of streaming type, with a timeout value set to 10080. (5256000 as timeout may not work)
  2. Attempt to update the aws_glue_job resource by removing the timeout parameter or set its value to null and adding a maintenance window.
  3. Run terraform plan and observe that the timeout value change is not recognized.
  4. Run terraform apply and observe that the timeout value remains unchanged.

Note: If the timeout value is set to another non-zero value, then terraform plan does recognize the change.

Debug Output

No response

Panic Output

No response

Important Factoids

References

For streaming jobs that run indefinitely, leave the value blank, which is the default value for streaming jobs.

Would you like to implement a fix?

None

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue