libZSservicesZSamazonka-kmsZSamazonka-kms
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.KMS.GetKeyPolicy

Description

Gets a key policy attached to the specified KMS key.

Cross-account use: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.

Required permissions: kms:GetKeyPolicy (key policy)

Related operations: PutKeyPolicy

Synopsis

Creating a Request

data GetKeyPolicy Source #

See: newGetKeyPolicy smart constructor.

Constructors

GetKeyPolicy' 

Fields

  • keyId :: Text

    Gets the key policy for the specified KMS key.

    Specify the key ID or key ARN of the KMS key.

    For example:

    • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
    • Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

    To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.

  • policyName :: Text

    Specifies the name of the key policy. The only valid name is default. To get the names of key policies, use ListKeyPolicies.

Instances

Instances details
Eq GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

Read GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

Show GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

Generic GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

Associated Types

type Rep GetKeyPolicy :: Type -> Type #

NFData GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

Methods

rnf :: GetKeyPolicy -> () #

Hashable GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

ToJSON GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

AWSRequest GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

Associated Types

type AWSResponse GetKeyPolicy #

ToHeaders GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

ToPath GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

ToQuery GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

type Rep GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

type Rep GetKeyPolicy = D1 ('MetaData "GetKeyPolicy" "Amazonka.KMS.GetKeyPolicy" "libZSservicesZSamazonka-kmsZSamazonka-kms" 'False) (C1 ('MetaCons "GetKeyPolicy'" 'PrefixI 'True) (S1 ('MetaSel ('Just "keyId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "policyName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))
type AWSResponse GetKeyPolicy Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

newGetKeyPolicy Source #

Create a value of GetKeyPolicy 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:keyId:GetKeyPolicy', getKeyPolicy_keyId - Gets the key policy for the specified KMS key.

Specify the key ID or key ARN of the KMS key.

For example:

  • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  • Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.

$sel:policyName:GetKeyPolicy', getKeyPolicy_policyName - Specifies the name of the key policy. The only valid name is default. To get the names of key policies, use ListKeyPolicies.

Request Lenses

getKeyPolicy_keyId :: Lens' GetKeyPolicy Text Source #

Gets the key policy for the specified KMS key.

Specify the key ID or key ARN of the KMS key.

For example:

  • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  • Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.

getKeyPolicy_policyName :: Lens' GetKeyPolicy Text Source #

Specifies the name of the key policy. The only valid name is default. To get the names of key policies, use ListKeyPolicies.

Destructuring the Response

data GetKeyPolicyResponse Source #

See: newGetKeyPolicyResponse smart constructor.

Constructors

GetKeyPolicyResponse' 

Fields

Instances

Instances details
Eq GetKeyPolicyResponse Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

Read GetKeyPolicyResponse Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

Show GetKeyPolicyResponse Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

Generic GetKeyPolicyResponse Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

Associated Types

type Rep GetKeyPolicyResponse :: Type -> Type #

NFData GetKeyPolicyResponse Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

Methods

rnf :: GetKeyPolicyResponse -> () #

type Rep GetKeyPolicyResponse Source # 
Instance details

Defined in Amazonka.KMS.GetKeyPolicy

type Rep GetKeyPolicyResponse = D1 ('MetaData "GetKeyPolicyResponse" "Amazonka.KMS.GetKeyPolicy" "libZSservicesZSamazonka-kmsZSamazonka-kms" 'False) (C1 ('MetaCons "GetKeyPolicyResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "policy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newGetKeyPolicyResponse Source #

Create a value of GetKeyPolicyResponse 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:policy:GetKeyPolicyResponse', getKeyPolicyResponse_policy - A key policy document in JSON format.

$sel:httpStatus:GetKeyPolicyResponse', getKeyPolicyResponse_httpStatus - The response's http status code.

Response Lenses

getKeyPolicyResponse_policy :: Lens' GetKeyPolicyResponse (Maybe Text) Source #

A key policy document in JSON format.