https://pulumi.com logo
#pulumi-kubernetes-operator
Title
# pulumi-kubernetes-operator
h

helpful-baker-3769

08/14/2023, 5:59 AM
hello, how do I access value of a secret in
Program
CR? I have this in my `Stack`:
Copy code
---
apiVersion: <http://pulumi.com/v1|pulumi.com/v1>
kind: Stack
metadata:
  name: github
spec:
  stack: budimanjojo/github
  programRef:
    name: github
  destroyOnFinalize: true
  envRefs:
    GITHUB_OWNER:
      type: Literal
      literal:
        value: budimanjojo
    GITHUB_TOKEN:
      type: Secret
      secret:
        name: github-secret
        key: GITHUB_TOKEN
    PULUMI_ACCESS_TOKEN:
      type: Secret
      secret:
        name: github-secret
        key: PULUMI_ACCESS_TOKEN
  secretsRef:
    test_secret:
      type: Secret
      secret:
        name: github-secret
        key: test_secret
in my
Program
, I want to access the
test_secret
but I got this error:
resource "test_secret" not found
. Here's the Program:
Copy code
---
apiVersion: <http://pulumi.com/v1|pulumi.com/v1>
kind: Program
metadata:
  name: github
program:
  resources:
    exampleVariable:
      type: github:ActionsSecret
      properties:
        repository: pulumi-testing
        secretName: test_secret
        encryptedValue: ${test_secret}
b

billions-yak-67755

09/01/2023, 2:11 PM
A bit delayed here - hopefully you got a solution! I believe you need the
config:
section (same level as
resources:
in your
Program
. Docs here: https://www.pulumi.com/docs/languages-sdks/yaml/yaml-language-reference/#config
4 Views