oh I did something similar. Launched template with json worked fine and aws cli returned image ID right. However, when I created auto scaling group, it returned an error saying that the image ID is not an integer. I think there is something wrong in the conversion and resulting in python error. Anybody knows how to fix it?