When it is not necessary to have SSH access to the EC2 instance (e.g., after the Ansible steps have been completed), it is good practice to remove access. This can be accomplished by:
- Editing the infra/vars.tf file. Change the
default
of thessh_cidrs
variable to[]
. - Running
terraform apply
from within the infra/ directory.