pub struct GetKeyPolicyFluentBuilder { /* private fields */ }Expand description
Fluent builder constructing a request to GetKeyPolicy.
Gets a key policy attached to the specified KMS key.
A KMS key can have two key policies. You manage the default key policy. Resource Access Manager (RAM) manages the AWS_RAM key policy for KMS keys that you share through RAM. You can use GetKeyPolicy to view the AWS_RAM key policy, but you can't change it with PutKeyPolicy. To get the AWS_RAM key policy, set the PolicyName parameter to AWS_RAM. If the KMS key doesn't have an AWS_RAM key policy, GetKeyPolicy returns a NotFoundException. For information about sharing KMS keys, see Sharing KMS keys with RAM in the Key Management Service Developer Guide. For information about RAM managed permissions, see Managing permissions in RAM in the RAM User Guide.
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)
You can use the kms:PolicyName condition key to control access to this operation based on the value of the PolicyName parameter in the request. If the request doesn't include PolicyName, the value of kms:PolicyName is default.
Related operations: PutKeyPolicy
Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.
Implementations§
Source§impl GetKeyPolicyFluentBuilder
impl GetKeyPolicyFluentBuilder
Sourcepub fn as_input(&self) -> &GetKeyPolicyInputBuilder
pub fn as_input(&self) -> &GetKeyPolicyInputBuilder
Access the GetKeyPolicy as a reference.
Sourcepub async fn send(
self,
) -> Result<GetKeyPolicyOutput, SdkError<GetKeyPolicyError, HttpResponse>>
pub async fn send( self, ) -> Result<GetKeyPolicyOutput, SdkError<GetKeyPolicyError, 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<GetKeyPolicyOutput, GetKeyPolicyError, Self>
pub fn customize( self, ) -> CustomizableOperation<GetKeyPolicyOutput, GetKeyPolicyError, 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
Identifies the KMS key whose key policy you want to get.
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.
Sourcepub fn set_key_id(self, input: Option<String>) -> Self
pub fn set_key_id(self, input: Option<String>) -> Self
Identifies the KMS key whose key policy you want to get.
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.
Sourcepub fn get_key_id(&self) -> &Option<String>
pub fn get_key_id(&self) -> &Option<String>
Identifies the KMS key whose key policy you want to get.
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.
Sourcepub fn policy_name(self, input: impl Into<String>) -> Self
pub fn policy_name(self, input: impl Into<String>) -> Self
Specifies the name of the key policy. If no policy name is specified, the default value is default. Valid values are default and AWS_RAM. Use AWS_RAM to get the key policy that RAM manages for a KMS key that you share through RAM. If the KMS key doesn't have an AWS_RAM key policy, the request fails with a NotFoundException. To get the names of key policies, use ListKeyPolicies.
Sourcepub fn set_policy_name(self, input: Option<String>) -> Self
pub fn set_policy_name(self, input: Option<String>) -> Self
Specifies the name of the key policy. If no policy name is specified, the default value is default. Valid values are default and AWS_RAM. Use AWS_RAM to get the key policy that RAM manages for a KMS key that you share through RAM. If the KMS key doesn't have an AWS_RAM key policy, the request fails with a NotFoundException. To get the names of key policies, use ListKeyPolicies.
Sourcepub fn get_policy_name(&self) -> &Option<String>
pub fn get_policy_name(&self) -> &Option<String>
Specifies the name of the key policy. If no policy name is specified, the default value is default. Valid values are default and AWS_RAM. Use AWS_RAM to get the key policy that RAM manages for a KMS key that you share through RAM. If the KMS key doesn't have an AWS_RAM key policy, the request fails with a NotFoundException. To get the names of key policies, use ListKeyPolicies.
Trait Implementations§
Source§impl Clone for GetKeyPolicyFluentBuilder
impl Clone for GetKeyPolicyFluentBuilder
Source§fn clone(&self) -> GetKeyPolicyFluentBuilder
fn clone(&self) -> GetKeyPolicyFluentBuilder
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 GetKeyPolicyFluentBuilder
impl !UnwindSafe for GetKeyPolicyFluentBuilder
impl Freeze for GetKeyPolicyFluentBuilder
impl Send for GetKeyPolicyFluentBuilder
impl Sync for GetKeyPolicyFluentBuilder
impl Unpin for GetKeyPolicyFluentBuilder
impl UnsafeUnpin for GetKeyPolicyFluentBuilder
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