GoogleCloudPlatform / berglas

A tool for managing secrets on Google Cloud
https://cloud.google.com/secret-manager
Apache License 2.0
1.24k stars 96 forks source link

Not able to upload the rsa.key #115

Closed mukgarg-lb closed 4 years ago

mukgarg-lb commented 4 years ago

Hi,

When i tried to run berglas create gs://xxxx/xx <#rsakey>

it's throwing error bad flag syntax: -----BEGIN RSA PRIVATE KEY-----

Not sure i am following the right steps.

Can you please help here?

mukgarg-lb commented 4 years ago

Looked at the https://github.com/GoogleCloudPlatform/berglas/issues/97 and tried cat my-private-rsa-key.key | berglas create --key ${KMS_KEY} ${BUCKET_ID}/MY_PRIVATE_RSA_KEY - but only uploading the -----BEGIN RSA PRIVATE KEY-----

sethvargo commented 4 years ago

You have to use the "read from file" syntax for multiline files:

berglas create gs://bucket/secret --key projects/... @/path/to/key.rsa

Note the leading @ - this tells Berglas to interpret the value as a filepath.

You might also be interested in Secret Manager.

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.