Allowing unrestricted, public access to cloud services could open an application up to external attack. Disallowing this access is typically considered best practice.
In AWS Console -
In Terraform -
References:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html#using-instance-addressing-eips-associating-different
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance#associate_public_ip_address