hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.53k stars 9.52k forks source link

Issue with AWS Glue Job script_location Not Recognizing S3 Path in Terraform #35861

Closed Prashanteppalpalli closed 2 hours ago

Prashanteppalpalli commented 3 hours ago

Terraform Version

Terraform v1.5.7
+ provider registry.terraform.io/hashicorp/aws v5.70.0

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
}

Debug Output

Troubleshooting Steps Taken:

Verified the S3 path and file existence. Ensured the IAM role has the necessary permissions (s3:GetObject, s3:ListBucket). Compared the manually added script path with the Terraform configuration. Enabled detailed logging in Terraform (TF_LOG=DEBUG). Checked for hidden characters or typos in the S3 path.

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 successfully 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 above error.

Steps to Reproduce

terraform init terraform apply

Additional Context

NA

References

NA

crw commented 2 hours ago

Hello @Prashanteppalpalli,

This appears to be an issue or question with the AWS provider, not with Terraform itself. You can see existing issues and file a new one in their repository here: https://github.com/terraform-providers/terraform-provider-aws/issues. If you have questions about Terraform or the AWS provider, it's better to use the community forum where there are more people ready to help. The GitHub issues here are monitored only by a few core maintainers.

Thanks!