Skip to content

IAM  >  Operations  >  delete_policy_version

delete_policy_version

Operation

delete_policy_version async

delete_policy_version(request: DeletePolicyVersionInput | DeletePolicyVersionInputDict, /, *, plugins: list[Plugin] | None = None) -> DeletePolicyVersionOutput
delete_policy_version(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[DeletePolicyVersionInputDict]) -> DeletePolicyVersionOutput

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.

Parameters:

Name Type Description Default
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
DeletePolicyVersionOutput

An instance of DeletePolicyVersionOutput.

Input

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

DeletePolicyVersionInput dataclass

Bases: _SerdeShape

Dataclass for DeletePolicyVersionInput structure.

Attributes
policy_arn class-attribute instance-attribute
policy_arn: str | None = ...

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.

version_id class-attribute instance-attribute
version_id: str | None = ...

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.

Dictionaries

DeletePolicyVersionInputDict

Bases: TypedDict

Dictionary form of DeletePolicyVersionInput.

Attributes
policy_arn instance-attribute
policy_arn: Required[str]

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.

version_id instance-attribute
version_id: Required[str]

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.

Output

DeletePolicyVersionOutput dataclass

Bases: _SerdeShape

Dataclass for DeletePolicyVersionOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.