Understanding IRSA
Firstly, let’s look at how IAM role assignment works for standard EC2 instances. In AWS IAM, roles are used to allocate permissions (using one or more policies). A role can be assigned to an EC2 instance using an instance profile, which is simply a container for the IAM role that’s attached to a specific EC2 instance.
Figure 13.1 – EC2 role assignment
When an EC2 instance is created and assigned a role, the AWS platform will automatically create an instance profile. When that instance boots up, it will make a network call to the instance metadata service (IMDS), which runs in the VPC at the well-known address, 169.254.169.254
, and query what (if any) instance profile (or role) is assigned to that instance. If one has been assigned, it can retrieve the access credentials, an example of which is shown next. These credentials consist of the access and secret keys, which are used for all AWS API calls and identify the...