sparse-intern-71089
02/24/2021, 11:13 PMred-match-15116
02/25/2021, 1:08 AMI had an issue above when I tried this for a reference using “old_api_name”.Can you say more about what exactly the issue was? Unless
Error
is a python Exception
defined in your code, I’m not sure if that would work since require_output
returns a KeyError
. You could try:
try:
output_value: str = stack.require_output("new_api_name")
except KeyError:
output_value: str = stack.require_output("old_api_name")
Alternatively, you could use get_output
instead of require_output
so it doesn’t error and fetch the “old_api_name” if None
is returned:
output_value = stack.get_output("new_api_name")
if output_value is None:
output_value = stack.get_output("old_api_name")
quaint-electrician-41503
02/26/2021, 3:12 AM