This message was deleted.
# general
s
This message was deleted.
e
This might be a typing bug in the SDK. I'm not sure if getCachePolicyOutput actually always sets the
id
value in the result, and if it doesn't then it coming back as
string | undefined
is accurate and you should handle that (maybe by just casing to
string
if you know that in your case it does always get set). If it always sets id then we should fix up the type for that. If you just want to cast it you can do
cachingOptimizedPolicy.id.apply(id => id!)
to tell TS to ignore the undefined part. Might be worth raising an issue at https://github.com/pulumi/pulumi-aws about this, the team that work on this will know better than me if
id
is actually optional or not.
l
Thanks @echoing-dinner-19531 for your answer! And in the meantime, I will adopt your solution with
.apply(id => id!)
that seems a good workaround.