https://pulumi.com logo
#kubernetes
Title
# kubernetes
s

square-coat-62279

11/07/2021, 10:13 AM
hi all, I am referring to k8s.core.v1.secret, regarding data field, can the key and value be variables? Another thing is the input secert.value, this should be a const from another resource instead of a string, I supposed I need to remove the double quotes before parsing to the secret class? here's my code:
Copy code
if(helmConfigs.secret){
     let k8sSecret = new k8s.core.v1.Secret(${helmConfigs.secret.name}, {
        metadata: {
          name: helmConfigs.secret.name,
          namespace: helmConfigs.namespace
        },
      data: {
        helmConfigs.secret.key: helmConfigs.secret.value
      }
      });
    }
input:
Copy code
helm: {
"cert-manager": {
      namespace: "cert-manager",
      version: "v1.5.3",
      repo: "<https://charts.jetstack.io>",
      chart: "cert-manager",
      values: require(`./google/helm_values/cert_manager`),
     secret: {}
    },
    "external-dns-public": {
      namespace: "external-dns",
      version: "3.1.1",
      repo: "<https://charts.bitnami.com/bitnami>",
      chart: "external-dns",
      values: require(`./google/helm_values/external_dns_public`),
     secret: {
         name: "external-dns-public"
         key: "credentials.json"
         value: "dnskey.privateKey"
     }
    }    
  }
b

billowy-army-68599

11/07/2021, 3:20 PM
can you wrap you code in three backticks please? ```
s

square-coat-62279

11/08/2021, 12:53 AM
done
4 Views