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.8k stars 9.15k forks source link

[Bug]: Issue with AWS Glue Job script_location Not Recognizing S3 Path in Terraform #39737

Open Prashanteppalpalli opened 4 days ago

Prashanteppalpalli commented 4 days ago

Terraform Core Version

Terraform v1.5.7

AWS Provider Version

provider registry.terraform.io/hashicorp/aws v5.70.0

Affected Resource(s)

aws_glue_job resource

Expected Behavior

The AWS Glue job should recognize the script_location specified in the Terraform configuration and successfully create the job without errors.

Actual Behavior

The Terraform apply process was successfull but when I go to the AWS console --> Glue console --> ETL jobs --> My job --> Script section, it shows error and says [s3..amazonaws.com] getObject: NoSuchKey: The specified key does not exist.

Manual intervention from AWS console works fine and creates that script file in s3 location but via terraform it give below error.

image

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_glue_job" "example" {
  name     = "example-job"
  role_arn = aws_iam_role.example.arn
  command {
    name            = "glueetl"
    script_location = "s3://your-bucket-name/path/to/your-script.py"
    python_version  = "3"
  }
  # other configurations
}

Steps to Reproduce

terraform init terraform apply

Debug Output

NA

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 4 days ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 2 days ago

Hey @Prashanteppalpalli 👋 Thank you for taking the time to raise this! Something you mentioned stuck out to me:

Manual intervention from AWS console works fine and creates that script file in s3 location

Are you saying that the file specified in script_location does not yet exist, and that you're relying on the AWS Console to create it for you?