An essential part of using AWS is controlling access to the resources. We've seen with all the previous recipes how often we need to use the AWS Access Keys, and it's surely not a good idea to use a single key for all your activities. Imagine what would happen if a single one of your services was hacked—the intruder would get the main AWS key and would be able to do everything on your behalf.
A good secure setup would be dedicated keys with a dedicated scope of access rights for every person in your team and every service in your infrastructure.
Thankfully, Identity and Access Management (IAM) is there just for that. We'll see how to use it with Terraform.
To step through this recipe, you will need the following:
A working Terraform installation
An AWS provider configured in Terraform (refer to the previous recipes)
An Internet connection