Skip to content

list_resource_policies

Operation

list_resource_policies

list_resource_policies(request: ListResourcePoliciesInput | ListResourcePoliciesInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[ListResourcePoliciesInputDict]) -> ListResourcePoliciesOutput

Lists the resource-based policies attached to a secret. The response contains only the names of the policies, not their contents. Secrets Manager lists default first, followed by any other policies in alphabetical order. To get the contents of a policy, use GetResourcePolicy. You can modify only the default policy.

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 Logging Secrets Manager events with CloudTrail.

Required permissions: secretsmanager:ListResourcePolicies. For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager.

Parameters:

Name Type Description Default
request ListResourcePoliciesInput | ListResourcePoliciesInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
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
**kwargs Unpack[ListResourcePoliciesInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
ListResourcePoliciesOutput

An instance of ListResourcePoliciesOutput.

list_resource_policies async

list_resource_policies(request: ListResourcePoliciesInput | ListResourcePoliciesInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[ListResourcePoliciesInputDict]) -> ListResourcePoliciesOutput

Lists the resource-based policies attached to a secret. The response contains only the names of the policies, not their contents. Secrets Manager lists default first, followed by any other policies in alphabetical order. To get the contents of a policy, use GetResourcePolicy. You can modify only the default policy.

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 Logging Secrets Manager events with CloudTrail.

Required permissions: secretsmanager:ListResourcePolicies. For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager.

Parameters:

Name Type Description Default
request ListResourcePoliciesInput | ListResourcePoliciesInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
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
**kwargs Unpack[ListResourcePoliciesInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
ListResourcePoliciesOutput

An instance of ListResourcePoliciesOutput.

Input

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

ListResourcePoliciesInputDict

Bases: TypedDict

Dictionary form of ListResourcePoliciesInput.

Attributes

max_results instance-attribute
max_results: int | None

The number of results to include in the response. If you don't specify this value, the service returns up to 100 results.

If there are more results available, in the response, Secrets Manager includes NextToken. To get the next results, call ListResourcePolicies again with the value from NextToken.

next_token instance-attribute
next_token: str | None

A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call ListResourcePolicies again with this value.

secret_id instance-attribute
secret_id: Required[str]

The ARN or name of the secret.

For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See Finding a secret from a partial ARN.

ListResourcePoliciesInput dataclass

Bases: _SerdeShape

Dataclass for ListResourcePoliciesInput structure.

Attributes

max_results class-attribute instance-attribute
max_results: int | None = ...

The number of results to include in the response. If you don't specify this value, the service returns up to 100 results.

If there are more results available, in the response, Secrets Manager includes NextToken. To get the next results, call ListResourcePolicies again with the value from NextToken.

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

A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call ListResourcePolicies again with this value.

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

The ARN or name of the secret.

For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See Finding a secret from a partial ARN.

Output

ListResourcePoliciesOutput dataclass

Bases: _SerdeShape

Dataclass for ListResourcePoliciesOutput structure.

Attributes

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

Secrets Manager includes this value if there's more output available than what is included in the current response. To get the next results, call ListResourcePolicies again with this value.

resource_policies instance-attribute
resource_policies: list[ResourcePolicySummary]

A list of the resource policies attached to the secret.

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.