Struct aws_sdk_cloudwatchlogs::operation::put_resource_policy::builders::PutResourcePolicyInputBuilder
source · #[non_exhaustive]pub struct PutResourcePolicyInputBuilder { /* private fields */ }
Expand description
A builder for PutResourcePolicyInput
.
Implementations§
source§impl PutResourcePolicyInputBuilder
impl PutResourcePolicyInputBuilder
sourcepub fn policy_name(self, input: impl Into<String>) -> Self
pub fn policy_name(self, input: impl Into<String>) -> Self
Name of the new policy. This parameter is required.
sourcepub fn set_policy_name(self, input: Option<String>) -> Self
pub fn set_policy_name(self, input: Option<String>) -> Self
Name of the new policy. This parameter is required.
sourcepub fn get_policy_name(&self) -> &Option<String>
pub fn get_policy_name(&self) -> &Option<String>
Name of the new policy. This parameter is required.
sourcepub fn policy_document(self, input: impl Into<String>) -> Self
pub fn policy_document(self, input: impl Into<String>) -> Self
Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. This parameter is required.
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn"
with the ARN of your CloudWatch Logs resource, such as a log group or log stream.
CloudWatch Logs also supports aws:SourceArn and aws:SourceAccount condition context keys.
In the example resource policy, you would replace the value of SourceArn
with the resource making the call from Route 53 to CloudWatch Logs. You would also replace the value of SourceAccount
with the Amazon Web Services account ID making that call.
{ "Version": "2012-10-17", "Statement": \[ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": \[ "route53.amazonaws.com" \] }, "Action": "logs:PutLogEvents", "Resource": "logArn", "Condition": { "ArnLike": { "aws:SourceArn": "myRoute53ResourceArn" }, "StringEquals": { "aws:SourceAccount": "myAwsAccountId" } } } \] }
sourcepub fn set_policy_document(self, input: Option<String>) -> Self
pub fn set_policy_document(self, input: Option<String>) -> Self
Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. This parameter is required.
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn"
with the ARN of your CloudWatch Logs resource, such as a log group or log stream.
CloudWatch Logs also supports aws:SourceArn and aws:SourceAccount condition context keys.
In the example resource policy, you would replace the value of SourceArn
with the resource making the call from Route 53 to CloudWatch Logs. You would also replace the value of SourceAccount
with the Amazon Web Services account ID making that call.
{ "Version": "2012-10-17", "Statement": \[ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": \[ "route53.amazonaws.com" \] }, "Action": "logs:PutLogEvents", "Resource": "logArn", "Condition": { "ArnLike": { "aws:SourceArn": "myRoute53ResourceArn" }, "StringEquals": { "aws:SourceAccount": "myAwsAccountId" } } } \] }
sourcepub fn get_policy_document(&self) -> &Option<String>
pub fn get_policy_document(&self) -> &Option<String>
Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. This parameter is required.
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn"
with the ARN of your CloudWatch Logs resource, such as a log group or log stream.
CloudWatch Logs also supports aws:SourceArn and aws:SourceAccount condition context keys.
In the example resource policy, you would replace the value of SourceArn
with the resource making the call from Route 53 to CloudWatch Logs. You would also replace the value of SourceAccount
with the Amazon Web Services account ID making that call.
{ "Version": "2012-10-17", "Statement": \[ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": \[ "route53.amazonaws.com" \] }, "Action": "logs:PutLogEvents", "Resource": "logArn", "Condition": { "ArnLike": { "aws:SourceArn": "myRoute53ResourceArn" }, "StringEquals": { "aws:SourceAccount": "myAwsAccountId" } } } \] }
sourcepub fn build(self) -> Result<PutResourcePolicyInput, BuildError>
pub fn build(self) -> Result<PutResourcePolicyInput, BuildError>
Consumes the builder and constructs a PutResourcePolicyInput
.
source§impl PutResourcePolicyInputBuilder
impl PutResourcePolicyInputBuilder
sourcepub async fn send_with(
self,
client: &Client,
) -> Result<PutResourcePolicyOutput, SdkError<PutResourcePolicyError, HttpResponse>>
pub async fn send_with( self, client: &Client, ) -> Result<PutResourcePolicyOutput, SdkError<PutResourcePolicyError, HttpResponse>>
Sends a request with this input using the given client.
Trait Implementations§
source§impl Clone for PutResourcePolicyInputBuilder
impl Clone for PutResourcePolicyInputBuilder
source§fn clone(&self) -> PutResourcePolicyInputBuilder
fn clone(&self) -> PutResourcePolicyInputBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Default for PutResourcePolicyInputBuilder
impl Default for PutResourcePolicyInputBuilder
source§fn default() -> PutResourcePolicyInputBuilder
fn default() -> PutResourcePolicyInputBuilder
source§impl PartialEq for PutResourcePolicyInputBuilder
impl PartialEq for PutResourcePolicyInputBuilder
source§fn eq(&self, other: &PutResourcePolicyInputBuilder) -> bool
fn eq(&self, other: &PutResourcePolicyInputBuilder) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for PutResourcePolicyInputBuilder
Auto Trait Implementations§
impl Freeze for PutResourcePolicyInputBuilder
impl RefUnwindSafe for PutResourcePolicyInputBuilder
impl Send for PutResourcePolicyInputBuilder
impl Sync for PutResourcePolicyInputBuilder
impl Unpin for PutResourcePolicyInputBuilder
impl UnwindSafe for PutResourcePolicyInputBuilder
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> 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