vim user-policy.json

Untitled

Untitled

Now, we will attach the created policy (user-policy) to the target IAM user’s account. To do so, typeaws iam create-policy --policy-name user-policy --policy-document [file://user-policy.json](file://user-policy.json) and press Enter.

The created user policy is displayed, showing various details such as PolicyName , PolicyId , and Arn .

Untitled

Untitled

Untitled

Untitled

Similarly, you can use various commands to obtain complete information about the AWS environment such as the list of S3 buckets, user policies, role policies, and group policies, as well as to create a new user.