powerful-lighter-63321
11/30/2023, 11:09 AMconfig = pulumi.Config()
gitlab_password = config.require_secret("gitlab::token")
But this causes the error:
Diagnostics:
pulumi:pulumi:Stack (projects-main):
error: Missing required configuration variable 'projects:gitlab::token'
`please set a value using the command `pulumi config set --secret projectsgitlab:token <value>``
error: an unhandled error occurred: program exited with non-zero exit code: 1
This might be true, because I didn't have projectsgitlab:token, but gitlab::token. How do I get this secret from the configs in my code?limited-rainbow-51650
11/30/2023, 2:57 PMgitlab:token
, the first part is the namespace. When you want to read the token
secret in your code, you create a Config
object on the correct namespace first:
gitlabConfig = pulumi.Config("gitlab")
gitlab_password = gitlabConfig.require_secret("token")
limited-rainbow-51650
11/30/2023, 2:58 PMgitlab::token
(2 colons) is not valid. It should be gitlab:token
(1 colon).limited-rainbow-51650
11/30/2023, 2:59 PMpowerful-lighter-63321
12/01/2023, 6:28 AM