libZSservicesZSamazonka-iamZSamazonka-iam
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.IAM.GetUserPolicy

Description

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

Creating a Request

data GetUserPolicy Source #

See: newGetUserPolicy smart constructor.

Constructors

GetUserPolicy' 

Fields

  • userName :: Text

    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: _+=,.@-

  • policyName :: Text

    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: _+=,.@-

Instances

Instances details
Eq GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

Read GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

Show GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

Generic GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

Associated Types

type Rep GetUserPolicy :: Type -> Type #

NFData GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

Methods

rnf :: GetUserPolicy -> () #

Hashable GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

AWSRequest GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

Associated Types

type AWSResponse GetUserPolicy #

ToHeaders GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

ToPath GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

ToQuery GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

type Rep GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

type Rep GetUserPolicy = D1 ('MetaData "GetUserPolicy" "Amazonka.IAM.GetUserPolicy" "libZSservicesZSamazonka-iamZSamazonka-iam" 'False) (C1 ('MetaCons "GetUserPolicy'" 'PrefixI 'True) (S1 ('MetaSel ('Just "userName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "policyName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))
type AWSResponse GetUserPolicy Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

newGetUserPolicy Source #

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.

Constructors

GetUserPolicyResponse' 

Fields

  • httpStatus :: Int

    The response's http status code.

  • userName :: Text

    The user the policy is associated with.

  • policyName :: Text

    The name of the policy.

  • policyDocument :: Text

    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.

Instances

Instances details
Eq GetUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

Read GetUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

Show GetUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

Generic GetUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

Associated Types

type Rep GetUserPolicyResponse :: Type -> Type #

NFData GetUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

Methods

rnf :: GetUserPolicyResponse -> () #

type Rep GetUserPolicyResponse Source # 
Instance details

Defined in Amazonka.IAM.GetUserPolicy

type Rep GetUserPolicyResponse = D1 ('MetaData "GetUserPolicyResponse" "Amazonka.IAM.GetUserPolicy" "libZSservicesZSamazonka-iamZSamazonka-iam" 'False) (C1 ('MetaCons "GetUserPolicyResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "userName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "policyName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "policyDocument") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))

newGetUserPolicyResponse Source #

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_userName :: Lens' GetUserPolicyResponse Text Source #

The user the policy is associated with.

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.