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.ListKeyPolicies

Description

Gets the names of the key policies that are attached to a KMS key. This operation is designed to get policy names that you can use in a GetKeyPolicy operation. However, the only valid policy name is default.

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

Required permissions: kms:ListKeyPolicies (key policy)

Related operations:

  • GetKeyPolicy
  • PutKeyPolicy

This operation returns paginated results.

Synopsis

Creating a Request

data ListKeyPolicies Source #

See: newListKeyPolicies smart constructor.

Constructors

ListKeyPolicies' 

Fields

  • marker :: Maybe Text

    Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextMarker from the truncated response you just received.

  • limit :: Maybe Natural

    Use this parameter to specify the maximum number of items to return. When this value is present, KMS does not return more than the specified number of items, but it might return fewer.

    This value is optional. If you include a value, it must be between 1 and 1000, inclusive. If you do not include a value, it defaults to 100.

    Only one policy can be attached to a key.

  • keyId :: Text

    Gets the names of key policies 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.

Instances

Instances details
Eq ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

Read ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

Show ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

Generic ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

Associated Types

type Rep ListKeyPolicies :: Type -> Type #

NFData ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

Methods

rnf :: ListKeyPolicies -> () #

Hashable ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

ToJSON ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

AWSPager ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

AWSRequest ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

Associated Types

type AWSResponse ListKeyPolicies #

ToHeaders ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

ToPath ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

ToQuery ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

type Rep ListKeyPolicies Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

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

Defined in Amazonka.KMS.ListKeyPolicies

newListKeyPolicies Source #

Create a value of ListKeyPolicies 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:marker:ListKeyPolicies', listKeyPolicies_marker - Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextMarker from the truncated response you just received.

$sel:limit:ListKeyPolicies', listKeyPolicies_limit - Use this parameter to specify the maximum number of items to return. When this value is present, KMS does not return more than the specified number of items, but it might return fewer.

This value is optional. If you include a value, it must be between 1 and 1000, inclusive. If you do not include a value, it defaults to 100.

Only one policy can be attached to a key.

$sel:keyId:ListKeyPolicies', listKeyPolicies_keyId - Gets the names of key policies 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.

Request Lenses

listKeyPolicies_marker :: Lens' ListKeyPolicies (Maybe Text) Source #

Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextMarker from the truncated response you just received.

listKeyPolicies_limit :: Lens' ListKeyPolicies (Maybe Natural) Source #

Use this parameter to specify the maximum number of items to return. When this value is present, KMS does not return more than the specified number of items, but it might return fewer.

This value is optional. If you include a value, it must be between 1 and 1000, inclusive. If you do not include a value, it defaults to 100.

Only one policy can be attached to a key.

listKeyPolicies_keyId :: Lens' ListKeyPolicies Text Source #

Gets the names of key policies 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.

Destructuring the Response

data ListKeyPoliciesResponse Source #

See: newListKeyPoliciesResponse smart constructor.

Constructors

ListKeyPoliciesResponse' 

Fields

  • policyNames :: Maybe [Text]

    A list of key policy names. The only valid value is default.

  • truncated :: Maybe Bool

    A flag that indicates whether there are more items in the list. When this value is true, the list in this response is truncated. To get more items, pass the value of the NextMarker element in thisresponse to the Marker parameter in a subsequent request.

  • nextMarker :: Maybe Text

    When Truncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent request.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Eq ListKeyPoliciesResponse Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

Read ListKeyPoliciesResponse Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

Show ListKeyPoliciesResponse Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

Generic ListKeyPoliciesResponse Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

Associated Types

type Rep ListKeyPoliciesResponse :: Type -> Type #

NFData ListKeyPoliciesResponse Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

Methods

rnf :: ListKeyPoliciesResponse -> () #

type Rep ListKeyPoliciesResponse Source # 
Instance details

Defined in Amazonka.KMS.ListKeyPolicies

type Rep ListKeyPoliciesResponse = D1 ('MetaData "ListKeyPoliciesResponse" "Amazonka.KMS.ListKeyPolicies" "libZSservicesZSamazonka-kmsZSamazonka-kms" 'False) (C1 ('MetaCons "ListKeyPoliciesResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "policyNames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "truncated") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "nextMarker") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newListKeyPoliciesResponse Source #

Create a value of ListKeyPoliciesResponse 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:policyNames:ListKeyPoliciesResponse', listKeyPoliciesResponse_policyNames - A list of key policy names. The only valid value is default.

$sel:truncated:ListKeyPoliciesResponse', listKeyPoliciesResponse_truncated - A flag that indicates whether there are more items in the list. When this value is true, the list in this response is truncated. To get more items, pass the value of the NextMarker element in thisresponse to the Marker parameter in a subsequent request.

$sel:nextMarker:ListKeyPoliciesResponse', listKeyPoliciesResponse_nextMarker - When Truncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent request.

$sel:httpStatus:ListKeyPoliciesResponse', listKeyPoliciesResponse_httpStatus - The response's http status code.

Response Lenses

listKeyPoliciesResponse_policyNames :: Lens' ListKeyPoliciesResponse (Maybe [Text]) Source #

A list of key policy names. The only valid value is default.

listKeyPoliciesResponse_truncated :: Lens' ListKeyPoliciesResponse (Maybe Bool) Source #

A flag that indicates whether there are more items in the list. When this value is true, the list in this response is truncated. To get more items, pass the value of the NextMarker element in thisresponse to the Marker parameter in a subsequent request.

listKeyPoliciesResponse_nextMarker :: Lens' ListKeyPoliciesResponse (Maybe Text) Source #

When Truncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent request.