Struct ApplyStackInput

Source
pub struct ApplyStackInput {
    pub capabilities: Vec<Capability>,
    pub client_request_token: Option<String>,
    pub disable_rollback: bool,
    pub notification_arns: Vec<String>,
    pub parameters: Vec<Parameter>,
    pub resource_types: Option<Vec<String>>,
    pub role_arn: Option<String>,
    pub stack_name: String,
    pub tags: Vec<Tag>,
    pub template_source: TemplateSource,
}
Expand description

The input for the apply_stack operation.

You can create an apply stack input via the new associated function. Setters are also available to make construction as ergonomic as possible.

use cloudformatious::{ApplyStackInput, Capability, Parameter, Tag, TemplateSource};

let config = aws_config::load_from_env().await;
let client = cloudformatious::Client::new(&config);
let input = ApplyStackInput::new("my-stack", TemplateSource::inline("{}"))
    .set_capabilities([Capability::Iam])
    .set_client_request_token("hello")
    .set_notification_arns(["arn:foo"])
    .set_parameters([Parameter { key: "hello".to_string(), value: "world".to_string() }])
    .set_resource_types(["AWS::IAM::Role"])
    .set_role_arn("arn:foo")
    .set_tags([Tag { key: "hello".to_string(), value: "world".to_string() }]);
let output = client.apply_stack(input).await?;
// ...

Fields§

§capabilities: Vec<Capability>

Capabilities to explicitly acknowledge.

See Capability for more information.

§client_request_token: Option<String>

A unique identifier for this apply_stack operation.

Specify this token if you plan to retry requests so that AWS CloudFormation knows that you’re not attempting to apply a stack with the same name. You might retry apply_stack requests to ensure that AWS CloudFormation successfully received them.

All events triggered by a given stack operation are assigned the same client request token, which are used to track operations.

§disable_rollback: bool

Whether or not to disable rolling back in the event of a failure.

When rollback is disabled, resources that were created/updated before the failing operation are preserved and the stack settles with a *_FAILED status. This may be helpful when debugging failing stack operations.

§notification_arns: Vec<String>

The Simple Notification Service (SNS) topic ARNs to publish stack related events.

You can find your SNS topic ARNs using the SNS console or your Command Line Interface (CLI).

§parameters: Vec<Parameter>

A list of input parameters for the stack.

If you don’t specify a key and value for a particular parameter, AWS CloudFormation uses the default value that is specified in your template.

Note that, unlike when directly updating a stack, it is not possible to reuse previous values of parameters.

§resource_types: Option<Vec<String>>

The template resource types that you have permissions to work with for this apply_stack operation, such as AWS::EC2::Instance, AWS::EC2::*, or Custom::MyCustomInstance.

Use the following syntax to describe template resource types:

  • AWS::* for all AWS resources.
  • Custom::* for all custom resources.
  • Custom::logical_ID for a specific custom resource.
  • AWS::service_name::* for all resources of a particular AWS service.
  • AWS::service_name::resource_logical_ID for a specific AWS resource.

If the list of resource types doesn’t include a resource that you’re applying, the operation fails. By default, AWS CloudFormation grants permissions to all resource types. AWS Identity and Access Management (IAM) uses this parameter for AWS CloudFormation-specific condition keys in IAM policies. For more information, see Controlling Access with AWS Identity and Access Management.

§role_arn: Option<String>

The Amazon Resource Name (ARN) of an AWS Identity And Access Management (IAM) role that AWS CloudFormation assumes to apply the stack.

AWS CloudFormation uses the role’s credentials to make calls on your behalf. AWS CloudFormation always uses this role for all future operations on the stack. As long as users have permission to operate on the stack, AWS CloudFormation uses this role even if the users don’t have permission to pass it. Ensure that the role grants least privilege.

If you don’t specify a value, AWS CloudFormation uses the role that was previously associated with the stack. If no role is available, AWS CloudFormation uses a temporary session that is generated from your user credentials.

§stack_name: String

The name that is associated with the stack.

The name must be unique in the region in which you are creating the stack.

A stack name can contain only alphanumeric characters (case sensitive) and hyphens. It must start with an alphabetic character and cannot be longer than 128 characters.

§tags: Vec<Tag>

Key-value pairs to associate with this stack.

AWS CloudFormation also propagates these tags to the resources created in the stack. A maximum number of 50 tags can be specified.

§template_source: TemplateSource

Source for the template body to apply.

For more information about templates, go to Template Anatomy in the AWS CloudFormation User Guide.

Implementations§

Source§

impl ApplyStackInput

Source

pub fn new( stack_name: impl Into<String>, template_source: TemplateSource, ) -> Self

Construct an input for the given stack_name and template_source.

Source

pub fn set_capabilities(self, capabilities: impl Into<Vec<Capability>>) -> Self

Set the value for capabilities.

Note: this consumes and returns self for chaining.

Source

pub fn set_client_request_token( self, client_request_token: impl Into<String>, ) -> Self

Set the value for client_request_token.

Note: this consumes and returns self for chaining.

Source

pub fn set_disable_rollback(self, disable_rollback: bool) -> Self

Set the value for disable_rollback.

Note: this consumes and returns self for chaining.

Source

pub fn set_notification_arns<I, S>(self, notification_arns: I) -> Self
where I: Into<Vec<S>>, S: Into<String>,

Set the value for notification_arns.

Note: this consumes and returns self for chaining.

Source

pub fn set_parameters(self, parameters: impl Into<Vec<Parameter>>) -> Self

Set the value for parameters.

Note: this consumes and returns self for chaining.

Source

pub fn set_resource_types<I, S>(self, resource_types: I) -> Self
where I: Into<Vec<S>>, S: Into<String>,

Set the value for resource_types.

Note: this consumes and returns self for chaining.

Source

pub fn set_role_arn(self, role_arn: impl Into<String>) -> Self

Set the value for role_arn.

Note: this consumes and returns self for chaining.

Source

pub fn set_tags(self, tags: impl Into<Vec<Tag>>) -> Self

Set the value for tags.

Note: this consumes and returns self for chaining.

Trait Implementations§

Source§

impl Clone for ApplyStackInput

Source§

fn clone(&self) -> ApplyStackInput

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ApplyStackInput

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> IntoResult<T> for T

Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,