Packer opens port 22 while creating AMI


I want to understand why packer open port 22 while creating the AMI image.
Is there a way by which we should not open port 22 and create the AMI.


I assume you are using the aws-ebs plugin. The plugin uses ssh to access the AMI image

Additional information Amazon EBS - Builders | Packer by HashiCorp