How to Create and Attach IAM Policies in AWS
Step-by-Step Guide to Creating and Attaching IAM Policies in AWS
Introduction
You manage access in AWS by creating policies and attaching them to IAM identities (users, groups of users, or roles) or AWS resources. A policy is an object in AWS that, when associated with an identity or resource, defines their permissions. AWS evaluates these policies when an IAM principal (user or role) makes a request. Permissions in the policies determine whether the request is allowed or denied. Most policies are stored in AWS as JSON documents. AWS supports six types of policies: identity-based policies, resource-based policies, permissions boundaries, Organizations SCPs, ACLs, and session policies.
For more details visit.
Create IAM Policies
Open the AWS Management Console and navigate to the Identity and Access Management (IAM).
Click on Policies from the left navigation panel.
Click Create policy.
Choose S3 from the down under Service.
Click All list actions under Access level.
Select All under Resources.
Click Next.
Write a suitable policy name.
Click Create policy.
Creating and attaching policy with an IAM user
Click on Users from the left navigation panel.
Click Create user.
Write a suitable user name.
Check Provide user access to the AWS Management Console.
Select I want to create an IAM user.
Click Custom password and type a suitable password.
Uncheck Users must create a new password at next sign-in for now.
Click Next.
Select Attach policies directly.
Search and select the newly created policy.
Click Next -> Create user.
Create an S3 bucket.
Login as an IAM user with newly created credentials.
The S3 bucket can be viewed by this IAM user.