https://pulumi.com logo
#general
Title
# general
p

prehistoric-london-9917

07/20/2021, 8:45 PM
Question about required config values from structured config: Suppose I have an interface:
Copy code
interface PeopleArgs {
  name: string
  age?: number
}
And a config file that looks something like:
Copy code
config:
  things:people:
  - name: Peter Parker
    age: 40
  - name: Mary Jane
  - age: 38
And in my Pulumi program I load the config:
Copy code
let config = new pulumi.Config("things");
let people = config.requireObject<PeoplegArgs[]>("people");
The first two should be fine. But I’d expect the third element to raise an error because it doesn’t satisfy the
PeopleArgs
interface (it’s missing
name
). Instead, it seems that Pulumi puts
undefined
there. Is this expected behaviour or a bug? And has anyone who’s encountered this found a workaround?
b

bored-oyster-3147

07/20/2021, 8:53 PM
I would expect that behavior from javascript/ts deserialization
👍 1