From the course: AWS for Developers: CLI Tips

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Using AWS CLI to manage IAM roles and policies

Using AWS CLI to manage IAM roles and policies

From the course: AWS for Developers: CLI Tips

Using AWS CLI to manage IAM roles and policies

- [Instructor] IAM roles and policies provide a powerful mechanism for granting temporary access to AWS resources and defining permissions. Using AWS CLI, we can create, manage and attach these roles and policies seamlessly. To create an IAM role using AWS CLI will use the create-role command. The command follows the following syntax: aws iam create-role with the option --role-name and the second option --assume-role-policy-document. Let's break down each element. The first one is --role-name. This option specifies the name you want to assign to the IAM role. The second option is --assume-role-policy-document. Here you provide the policy document that defines who can assume the role and what actions they can perform. Now let's put it into practice and run the command to create an IAM role. Head over to your terminal. So I have a policy document in my aws-cli directory called assume-role-policy.json. This trust policy…

Contents