aws_sdk_cloudformation/types/_rollback_trigger.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A rollback trigger CloudFormation monitors during creation and updating of stacks. If any of the alarms you specify goes to ALARM state during the stack operation or within the specified monitoring period afterwards, CloudFormation rolls back the entire stack operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RollbackTrigger {
7 /// <p>The Amazon Resource Name (ARN) of the rollback trigger.</p>
8 /// <p>If a specified trigger is missing, the entire stack operation fails and is rolled back.</p>
9 pub arn: ::std::option::Option<::std::string::String>,
10 /// <p>The resource type of the rollback trigger. Specify either <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudwatch-alarm.html">AWS::CloudWatch::Alarm</a> or <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudwatch-compositealarm.html">AWS::CloudWatch::CompositeAlarm</a> resource types.</p>
11 pub r#type: ::std::option::Option<::std::string::String>,
12}
13impl RollbackTrigger {
14 /// <p>The Amazon Resource Name (ARN) of the rollback trigger.</p>
15 /// <p>If a specified trigger is missing, the entire stack operation fails and is rolled back.</p>
16 pub fn arn(&self) -> ::std::option::Option<&str> {
17 self.arn.as_deref()
18 }
19 /// <p>The resource type of the rollback trigger. Specify either <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudwatch-alarm.html">AWS::CloudWatch::Alarm</a> or <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudwatch-compositealarm.html">AWS::CloudWatch::CompositeAlarm</a> resource types.</p>
20 pub fn r#type(&self) -> ::std::option::Option<&str> {
21 self.r#type.as_deref()
22 }
23}
24impl RollbackTrigger {
25 /// Creates a new builder-style object to manufacture [`RollbackTrigger`](crate::types::RollbackTrigger).
26 pub fn builder() -> crate::types::builders::RollbackTriggerBuilder {
27 crate::types::builders::RollbackTriggerBuilder::default()
28 }
29}
30
31/// A builder for [`RollbackTrigger`](crate::types::RollbackTrigger).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct RollbackTriggerBuilder {
35 pub(crate) arn: ::std::option::Option<::std::string::String>,
36 pub(crate) r#type: ::std::option::Option<::std::string::String>,
37}
38impl RollbackTriggerBuilder {
39 /// <p>The Amazon Resource Name (ARN) of the rollback trigger.</p>
40 /// <p>If a specified trigger is missing, the entire stack operation fails and is rolled back.</p>
41 /// This field is required.
42 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
43 self.arn = ::std::option::Option::Some(input.into());
44 self
45 }
46 /// <p>The Amazon Resource Name (ARN) of the rollback trigger.</p>
47 /// <p>If a specified trigger is missing, the entire stack operation fails and is rolled back.</p>
48 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
49 self.arn = input;
50 self
51 }
52 /// <p>The Amazon Resource Name (ARN) of the rollback trigger.</p>
53 /// <p>If a specified trigger is missing, the entire stack operation fails and is rolled back.</p>
54 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
55 &self.arn
56 }
57 /// <p>The resource type of the rollback trigger. Specify either <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudwatch-alarm.html">AWS::CloudWatch::Alarm</a> or <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudwatch-compositealarm.html">AWS::CloudWatch::CompositeAlarm</a> resource types.</p>
58 /// This field is required.
59 pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60 self.r#type = ::std::option::Option::Some(input.into());
61 self
62 }
63 /// <p>The resource type of the rollback trigger. Specify either <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudwatch-alarm.html">AWS::CloudWatch::Alarm</a> or <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudwatch-compositealarm.html">AWS::CloudWatch::CompositeAlarm</a> resource types.</p>
64 pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65 self.r#type = input;
66 self
67 }
68 /// <p>The resource type of the rollback trigger. Specify either <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudwatch-alarm.html">AWS::CloudWatch::Alarm</a> or <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-cloudwatch-compositealarm.html">AWS::CloudWatch::CompositeAlarm</a> resource types.</p>
69 pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
70 &self.r#type
71 }
72 /// Consumes the builder and constructs a [`RollbackTrigger`](crate::types::RollbackTrigger).
73 pub fn build(self) -> crate::types::RollbackTrigger {
74 crate::types::RollbackTrigger {
75 arn: self.arn,
76 r#type: self.r#type,
77 }
78 }
79}