I am trying to properly understand what is meant by IAM role. The more I read, I am getting more confused. I have also seen this link: https://stackoverflow.com/questions/51201214/use-of-security-groups-vs-role/51203267#:~:text=Security%20groups%20are%20more%20about,firewall%20that%20controls%20the%20traffic.&text=IAM%20Roles%20are%20more%20used,actions%20and%20resources%20in%20AWS.
From what I understood:
- Is IAM role only applicable to the resource which initiates the communication? The target of the communication can restrict using NACL, Security Groups, Subnets etc. But that is not the case I think - S3 bucket also you can attach IAM policy. So I am confused when to consider IAM role and when not.
- What if, some external resource (not within AWS), wants to access a service within AWS (maybe a web application)? Suppose it is a public web application (no authentication). If so, will we have to consider IAM role? I know there are several ways to deploy the web application - using AWS Amplify or S3 bucket or write your own application etc.