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

feature request: new built-in function base64(string) #3320

Closed
glerchundi opened this issue Sep 24, 2015 · 2 comments · Fixed by #3325
Closed

feature request: new built-in function base64(string) #3320

glerchundi opened this issue Sep 24, 2015 · 2 comments · Fixed by #3325

Comments

@glerchundi
Copy link
Contributor

I would like to include in a cloud-config (which is formatted using YAML) section my custom certification authority certificate, which contains newlines. If I use directly with ${file} cloud-config will fail parsing.

What do you think if we can make a function like base64("mystring") which interpolates to the encoded base64 format?

Use-case:

#cloud-config

[...]

write_files:
  - path: "/etc/ssl/etcd/ca-chain.cert.pem"
    permissions: "0600"
    owner: "etcd"
    encoding: "base64"
    content: |
      ${base64(file("etcd-ca-chain.cert.pem"))}

WDYT?

@apparentlymart
Copy link
Contributor

It sounds good to me!

If someone wants to look at implementing this and hasn't done this sort of thing before, my PR #3127 is an example of a change adding new interpolation functions. Since encoding/base64 is in the Go standard library the implementation should be relatively simple.

mat-mcloughlin pushed a commit to mat-mcloughlin/terraform that referenced this issue Oct 6, 2015
bmcustodio pushed a commit to bmcustodio/terraform that referenced this issue Sep 26, 2017
@ghost
Copy link

ghost commented Apr 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants