pub struct StatementBuilder { /* private fields */ }Expand description
Builder for IAM policy statements.
§Example
use rusty_cdk_core::iam::{StatementBuilder, Effect, PrincipalBuilder};
use rusty_cdk_core::wrappers::*;
use serde_json::Value;
use rusty_cdk_macros::iam_action;
let statement = StatementBuilder::new(
vec![iam_action!("s3:GetObject"), iam_action!("s3:PutObject")],
Effect::Allow
)
.resources(vec![Value::String("arn:aws:s3:::my-bucket/*".to_string())])
.principal(PrincipalBuilder::new().service("lambda.amazonaws.com").build())
.build();Implementations§
Source§impl StatementBuilder
impl StatementBuilder
pub fn new(actions: Vec<IamAction>, effect: Effect) -> StatementBuilder
pub fn principal(self, principal: Principal) -> StatementBuilder
pub fn condition(self, condition: Value) -> StatementBuilder
pub fn resources(self, resources: Vec<Value>) -> StatementBuilder
pub fn all_resources(self) -> StatementBuilder
pub fn build(self) -> Statement
Auto Trait Implementations§
impl Freeze for StatementBuilder
impl RefUnwindSafe for StatementBuilder
impl Send for StatementBuilder
impl Sync for StatementBuilder
impl Unpin for StatementBuilder
impl UnwindSafe for StatementBuilder
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.