I am a newbie to go language and I am passing some properties props?
to my CDK appstack with the following signature: props?: cdk.StackProps
Now, when I just print the variable props
on the console by typing console.log(props)
I see this (as expected):
{ env: { account: '112358132134', region: 'us-west-2' } }
However, when I do something like this: console.log(props['env'])
I get the following error:
console.log(props["env"]["account"])
I get this error:
error TS2532: Object is possibly 'undefined'.
The goal for me is to use this property for my business logic. How can I read it?