pub struct StackBuilder { /* private fields */ }Expand description
Builder for CloudFormation stacks.
Collects resources and manages their relationships. Might validate whether IAM roles are missing permissions for AWS services they need to access, based on Cargo.toml dependencies.
§Example
use rusty_cdk_core::stack::StackBuilder;
use rusty_cdk_core::sqs::QueueBuilder;
use rusty_cdk_core::wrappers::*;
let mut stack_builder = StackBuilder::new();
// Add resources to the stack
let queue = QueueBuilder::new("my-queue")
.standard_queue()
.build(&mut stack_builder);
// Add tags to the stack
stack_builder = stack_builder
.add_tag("Environment", "Production")
.add_tag("Owner", "Team");
// Build the stack
let stack = stack_builder.build().expect("Stack to build successfully");Implementations§
Source§impl StackBuilder
impl StackBuilder
pub fn new() -> StackBuilder
pub fn add_resource<T>(&mut self, resource: T)
pub fn add_tag<T>(self, key: T, value: T) -> StackBuilder
Sourcepub fn build(self) -> Result<Stack, StackBuilderError>
pub fn build(self) -> Result<Stack, StackBuilderError>
Builds the stack and validates all resources.
Might return an error if any IAM roles are missing permissions for AWS services they need to access, based on Cargo.toml dependencies.
Trait Implementations§
Source§impl Default for StackBuilder
impl Default for StackBuilder
Source§fn default() -> StackBuilder
fn default() -> StackBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StackBuilder
impl RefUnwindSafe for StackBuilder
impl Send for StackBuilder
impl Sync for StackBuilder
impl Unpin for StackBuilder
impl UnwindSafe for StackBuilder
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.