Creating an ec2 instance with custom secusity group and public ip

Hi,

I was trying to create an ec2 instance with custom secusity group and public ip.
But when the instance create, only default security group attached but not custom security groups. And also there is no public IP at all.

Highly appreciate if can someone help me to fix this issue.

My config files:
https://paste.fedoraproject.org/310063/26591671/
https://paste.fedoraproject.org/310064/65919214/

Thanks

You’re not passing a list of security group names to the ec2 module you’re passing a list of dicts.

For a public ip you need the ‘assign_public_ip’ parameter set to ‘yes’ in the ec2 module.