set-default-policy-version¶
Sets the specified version of the specified policy as the policy’s default (operative) version.
This operation affects all users, groups, and roles that the policy is attached to.
To list the users, groups, and roles that the policy is attached to, use ListEntitiesForPolicy.
For information about managed policies, refer to Managed policies and inline policies in the IAM User Guide.
Refer to AWS API Documentation.
Refer to aws help for descriptions of global parameters.
Synopsis¶
set-default-policy-version
--policy-arn <value>
--version-id <value>
Options¶
--policy-arn (string)
The Amazon Resource Name (ARN) of the IAM policy whose default version you want to set.
For more information about ARNs, refer to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.
--version-id (string)
The version of the policy to set as the default (operative) version.
For more information about managed policy versions, refer to Versioning for managed policies in the IAM User Guide.
Refer to aws help for descriptions of global parameters.
Examples¶
To set the specified version of the specified policy as the policy’s default version.
This example sets the v2 version of the policy whose ARN is arn:aws:iam::123456789012:policy/MyPolicy
as the default active version:
aws iam set-default-policy-version --policy-arn \
arn:aws:iam::123456789012:policy/MyPolicy \
--endpoint-url https://iam.<base-domain-name> \
--version-id v2
For more information, refer to Overview of IAM Policies in the Using IAM guide.
Output¶
None

