GoogleCloudPlatform / deploymentmanager-samples

Deployment Manager samples and templates.
Apache License 2.0
939 stars 718 forks source link

Unable to read a Runtime config variable #507

Closed sailaxman closed 4 years ago

sailaxman commented 4 years ago

Hi Guys,

I am trying to see if I can read a runtimeconfig variable in deployment manager, but I am unable to read though. my python script is as below.

encrypted_secret_variable = {
    'name': 'myencryptedsecret',
    'action': 'gcp-types/runtimeconfig-v1beta1:projects.configs.variables.get',
    'properties': {
        'parent': 'projects/kix-dm-admin/configs/mysecrets',
        'variable': 'mypassword',
      }
}

I created the above variable using gcloud cli, But I need to read it inside deployment manager Was anyone able to read variable inside deployment manager?

sailaxman commented 4 years ago

Nevermind, If anyone else looking for this

encrypted_secret_variable = {
    'name': 'myencryptedsecret',
    'action': 'gcp-types/runtimeconfig-v1beta1:runtimeconfig.projects.configs.variables.get',
    'properties': {
        'name': 'projects/{PROJECT_ID}/configs/mysecrets/variables/mypassword',
      }
}

decrypted_secret = {
    'name': 'valueunencrypted',
    'action': 'gcp-types/cloudkms-v1:cloudkms.projects.locations.keyRings.cryptoKeys.decrypt',
    'properties': {
        'name': '$(ref.test-kms-my-crypto-key.name)',
        'ciphertext': '$(ref.myencryptedsecret.value)'
      }
}