Struct aws_sdk_kms::input::PutKeyPolicyInput
source · [−]#[non_exhaustive]pub struct PutKeyPolicyInput {
pub key_id: Option<String>,
pub policy_name: Option<String>,
pub policy: Option<String>,
pub bypass_policy_lockout_safety_check: bool,
}Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.key_id: Option<String>Sets the key policy on 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.
policy_name: Option<String>The name of the key policy. The only valid value is default.
policy: Option<String>The key policy to attach to the KMS key.
The key policy must meet the following criteria:
-
If you don't set
BypassPolicyLockoutSafetyCheckto true, the key policy must allow the principal that is making thePutKeyPolicyrequest to make a subsequentPutKeyPolicyrequest on the KMS key. This reduces the risk that the KMS key becomes unmanageable. For more information, refer to the scenario in the Default Key Policy section of the Key Management Service Developer Guide. -
Each statement in the key policy must contain one or more principals. The principals in the key policy must exist and be visible to KMS. When you create a new Amazon Web Services principal (for example, an IAM user or role), you might need to enforce a delay before including the new principal in a key policy because the new principal might not be immediately visible to KMS. For more information, see Changes that I make are not always immediately visible in the Amazon Web Services Identity and Access Management User Guide.
A key policy document must conform to the following rules.
-
Up to 32 kilobytes (32768 bytes)
-
Must be UTF-8 encoded
-
The only Unicode characters that are permitted in a key policy document are the horizontal tab (U+0009), linefeed (U+000A), carriage return (U+000D), and characters in the range U+0020 to U+00FF.
-
The
Sidelement in a key policy statement can include spaces. (Spaces are prohibited in theSidelement of an IAM policy document.)
bypass_policy_lockout_safety_check: boolA flag to indicate whether to bypass the key policy lockout safety check.
Setting this value to true increases the risk that the KMS key becomes unmanageable. Do not set this value to true indiscriminately.
For more information, refer to the scenario in the Default Key Policy section in the Key Management Service Developer Guide.
Use this parameter only when you intend to prevent the principal that is making the request from making a subsequent PutKeyPolicy request on the KMS key.
The default value is false.
Implementations
sourceimpl PutKeyPolicyInput
impl PutKeyPolicyInput
sourcepub async fn make_operation(
&self,
_config: &Config
) -> Result<Operation<PutKeyPolicy, AwsErrorRetryPolicy>, BuildError>
pub async fn make_operation(
&self,
_config: &Config
) -> Result<Operation<PutKeyPolicy, AwsErrorRetryPolicy>, BuildError>
Consumes the builder and constructs an Operation<PutKeyPolicy>
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture PutKeyPolicyInput
sourceimpl PutKeyPolicyInput
impl PutKeyPolicyInput
sourcepub fn key_id(&self) -> Option<&str>
pub fn key_id(&self) -> Option<&str>
Sets the key policy on 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.
sourcepub fn policy_name(&self) -> Option<&str>
pub fn policy_name(&self) -> Option<&str>
The name of the key policy. The only valid value is default.
sourcepub fn policy(&self) -> Option<&str>
pub fn policy(&self) -> Option<&str>
The key policy to attach to the KMS key.
The key policy must meet the following criteria:
-
If you don't set
BypassPolicyLockoutSafetyCheckto true, the key policy must allow the principal that is making thePutKeyPolicyrequest to make a subsequentPutKeyPolicyrequest on the KMS key. This reduces the risk that the KMS key becomes unmanageable. For more information, refer to the scenario in the Default Key Policy section of the Key Management Service Developer Guide. -
Each statement in the key policy must contain one or more principals. The principals in the key policy must exist and be visible to KMS. When you create a new Amazon Web Services principal (for example, an IAM user or role), you might need to enforce a delay before including the new principal in a key policy because the new principal might not be immediately visible to KMS. For more information, see Changes that I make are not always immediately visible in the Amazon Web Services Identity and Access Management User Guide.
A key policy document must conform to the following rules.
-
Up to 32 kilobytes (32768 bytes)
-
Must be UTF-8 encoded
-
The only Unicode characters that are permitted in a key policy document are the horizontal tab (U+0009), linefeed (U+000A), carriage return (U+000D), and characters in the range U+0020 to U+00FF.
-
The
Sidelement in a key policy statement can include spaces. (Spaces are prohibited in theSidelement of an IAM policy document.)
sourcepub fn bypass_policy_lockout_safety_check(&self) -> bool
pub fn bypass_policy_lockout_safety_check(&self) -> bool
A flag to indicate whether to bypass the key policy lockout safety check.
Setting this value to true increases the risk that the KMS key becomes unmanageable. Do not set this value to true indiscriminately.
For more information, refer to the scenario in the Default Key Policy section in the Key Management Service Developer Guide.
Use this parameter only when you intend to prevent the principal that is making the request from making a subsequent PutKeyPolicy request on the KMS key.
The default value is false.
Trait Implementations
sourceimpl Clone for PutKeyPolicyInput
impl Clone for PutKeyPolicyInput
sourcefn clone(&self) -> PutKeyPolicyInput
fn clone(&self) -> PutKeyPolicyInput
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for PutKeyPolicyInput
impl Debug for PutKeyPolicyInput
sourceimpl PartialEq<PutKeyPolicyInput> for PutKeyPolicyInput
impl PartialEq<PutKeyPolicyInput> for PutKeyPolicyInput
sourcefn eq(&self, other: &PutKeyPolicyInput) -> bool
fn eq(&self, other: &PutKeyPolicyInput) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &PutKeyPolicyInput) -> bool
fn ne(&self, other: &PutKeyPolicyInput) -> bool
This method tests for !=.
impl StructuralPartialEq for PutKeyPolicyInput
Auto Trait Implementations
impl RefUnwindSafe for PutKeyPolicyInput
impl Send for PutKeyPolicyInput
impl Sync for PutKeyPolicyInput
impl Unpin for PutKeyPolicyInput
impl UnwindSafe for PutKeyPolicyInput
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more