witty-king-53626
08/03/2023, 9:10 PMpulumi new ...
calls to configure these nested values (with defaults)? I have succeeded at assigning nested objects directly with stack config, but the project template config still eludes me.
In other words, after creating the stack, something like this should succeed in my index.ts
for pulumi preview
....
interface nested {
thing: string
}
interface other {
doodad: boolean
}
interface deep {
nested: nested
other: other
val: string
}
let deepCfg = config.requireObject<deep>('deep')
await <http://pulumi.log.info|pulumi.log.info>(`deep.val ${deepCfg.val}`)
await <http://pulumi.log.info|pulumi.log.info>(`deep.nested.thing ${deepCfg.nested.thing}`)
await <http://pulumi.log.info|pulumi.log.info>(`deep.other.doodad ${deepCfg.other.doodad}`)
Here is what I have been trying and I get various types of errors..I can't quite get it right.
# Pulumi.yaml
name: sa-base
runtime:
name: nodejs
options:
# See <https://github.com/TypeStrong/ts-node/issues/1007>
# <https://stackoverflow.com/questions/62096269/cant-run-my-node-js-typescript-project-typeerror-err-unknown-file-extension>
nodeargs: "--loader ts-node/esm --no-warnings --experimental-specifier-resolution=node"
description: A TypeScript program to deploy base resources into AWS
template:
description: SA Base resources
config:
deep:
val:
type: string
default: myval
nested:
thing:
type: string
default: donkey
other:
doodad:
type: boolean
default: true
Is there some special syntax to get past the variations on configuration keys should be of the form <namespace>:<name>
errors I keep getting?