Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Retrieves the specified inline policy document that is embedded in the specified IAM user.
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.
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.
Synopsis
- data GetUserPolicy = GetUserPolicy' {
- userName :: Text
- policyName :: Text
- newGetUserPolicy :: Text -> Text -> GetUserPolicy
- getUserPolicy_userName :: Lens' GetUserPolicy Text
- getUserPolicy_policyName :: Lens' GetUserPolicy Text
- data GetUserPolicyResponse = GetUserPolicyResponse' {
- httpStatus :: Int
- userName :: Text
- policyName :: Text
- policyDocument :: Text
- newGetUserPolicyResponse :: Int -> Text -> Text -> Text -> GetUserPolicyResponse
- getUserPolicyResponse_httpStatus :: Lens' GetUserPolicyResponse Int
- getUserPolicyResponse_userName :: Lens' GetUserPolicyResponse Text
- getUserPolicyResponse_policyName :: Lens' GetUserPolicyResponse Text
- getUserPolicyResponse_policyDocument :: Lens' GetUserPolicyResponse Text
Creating a Request
data GetUserPolicy Source #
See: newGetUserPolicy
smart constructor.
GetUserPolicy' | |
|
Instances
Create a value of GetUserPolicy
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:userName:GetUserPolicy'
, getUserPolicy_userName
- 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: _+=,.@-
$sel:policyName:GetUserPolicy'
, getUserPolicy_policyName
- 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: _+=,.@-
Request Lenses
getUserPolicy_userName :: Lens' GetUserPolicy Text Source #
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: _+=,.@-
getUserPolicy_policyName :: Lens' GetUserPolicy Text Source #
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: _+=,.@-
Destructuring the Response
data GetUserPolicyResponse Source #
Contains the response to a successful GetUserPolicy request.
See: newGetUserPolicyResponse
smart constructor.
GetUserPolicyResponse' | |
|
Instances
newGetUserPolicyResponse Source #
:: Int | |
-> Text | |
-> Text | |
-> Text | |
-> GetUserPolicyResponse |
Create a value of GetUserPolicyResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:httpStatus:GetUserPolicyResponse'
, getUserPolicyResponse_httpStatus
- The response's http status code.
$sel:userName:GetUserPolicy'
, getUserPolicyResponse_userName
- The user the policy is associated with.
$sel:policyName:GetUserPolicy'
, getUserPolicyResponse_policyName
- The name of the policy.
$sel:policyDocument:GetUserPolicyResponse'
, getUserPolicyResponse_policyDocument
- 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 Lenses
getUserPolicyResponse_httpStatus :: Lens' GetUserPolicyResponse Int Source #
The response's http status code.
getUserPolicyResponse_userName :: Lens' GetUserPolicyResponse Text Source #
The user the policy is associated with.
getUserPolicyResponse_policyName :: Lens' GetUserPolicyResponse Text Source #
The name of the policy.
getUserPolicyResponse_policyDocument :: Lens' GetUserPolicyResponse Text Source #
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.