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

early-musician-41645

07/24/2019, 8:31 PM
Another secrets question: how can I test to see if a secret exists with a specific name? Should I use
aws.secretsmanager.getSecret({name: "foo"});
with a try-catch?
w

white-balloon-205

07/24/2019, 8:34 PM
I am actually not 100% sure whether the behaviour of
getSecret
is to throw when the lookup fails, or whether it succeeds and returns an object that indicates it couldn't be found. Either way, should be easy to test for (either try/catch or if).
e

early-musician-41645

07/24/2019, 8:34 PM
Just tested, it throws.
but the error code is
undefined
5 Views