pub struct ListKeysFluentBuilder { /* private fields */ }Expand description
Fluent builder constructing a request to ListKeys.
Gets a list of all KMS keys in the caller's Amazon Web Services account and Region.
You can also use ListKeys to list KMS keys in the Region that other Amazon Web Services accounts shared with the caller's Amazon Web Services account through Resource Access Manager (RAM). To list them, use the ResourceOwners parameter. If you omit ResourceOwners, ListKeys lists only the KMS keys in the caller's Amazon Web Services account.
When ResourceOwners includes OTHER_ACCOUNTS_VIA_RAM, ListKeys returns the KMS keys that other Amazon Web Services accounts currently share with the caller's Amazon Web Services account through RAM. For information about how and when a resource that another account shares becomes available to your Amazon Web Services account, see Access Amazon Web Services resources shared with you in the RAM User Guide.
Cross-account use: No. This operation doesn't take a KMS key parameter, so you can't use it to list the KMS keys of a specific Amazon Web Services account. The only KMS keys in other Amazon Web Services accounts that ListKeys returns are the ones that other accounts shared with the caller's Amazon Web Services account through RAM. To list them, set the ResourceOwners parameter to include OTHER_ACCOUNTS_VIA_RAM.
Required permissions: kms:ListKeys (IAM policy)
The same kms:ListKeys permission lets you list the KMS keys that other accounts shared with you through RAM. KMS doesn't evaluate the key policies of shared KMS keys when it lists them. To use a shared KMS key, you need permission for each operation on that KMS key.
Related operations:
-
CreateKey -
DescribeKey -
ListAliases -
ListResourceTags
Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.
KMS keys that other Amazon Web Services accounts share with you can take some time to appear in or disappear from ListKeys results after changes to resource shares, such as accepting an invitation or deleting a resource share.
Implementations§
Source§impl ListKeysFluentBuilder
impl ListKeysFluentBuilder
Sourcepub fn as_input(&self) -> &ListKeysInputBuilder
pub fn as_input(&self) -> &ListKeysInputBuilder
Access the ListKeys as a reference.
Sourcepub async fn send(
self,
) -> Result<ListKeysOutput, SdkError<ListKeysError, HttpResponse>>
pub async fn send( self, ) -> Result<ListKeysOutput, SdkError<ListKeysError, 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<ListKeysOutput, ListKeysError, Self>
pub fn customize( self, ) -> CustomizableOperation<ListKeysOutput, ListKeysError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
Sourcepub fn into_paginator(self) -> ListKeysPaginator
pub fn into_paginator(self) -> ListKeysPaginator
Create a paginator for this request
Paginators are used by calling send().await which returns a PaginationStream.
Sourcepub fn limit(self, input: i32) -> Self
pub fn limit(self, input: i32) -> Self
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.
Sourcepub fn set_limit(self, input: Option<i32>) -> Self
pub fn set_limit(self, input: Option<i32>) -> Self
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.
Sourcepub fn get_limit(&self) -> &Option<i32>
pub fn get_limit(&self) -> &Option<i32>
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.
Sourcepub fn marker(self, input: impl Into<String>) -> Self
pub fn marker(self, input: impl Into<String>) -> Self
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.
Sourcepub fn set_marker(self, input: Option<String>) -> Self
pub fn set_marker(self, input: Option<String>) -> Self
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.
Sourcepub fn get_marker(&self) -> &Option<String>
pub fn get_marker(&self) -> &Option<String>
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.
Sourcepub fn resource_owners(self, input: ResourceOwnerType) -> Self
pub fn resource_owners(self, input: ResourceOwnerType) -> Self
Appends an item to ResourceOwners.
To override the contents of this collection use set_resource_owners.
Specifies whose KMS keys to list. Use this parameter to list KMS keys that other Amazon Web Services accounts shared with your Amazon Web Services account through Resource Access Manager (RAM).
Specify one or two values. Valid values are:
- SELF
-
Lists the KMS keys in your Amazon Web Services account and Region.
- OTHER_ACCOUNTS_VIA_RAM
-
Lists the KMS keys in the Region that other Amazon Web Services accounts currently share with your Amazon Web Services account through RAM. This list doesn't include KMS keys that your Amazon Web Services account owns. For each of these KMS keys, the key ARN in the response contains the account ID of the Amazon Web Services account that owns the KMS key.
If you omit this parameter, ListKeys lists only the KMS keys in your Amazon Web Services account. If you specify both values, in either order, ListKeys returns the KMS keys in your Amazon Web Services account first, and then the KMS keys that other Amazon Web Services accounts shared with you. A single response doesn't contain both kinds of KMS keys.
When ResourceOwners includes OTHER_ACCOUNTS_VIA_RAM, a response can contain fewer KMS keys than the Limit value, or none, even when Truncated is true. To get all of the KMS keys, continue calling ListKeys with the NextMarker value from each response until Truncated is false. Use a NextMarker value only in a request that has the same ResourceOwners value as the request that returned it. Otherwise, the request can fail with an InvalidMarkerException.
KMS keys that other Amazon Web Services accounts share with you can take some time to appear in or disappear from the results after changes to resource shares.
Sourcepub fn set_resource_owners(self, input: Option<Vec<ResourceOwnerType>>) -> Self
pub fn set_resource_owners(self, input: Option<Vec<ResourceOwnerType>>) -> Self
Specifies whose KMS keys to list. Use this parameter to list KMS keys that other Amazon Web Services accounts shared with your Amazon Web Services account through Resource Access Manager (RAM).
Specify one or two values. Valid values are:
- SELF
-
Lists the KMS keys in your Amazon Web Services account and Region.
- OTHER_ACCOUNTS_VIA_RAM
-
Lists the KMS keys in the Region that other Amazon Web Services accounts currently share with your Amazon Web Services account through RAM. This list doesn't include KMS keys that your Amazon Web Services account owns. For each of these KMS keys, the key ARN in the response contains the account ID of the Amazon Web Services account that owns the KMS key.
If you omit this parameter, ListKeys lists only the KMS keys in your Amazon Web Services account. If you specify both values, in either order, ListKeys returns the KMS keys in your Amazon Web Services account first, and then the KMS keys that other Amazon Web Services accounts shared with you. A single response doesn't contain both kinds of KMS keys.
When ResourceOwners includes OTHER_ACCOUNTS_VIA_RAM, a response can contain fewer KMS keys than the Limit value, or none, even when Truncated is true. To get all of the KMS keys, continue calling ListKeys with the NextMarker value from each response until Truncated is false. Use a NextMarker value only in a request that has the same ResourceOwners value as the request that returned it. Otherwise, the request can fail with an InvalidMarkerException.
KMS keys that other Amazon Web Services accounts share with you can take some time to appear in or disappear from the results after changes to resource shares.
Sourcepub fn get_resource_owners(&self) -> &Option<Vec<ResourceOwnerType>>
pub fn get_resource_owners(&self) -> &Option<Vec<ResourceOwnerType>>
Specifies whose KMS keys to list. Use this parameter to list KMS keys that other Amazon Web Services accounts shared with your Amazon Web Services account through Resource Access Manager (RAM).
Specify one or two values. Valid values are:
- SELF
-
Lists the KMS keys in your Amazon Web Services account and Region.
- OTHER_ACCOUNTS_VIA_RAM
-
Lists the KMS keys in the Region that other Amazon Web Services accounts currently share with your Amazon Web Services account through RAM. This list doesn't include KMS keys that your Amazon Web Services account owns. For each of these KMS keys, the key ARN in the response contains the account ID of the Amazon Web Services account that owns the KMS key.
If you omit this parameter, ListKeys lists only the KMS keys in your Amazon Web Services account. If you specify both values, in either order, ListKeys returns the KMS keys in your Amazon Web Services account first, and then the KMS keys that other Amazon Web Services accounts shared with you. A single response doesn't contain both kinds of KMS keys.
When ResourceOwners includes OTHER_ACCOUNTS_VIA_RAM, a response can contain fewer KMS keys than the Limit value, or none, even when Truncated is true. To get all of the KMS keys, continue calling ListKeys with the NextMarker value from each response until Truncated is false. Use a NextMarker value only in a request that has the same ResourceOwners value as the request that returned it. Otherwise, the request can fail with an InvalidMarkerException.
KMS keys that other Amazon Web Services accounts share with you can take some time to appear in or disappear from the results after changes to resource shares.
Trait Implementations§
Source§impl Clone for ListKeysFluentBuilder
impl Clone for ListKeysFluentBuilder
Source§fn clone(&self) -> ListKeysFluentBuilder
fn clone(&self) -> ListKeysFluentBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ListKeysFluentBuilder
impl !UnwindSafe for ListKeysFluentBuilder
impl Freeze for ListKeysFluentBuilder
impl Send for ListKeysFluentBuilder
impl Sync for ListKeysFluentBuilder
impl Unpin for ListKeysFluentBuilder
impl UnsafeUnpin for ListKeysFluentBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more