get_user_policy¶
Operation¶
get_user_policy
async
¶
get_user_policy(input: GetUserPolicyInput, plugins: list[Plugin] | None = None) -> GetUserPolicyOutput
Retrieves the specified inline policy document that is embedded in the specified IAM user.
Note
Policies returned by this operation are URL-encoded compliant with RFC
3986. You can use a URL decoding
method to convert the policy back to plain JSON text. For example, if
you use Java, you can use the decode method of the
java.net.URLDecoder utility class in the Java SDK. Other languages and
SDKs provide similar functionality, and some SDKs do this decoding
automatically.
An IAM user can also have managed policies attached to it. To retrieve a managed policy document that is attached to a user, use GetPolicy to determine the policy's default version. Then use GetPolicyVersion to retrieve the policy document.
For more information about policies, see Managed policies and inline policies in the IAM User Guide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
GetUserPolicyInput
|
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 |
|---|---|
GetUserPolicyOutput
|
An instance of |
Input¶
GetUserPolicyInput
dataclass
¶
Bases: _SerdeShape
Dataclass for GetUserPolicyInput structure.
Attributes¶
policy_name
class-attribute
instance-attribute
¶
policy_name: str | None = ...
The name of the policy document to get.
This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
user_name
class-attribute
instance-attribute
¶
user_name: str | None = ...
The name of the user who the policy is associated with.
This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
Output¶
GetUserPolicyOutput
dataclass
¶
Bases: _SerdeShape
Contains the response to a successful GetUserPolicy request.
Attributes¶
policy_document
instance-attribute
¶
policy_document: str
The policy document.
IAM stores policies in JSON format. However, resources that were created using CloudFormation templates can be formatted in YAML. CloudFormation always converts a YAML policy to JSON format before submitting it to IAM.
response_metadata
class-attribute
instance-attribute
¶
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.