The following code examples show how to use AttachGroupPolicy
.
- AWS CLI
-
To attach a managed policy to an IAM group
The following
attach-group-policy
command attaches the AWS managed policy namedReadOnlyAccess
to the IAM group namedFinance
.aws iam attach-group-policy \ --policy-arn
arn:aws:iam::aws:policy/ReadOnlyAccess
\ --group-nameFinance
This command produces no output.
For more information, see Managed policies and inline policies in the AWS IAM User Guide.
-
For API details, see AttachGroupPolicy
in AWS CLI Command Reference.
-
For a complete list of AWS SDK developer guides and code examples, see Using this service with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.