Amazon Ec2 plugin issues

Hello, I am using Amazon ec2 plugin to launch jenkins agent and i have been getting this error:

WARNING: Empty host, your host is most likely waiting for an ip address.
Jun 14, 2024 11:48:30 AM hudson.plugins.ec2.EC2Cloud
INFO: Failed to connect via ssh: goto sleep

I have opened port 22 to controller’s ip address at the security group level. Any help will be greatly appreciated. Thanks