pub struct DescribeKeyFluentBuilder { /* private fields */ }
Expand description
Fluent builder constructing a request to DescribeKey
.
Provides detailed information about a KMS key. You can run DescribeKey
on a customer managed key or an Amazon Web Services managed key.
This detailed information includes the key ARN, creation date (and deletion date, if applicable), the key state, and the origin and expiration date (if any) of the key material. It includes fields, like KeySpec
, that help you distinguish different types of KMS keys. It also displays the key usage (encryption, signing, or generating and verifying MACs) and the algorithms that the KMS key supports.
For multi-Region keys, DescribeKey
displays the primary key and all related replica keys. For KMS keys in CloudHSM key stores, it includes information about the key store, such as the key store ID and the CloudHSM cluster ID. For KMS keys in external key stores, it includes the custom key store ID and the ID of the external key.
DescribeKey
does not return the following information:
-
Aliases associated with the KMS key. To get this information, use
ListAliases
. -
Whether automatic key rotation is enabled on the KMS key. To get this information, use
GetKeyRotationStatus
. Also, some key states prevent a KMS key from being automatically rotated. For details, see How Automatic Key Rotation Works in the Key Management Service Developer Guide. -
Tags on the KMS key. To get this information, use
ListResourceTags
. -
Key policies and grants on the KMS key. To get this information, use
GetKeyPolicy
andListGrants
.
In general, DescribeKey
is a non-mutating operation. It returns data about KMS keys, but doesn't change them. However, Amazon Web Services services use DescribeKey
to create Amazon Web Services managed keys from a predefined Amazon Web Services alias with no key ID.
Cross-account use: Yes. To perform this operation with a KMS key in a different Amazon Web Services account, specify the key ARN or alias ARN in the value of the KeyId
parameter.
Required permissions: kms:DescribeKey (key policy)
Related operations:
-
GetKeyPolicy
-
GetKeyRotationStatus
-
ListAliases
-
ListGrants
-
ListKeys
-
ListResourceTags
-
ListRetirableGrants
Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.
Implementations§
source§impl DescribeKeyFluentBuilder
impl DescribeKeyFluentBuilder
sourcepub fn as_input(&self) -> &DescribeKeyInputBuilder
pub fn as_input(&self) -> &DescribeKeyInputBuilder
Access the DescribeKey as a reference.
sourcepub async fn send(
self
) -> Result<DescribeKeyOutput, SdkError<DescribeKeyError, HttpResponse>>
pub async fn send( self ) -> Result<DescribeKeyOutput, SdkError<DescribeKeyError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn customize(
self
) -> CustomizableOperation<DescribeKeyOutput, DescribeKeyError, Self>
pub fn customize( self ) -> CustomizableOperation<DescribeKeyOutput, DescribeKeyError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
sourcepub fn key_id(self, input: impl Into<String>) -> Self
pub fn key_id(self, input: impl Into<String>) -> Self
Describes the specified KMS key.
If you specify a predefined Amazon Web Services alias (an Amazon Web Services alias with no key ID), KMS associates the alias with an Amazon Web Services managed key and returns its KeyId
and Arn
in the response.
To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with "alias/"
. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.
For example:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
-
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
-
Alias name:
alias/ExampleAlias
-
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a KMS key, use ListKeys
or DescribeKey
. To get the alias name and alias ARN, use ListAliases
.
sourcepub fn set_key_id(self, input: Option<String>) -> Self
pub fn set_key_id(self, input: Option<String>) -> Self
Describes the specified KMS key.
If you specify a predefined Amazon Web Services alias (an Amazon Web Services alias with no key ID), KMS associates the alias with an Amazon Web Services managed key and returns its KeyId
and Arn
in the response.
To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with "alias/"
. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.
For example:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
-
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
-
Alias name:
alias/ExampleAlias
-
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a KMS key, use ListKeys
or DescribeKey
. To get the alias name and alias ARN, use ListAliases
.
sourcepub fn get_key_id(&self) -> &Option<String>
pub fn get_key_id(&self) -> &Option<String>
Describes the specified KMS key.
If you specify a predefined Amazon Web Services alias (an Amazon Web Services alias with no key ID), KMS associates the alias with an Amazon Web Services managed key and returns its KeyId
and Arn
in the response.
To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with "alias/"
. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.
For example:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
-
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
-
Alias name:
alias/ExampleAlias
-
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a KMS key, use ListKeys
or DescribeKey
. To get the alias name and alias ARN, use ListAliases
.
sourcepub fn grant_tokens(self, input: impl Into<String>) -> Self
pub fn grant_tokens(self, input: impl Into<String>) -> Self
Appends an item to GrantTokens
.
To override the contents of this collection use set_grant_tokens
.
A list of grant tokens.
Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved eventual consistency. For more information, see Grant token and Using a grant token in the Key Management Service Developer Guide.
sourcepub fn set_grant_tokens(self, input: Option<Vec<String>>) -> Self
pub fn set_grant_tokens(self, input: Option<Vec<String>>) -> Self
A list of grant tokens.
Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved eventual consistency. For more information, see Grant token and Using a grant token in the Key Management Service Developer Guide.
sourcepub fn get_grant_tokens(&self) -> &Option<Vec<String>>
pub fn get_grant_tokens(&self) -> &Option<Vec<String>>
A list of grant tokens.
Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved eventual consistency. For more information, see Grant token and Using a grant token in the Key Management Service Developer Guide.
Trait Implementations§
source§impl Clone for DescribeKeyFluentBuilder
impl Clone for DescribeKeyFluentBuilder
source§fn clone(&self) -> DescribeKeyFluentBuilder
fn clone(&self) -> DescribeKeyFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more