get_policy¶
Operation¶
get_policy
async
¶
get_policy(input: GetPolicyInput, plugins: list[Plugin] | None = None) -> GetPolicyOutput
Retrieves detailed information about a specific policy within the AgentCore Policy system. This operation returns the complete policy definition, metadata, and current status, allowing administrators to review and manage policy configurations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
GetPolicyInput
|
An instance of |
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 |
|---|---|
GetPolicyOutput
|
An instance of |
Input¶
GetPolicyInput
dataclass
¶
Dataclass for GetPolicyInput 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 retrieved.
policy_id
class-attribute
instance-attribute
¶
policy_id: str | None = None
The unique identifier of the policy to be retrieved. This must be a valid policy ID that exists within the specified policy engine.
Output¶
GetPolicyOutput
dataclass
¶
Dataclass for GetPolicyOutput structure.
Attributes¶
created_at
instance-attribute
¶
created_at: datetime
The timestamp when the policy was originally created.
definition
instance-attribute
¶
definition: PolicyDefinition
The Cedar policy statement that defines the access control rules. This contains the actual policy logic used for agent behavior control and access decisions.
description
class-attribute
instance-attribute
¶
description: str | None = field(repr=False, default=None)
The human-readable description of the policy's purpose and functionality. This helps administrators understand and manage the policy.
enforcement_mode
class-attribute
instance-attribute
¶
enforcement_mode: EnforcementMode = EnforcementMode('ACTIVE')
The current enforcement mode of the policy.
name
instance-attribute
¶
name: str
The customer-assigned name of the policy. This is the human-readable identifier that was specified when the policy was created.
policy_arn
instance-attribute
¶
policy_arn: str
The Amazon Resource Name (ARN) of the policy. This globally unique identifier can be used for cross-service references and IAM policy statements.
policy_engine_id
instance-attribute
¶
policy_engine_id: str
The identifier of the policy engine that manages this policy. This confirms the policy engine context for the retrieved policy.
policy_id
instance-attribute
¶
policy_id: str
The unique identifier of the retrieved policy. This matches the policy ID provided in the request and serves as the system identifier for the policy.
status_reasons
instance-attribute
¶
status_reasons: list[str]
Additional information about the policy status. This provides details about any failures or the current state of the policy.
updated_at
instance-attribute
¶
updated_at: datetime
The timestamp when the policy was last modified. This tracks the most recent changes to the policy configuration.