Attach permission to group using AWS CLI

1. Log in to your local machine’s CLI or AWS CloudShell (we will use the local machine CLI).

2. Check group permission , use following command

Command –  # aws iam list-attached-groups-policies –group-name cloudteam

3.Now we attached EC2 full access permision , so use following command.

Command – # aws iam attach-group-policy –group-name <group-name> –policy-arn arn:aws:iam::aws:policy/AmazonEC2FullAccess

# aws iam list-attached-group-policies –group-name cloudteam

4. ( Note- when attaching a policy using AWS CLI, you must provide the full ARN (arn:aws:iam::aws:policy/PolicyName) because AWS CLI needs it to identify exactly which policy to attach. )

END

Leave a Comment

Your email address will not be published. Required fields are marked *