Skip to content

Bedrock Agentcore Control  >  Operations  >  delete_policy

delete_policy

Operation

delete_policy async

delete_policy(input: DeletePolicyInput, plugins: list[Plugin] | None = None) -> DeletePolicyOutput

Deletes an existing policy from the AgentCore Policy system. Once deleted, the policy can no longer be used for agent behavior control and all references to it become invalid. This is an asynchronous operation. Use the GetPolicy operation to poll the status field to track completion.

Parameters:

Name Type Description Default
input DeletePolicyInput

An instance of DeletePolicyInput.

required
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
DeletePolicyOutput

An instance of DeletePolicyOutput.

Input

DeletePolicyInput dataclass

Dataclass for DeletePolicyInput structure.

Attributes

policy_engine_id class-attribute instance-attribute
policy_engine_id: str | None = None

The identifier of the policy engine that manages the policy to be deleted. This ensures the policy is deleted from the correct policy engine context.

policy_id class-attribute instance-attribute
policy_id: str | None = None

The unique identifier of the policy to be deleted. This must be a valid policy ID that exists within the specified policy engine.

Output

DeletePolicyOutput dataclass

Dataclass for DeletePolicyOutput structure.

Attributes

created_at instance-attribute
created_at: datetime

The timestamp when the deleted policy was originally created.

definition instance-attribute
definition: PolicyDefinition

Represents the definition structure for policies within the AgentCore Policy system. This structure encapsulates different policy formats and languages that can be used to define access control rules.

description class-attribute instance-attribute
description: str | None = field(repr=False, default=None)

The human-readable description of the deleted policy.

enforcement_mode class-attribute instance-attribute
enforcement_mode: EnforcementMode = EnforcementMode('ACTIVE')

The enforcement mode of the deleted policy.

name instance-attribute
name: str

The customer-assigned name of the deleted policy. This confirms which policy was successfully removed from the system and matches the name that was originally assigned during policy creation.

policy_arn instance-attribute
policy_arn: str

The Amazon Resource Name (ARN) of the deleted policy. This globally unique identifier confirms which policy resource was successfully removed.

policy_engine_id instance-attribute
policy_engine_id: str

The identifier of the policy engine from which the policy was deleted. This confirms the policy engine context for the deletion operation.

policy_id instance-attribute
policy_id: str

The unique identifier of the policy being deleted. This confirms which policy the deletion operation targets.

status instance-attribute
status: PolicyStatus

The status of the policy deletion operation. This provides information about any issues that occurred during the deletion process.

status_reasons instance-attribute
status_reasons: list[str]

Additional information about the deletion status. This provides details about the deletion process or any issues that may have occurred.

updated_at instance-attribute
updated_at: datetime

The timestamp when the deleted policy was last modified before deletion. This tracks the final state of the policy before it was removed from the system.