I have a usecase where the cloud formation has to identify AMI-ID based on tags (passed as inputs to cloud formation template) and likewise create an ec2 instance.
Can I run a script to identify (aws ec2 describe-images --filters "Name=tag:Name,Values=value1" --query 'Images[*].{ID:ImageId}' --output text) AMI-ID via cloud formation and pass it for ec2 instance creation..
Any thoughts or example on how to do this ?