delete_policy_version

delete_policy_version(**kwargs)

Deletes the specified version from the specified managed policy.

You cannot delete the default version from a policy using this operation. To delete the default version from a policy, use DeletePolicy. To find out which version of a policy is marked as the default version, use ListPolicyVersions.

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

See also: AWS API Documentation

Request Syntax

response = client.delete_policy_version(
    PolicyArn='string',
    VersionId='string'
)
Parameters
  • PolicyArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the IAM policy from which you want to delete a version.

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

  • VersionId (string) --

    [REQUIRED]

    The policy version to delete.

    This parameter allows (through its regex pattern ) a string of characters that consists of the lowercase letter 'v' followed by one or two digits, and optionally followed by a period '.' and a string of letters and digits.

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

Returns

None

Exceptions

  • IAM.Client.exceptions.NoSuchEntityException
  • IAM.Client.exceptions.LimitExceededException
  • IAM.Client.exceptions.InvalidInputException
  • IAM.Client.exceptions.DeleteConflictException
  • IAM.Client.exceptions.ServiceFailureException