Scenario-5: Create a policy and attach it to a role
- Create an iam policy which allows
- full access to s3 buckets
- readonly access to ec2 instances in us-west-2 region
- Create a role and attach the above created policy to the roles
- Lets use conditional operators in the conditions block Refer Here
- Refer Here for the policy created
- Now lets create a role called qttesterrole with the above policy attached

- Now create an aws ec2 instance with amazon linux as operating system.
- Attach the IAM role to ec2 instance

- Now lets view the e2 instances

Scenario 6: Create a policy and attach it to the programmatic user (CLI/API)
- Create an iam policy to have full access on
- s3 buckets in us-west-2 region
- rds db instances in any region with engine as mysql
- Create a iam user with programattic access and attach the above created policy and make note of AWS access key and secret key
- Then verify the policy

- Now configure the user in aws cli
aws configure
- Refer Here for the solution
