Home > OS >  New Line character in Pulumi as a secret/value
New Line character in Pulumi as a secret/value

Time:01-27

I would like to store a key as a secret in Pulumi in the configuration.

The key has the following structure

-----BEGIN PRIVATE KEY----- xxxxx xxxxx xxxxx -----END PRIVATE KEY-----

But, when adding it into the configuration, I face 2 problems:

  • A config setting starting by ----- gives error.
  • Pulumi is converting \n to \\ so it gives error while trying to pull the key as a secret.

I've tried all the formats, to store it as a --plaintext and other solutions proposed here but didn't work.

I would appreciate if someone can bring some light here. Thank you in advance.

CodePudding user response:

You need to pipe the key from stdin like so:

cat ~/.ssh/id_rsa | pulumi config set secretKey --secret
  •  Tags:  
  • Related