Skip to content

/AWS1/CL_IAM=>SETDEFAULTPOLICYVERSION()

About SetDefaultPolicyVersion

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, see Managed policies and inline policies in the IAM User Guide.

Method Signature

IMPORTING

Required arguments:

iv_policyarn TYPE /AWS1/IAMARNTYPE /AWS1/IAMARNTYPE

The Amazon Resource Name (ARN) of the IAM policy whose default version you want to set.

For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

iv_versionid TYPE /AWS1/IAMPOLICYVERSIONIDTYPE /AWS1/IAMPOLICYVERSIONIDTYPE

The version of the policy to set as the default (operative) version.

For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide.

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

lo_client->/aws1/if_iam~setdefaultpolicyversion(
  iv_policyarn = |string|
  iv_versionid = |string|
).