Temporary credentials

Let's create a scenario where we have an application running on an EC2 instance and want to access a few objects stored in an S3 bucket in a secure way. For this, we define the IAM role and associate it with an EC2 instance. Whenever an application running on an EC2 instance needs to access the S3 object, it calls for metadata and gets the temporary credential to access the S3 bucket. This enables you to not pass the credential or access keys to an application to access the S3 bucket and is also more secure, as passing permanent access or long duration access can be a security risk.

Get Cloud Security Automation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.