I’m having trouble using the Fn::ImportValue function. I’ve used it elsewhere in environment variables and IAM permissions without a problem, but I am trying to pass it to the JSON input for an AWS scheduled cloudwatch event, and no matter what I try… it either fails to deploy, or when it does deploy, I get the actual text Fn::ImportValue in my JSON.
I tried using custom first, declaring a variable and using Fn::ImportValue. But this kept telling me I was trying to assign a value other than a string to a string.
I’ve tried various ways of typing Fn::ImportValue inside an interpolated string, but that is where Fn::ImportValue gets printed in the output instead of the actual value.
My current attempt looks as follows:
jsonArrayName:
- “${ ‘Fn::ImportValue’ : cloudformationoutputname }”
Does anyone know the correct way to do this? I’ve been going in circles with this for a few hours.
Thanks,
Dan