Bash script inside Cloudformation
Solution 1:
It seems that was a conflict with the Bash Vars and the !Sub CF function.
That's correct. Both bash and !Sub use ${}
for variable substitution. You can escape the bash variables with ${!}
. For example:
for notebook in "${!notebooks[@]}"
Also mentioned in the docs:
To write a dollar sign and curly braces (
${}
) literally, add an exclamation point (!
) after the open curly brace, such as${!Literal}
. AWS CloudFormation resolves this text as${Literal}
.