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 |
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
- data ListKeyPolicies = ListKeyPolicies' {}
- newListKeyPolicies :: Text -> ListKeyPolicies
- listKeyPolicies_marker :: Lens' ListKeyPolicies (Maybe Text)
- listKeyPolicies_limit :: Lens' ListKeyPolicies (Maybe Natural)
- listKeyPolicies_keyId :: Lens' ListKeyPolicies Text
- data ListKeyPoliciesResponse = ListKeyPoliciesResponse' {
- policyNames :: Maybe [Text]
- truncated :: Maybe Bool
- nextMarker :: Maybe Text
- httpStatus :: Int
- newListKeyPoliciesResponse :: Int -> ListKeyPoliciesResponse
- listKeyPoliciesResponse_policyNames :: Lens' ListKeyPoliciesResponse (Maybe [Text])
- listKeyPoliciesResponse_truncated :: Lens' ListKeyPoliciesResponse (Maybe Bool)
- listKeyPoliciesResponse_nextMarker :: Lens' ListKeyPoliciesResponse (Maybe Text)
- listKeyPoliciesResponse_httpStatus :: Lens' ListKeyPoliciesResponse Int
Creating a Request
data ListKeyPolicies Source #
See: newListKeyPolicies
smart constructor.
ListKeyPolicies' | |
|
Instances
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.
ListKeyPoliciesResponse' | |
|
Instances
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.
listKeyPoliciesResponse_httpStatus :: Lens' ListKeyPoliciesResponse Int Source #
The response's http status code.