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) -> Self
pub fn principal(self, principal: Principal) -> Self
pub fn condition(self, condition: Value) -> Self
pub fn resources(self, resources: Vec<Value>) -> Self
pub fn all_resources(self) -> Self
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