https://pulumi.com logo
#getting-started
Title
# getting-started
s

swift-petabyte-875

06/08/2023, 1:20 AM
I'm having some trouble with pulumi defaults on version 3.46.0 Given my Pulumi.yaml:
Copy code
name: utils-apps
description: Application deployment for utils
runtime: nodejs
config:
  github:owner: adriangroch
  adrian.default:image.registry: <http://google.com|google.com>
  adrian.default:image.tag: latest
and then my Pulumi.dev.yaml:
Copy code
config:
  echo-trigger:image.name: echo-trigger
  echo-trigger:image.tag: 1.2.3
And my function:
Copy code
export function createContainerImageForApplication(appName: string) {
  const defaultConfig = new pulumi.Config('adrian.default')
  const config = new pulumi.Config(appName)
  const registry = config.get('image.registry') ?? defaultConfig.require('image.registry')
  const name = config.require('image.name')
  const tag = config.get('image.tag') ?? defaultConfig.require('image.tag')
  return `${registry}/${name}@${tag}`
}
calling
createContainerImageForApplication("echo-trigger")
throws:
Copy code
error: Missing required configuration variable 'adrian.default:image.registry'

Diagnostics:
  pulumi:pulumi:Stack (utils-apps-dev):
    error: Missing required configuration variable 'adrian.default:image.registry'
        please set a value using the command `pulumi config set adrian.default:image.registry <value>`
Any suggestions?