SecretsManagerClient.get_resource_policy
rboto-secrets-manager==0.4.0 · Service index · Types
Model summary (excerpt): Retrieves the JSON text of the resource-based policy document attached to the secret. For more information about permissions policies attached to a secret, see Permissions policies attached to a secret . Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters because it might be logged. For more information, see...
Install and imports
from rboto import SecretsManagerClient
from rboto_secrets_manager.types import (
GetResourcePolicyOutput,
)
Signature
async def get_resource_policy(
*,
secret_id: str,
policy_name: str | None = None,
) -> GetResourcePolicyOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
secret_id |
Yes | The ARN or name of the secret to retrieve the attached resource-based policy for. For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See Finding a secret from a partial ARN . |
policy_name |
No | The name of the resource policy to retrieve. If you don't specify this field, Secrets Manager uses default . If you specify a name other than default and no policy with that name exists, the operation returns a ResourceNotFoundException . |
Output
GetResourcePolicyOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
arn |
str | None |
Always present | — |
name |
str | None |
Always present | — |
resource_policy |
str | None |
Always present | — |
policy_name |
str | None |
Always present | — |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
No output stream.
Errors
Import from rboto_secrets_manager.exceptions:
InternalServiceError, InvalidParameterError, InvalidRequestError, ResourceNotFoundError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.