| Copyright | (c) 2013-2023 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
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
- data GetKeyPolicy = GetKeyPolicy' {
- keyId :: Text
- policyName :: Text
- newGetKeyPolicy :: Text -> Text -> GetKeyPolicy
- getKeyPolicy_keyId :: Lens' GetKeyPolicy Text
- getKeyPolicy_policyName :: Lens' GetKeyPolicy Text
- data GetKeyPolicyResponse = GetKeyPolicyResponse' {
- policy :: Maybe Text
- httpStatus :: Int
- newGetKeyPolicyResponse :: Int -> GetKeyPolicyResponse
- getKeyPolicyResponse_policy :: Lens' GetKeyPolicyResponse (Maybe Text)
- getKeyPolicyResponse_httpStatus :: Lens' GetKeyPolicyResponse Int
Creating a Request
data GetKeyPolicy Source #
See: newGetKeyPolicy smart constructor.
Constructors
| GetKeyPolicy' | |
Fields
| |
Instances
Arguments
| :: Text | |
| -> Text | |
| -> GetKeyPolicy |
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:
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
newGetKeyPolicyResponse Source #
Arguments
| :: Int | |
| -> GetKeyPolicyResponse |
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.
getKeyPolicyResponse_httpStatus :: Lens' GetKeyPolicyResponse Int Source #
The response's http status code.