Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a field to random that uses URLEncoding instead of RawURLEncoding #156

Open
combsbj opened this issue Apr 2, 2021 · 0 comments
Open

Comments

@combsbj
Copy link

combsbj commented Apr 2, 2021

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

Affected Resource(s)

Please list the resources as a list, for example:

google_compute_backend_bucket_signed_url_key

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource “random_id” “www_url_signature” {
  byte_length = 16
}
resource “google_compute_backend_bucket_signed_url_key” “www_backend_key” {
  name           = “cdn-sign-key”
  key_value      = random_id.www_url_signature.b64_url
  backend_bucket = google_compute_backend_bucket.www_backend.name
}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

What should have happened?
Random is using this to generate the base64 URL encoding: https://golang.org/pkg/encoding/base64/#RawURLEncoding

I believe Google is expecting the URL encoding to be generated with https://golang.org/pkg/encoding/base64/#URLEncoding

Actual Behavior

What actually happened?

app produces error about key length

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:

  • GH-1234
paddy  1 day ago
I think there are three ways this could be resolved

paddy  1 day ago
1) adding a field to random that uses URLEncoding instead of RawURLEncoding

paddy  1 day ago
2) having Google know to detect RawURLEncoded values and parse and reencode them as URLEncoded values

paddy  1 day ago
3) Have terraform functions that will parse RawURLEncoded values and encode them as URLEncoded values

paddy  1 day ago
I think 1 is probably the most likely resolution here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants