Gets a list of all grants for the specified KMS key.
You must specify the KMS key in all requests. You can filter the grant list by grant ID or
grantee principal.
For detailed information about grants, including grant terminology, see Grants in KMS in the
Key Management Service Developer Guide. For examples of working with grants in several
programming languages, see Programming grants.
The GranteePrincipal field in the ListGrants response usually contains the
user or role designated as the grantee principal in the grant. However, when the grantee
principal in the grant is an Amazon Web Services service, the GranteePrincipal field contains
the service
principal, which might represent several different grantee principals.
Cross-account use: Yes. To perform this operation on a KMS key in a different Amazon Web Services account, specify the key
ARN in the value of the KeyId parameter.
Gets a list of all grants for the specified KMS key.
You must specify the KMS key in all requests. You can filter the grant list by grant ID or grantee principal.
For detailed information about grants, including grant terminology, see Grants in KMS in the Key Management Service Developer Guide . For examples of working with grants in several programming languages, see Programming grants.
The
GranteePrincipal
field in theListGrants
response usually contains the user or role designated as the grantee principal in the grant. However, when the grantee principal in the grant is an Amazon Web Services service, theGranteePrincipal
field contains the service principal, which might represent several different grantee principals.Cross-account use: Yes. To perform this operation on a KMS key in a different Amazon Web Services account, specify the key ARN in the value of the
KeyId
parameter.Required permissions: kms:ListGrants (key policy)
Related operations:
CreateGrant
ListRetirableGrants
RetireGrant
RevokeGrant
Use a bare-bones client and the command you need to make an API call.
import { KMSClient, ListGrantsCommand } from "@aws-sdk/client-kms"; // ES Modules import // const { KMSClient, ListGrantsCommand } = require("@aws-sdk/client-kms"); // CommonJS import const client = new KMSClient(config); const command = new ListGrantsCommand(input); const response = await client.send(command);
ListGrantsCommandInput for command's
input
shape.ListGrantsCommandOutput for command's
response
shape.config for KMSClient's
config
shape.