Use IAM roles for EC2 instances
All Gruntwork modules that require AWS API access use roles rather than an IAM user with static API credentials for authentication. For example:
terraform-aws-serveris used to manage a single EC2 instance with an IAM role attached.terraform-aws-asgapplies IAM roles to instances in auto-scaling group.terraform-aws-eksuses IAM roles for EKS cluster workers.ecs-clustercreates IAM roles for ECS instanceslambdacreates IAM roles for Lambda functions
Use these modules whenever possible. You should always use IAM roles in your own modules any time you need to provide access to the AWS API. Using static API credentials should be avoided whenever possible.