We can quickly create IAM group, IAM user, and policy using CLI.
Use the following command to create a new IAM group:
aws iam create-group --group-name dev
Next, create a new IAM user:
aws iam create-user --user-name dev-1
Now, add the user to the created group:
aws iam add-user-to-group --user-name dev-1 --group-name dev
You can verify the group and user details with:
aws iam get-group --group-name dev
Generate the Access Key for the user with:
aws iam create-access-key --user-name dev-1
To delete an Access Key, use the following command:
aws iam delete-access-key --user-name dev-1 --access-key-id AKIAIOSFODNN7EXAMPLE