aws_sdk_codedeploy/types/
_minimum_healthy_hosts.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about the minimum number of healthy instances.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct MinimumHealthyHosts {
7    /// <p>The minimum healthy instance type:</p>
8    /// <ul>
9    /// <li>
10    /// <p><code>HOST_COUNT</code>: The minimum number of healthy instances as an absolute value.</p></li>
11    /// <li>
12    /// <p><code>FLEET_PERCENT</code>: The minimum number of healthy instances as a percentage of the total number of instances in the deployment.</p></li>
13    /// </ul>
14    /// <p>In an example of nine instances, if a HOST_COUNT of six is specified, deploy to up to three instances at a time. The deployment is successful if six or more instances are deployed to successfully. Otherwise, the deployment fails. If a FLEET_PERCENT of 40 is specified, deploy to up to five instances at a time. The deployment is successful if four or more instances are deployed to successfully. Otherwise, the deployment fails.</p><note>
15    /// <p>In a call to the <code>GetDeploymentConfig</code>, CodeDeployDefault.OneAtATime returns a minimum healthy instance type of MOST_CONCURRENCY and a value of 1. This means a deployment to only one instance at a time. (You cannot set the type to MOST_CONCURRENCY, only to HOST_COUNT or FLEET_PERCENT.) In addition, with CodeDeployDefault.OneAtATime, CodeDeploy attempts to ensure that all instances but one are kept in a healthy state during the deployment. Although this allows one instance at a time to be taken offline for a new deployment, it also means that if the deployment to the last instance fails, the overall deployment is still successful.</p>
16    /// </note>
17    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/instances-health.html">CodeDeploy Instance Health</a> in the <i>CodeDeploy User Guide</i>.</p>
18    pub r#type: ::std::option::Option<crate::types::MinimumHealthyHostsType>,
19    /// <p>The minimum healthy instance value.</p>
20    pub value: i32,
21}
22impl MinimumHealthyHosts {
23    /// <p>The minimum healthy instance type:</p>
24    /// <ul>
25    /// <li>
26    /// <p><code>HOST_COUNT</code>: The minimum number of healthy instances as an absolute value.</p></li>
27    /// <li>
28    /// <p><code>FLEET_PERCENT</code>: The minimum number of healthy instances as a percentage of the total number of instances in the deployment.</p></li>
29    /// </ul>
30    /// <p>In an example of nine instances, if a HOST_COUNT of six is specified, deploy to up to three instances at a time. The deployment is successful if six or more instances are deployed to successfully. Otherwise, the deployment fails. If a FLEET_PERCENT of 40 is specified, deploy to up to five instances at a time. The deployment is successful if four or more instances are deployed to successfully. Otherwise, the deployment fails.</p><note>
31    /// <p>In a call to the <code>GetDeploymentConfig</code>, CodeDeployDefault.OneAtATime returns a minimum healthy instance type of MOST_CONCURRENCY and a value of 1. This means a deployment to only one instance at a time. (You cannot set the type to MOST_CONCURRENCY, only to HOST_COUNT or FLEET_PERCENT.) In addition, with CodeDeployDefault.OneAtATime, CodeDeploy attempts to ensure that all instances but one are kept in a healthy state during the deployment. Although this allows one instance at a time to be taken offline for a new deployment, it also means that if the deployment to the last instance fails, the overall deployment is still successful.</p>
32    /// </note>
33    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/instances-health.html">CodeDeploy Instance Health</a> in the <i>CodeDeploy User Guide</i>.</p>
34    pub fn r#type(&self) -> ::std::option::Option<&crate::types::MinimumHealthyHostsType> {
35        self.r#type.as_ref()
36    }
37    /// <p>The minimum healthy instance value.</p>
38    pub fn value(&self) -> i32 {
39        self.value
40    }
41}
42impl MinimumHealthyHosts {
43    /// Creates a new builder-style object to manufacture [`MinimumHealthyHosts`](crate::types::MinimumHealthyHosts).
44    pub fn builder() -> crate::types::builders::MinimumHealthyHostsBuilder {
45        crate::types::builders::MinimumHealthyHostsBuilder::default()
46    }
47}
48
49/// A builder for [`MinimumHealthyHosts`](crate::types::MinimumHealthyHosts).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct MinimumHealthyHostsBuilder {
53    pub(crate) r#type: ::std::option::Option<crate::types::MinimumHealthyHostsType>,
54    pub(crate) value: ::std::option::Option<i32>,
55}
56impl MinimumHealthyHostsBuilder {
57    /// <p>The minimum healthy instance type:</p>
58    /// <ul>
59    /// <li>
60    /// <p><code>HOST_COUNT</code>: The minimum number of healthy instances as an absolute value.</p></li>
61    /// <li>
62    /// <p><code>FLEET_PERCENT</code>: The minimum number of healthy instances as a percentage of the total number of instances in the deployment.</p></li>
63    /// </ul>
64    /// <p>In an example of nine instances, if a HOST_COUNT of six is specified, deploy to up to three instances at a time. The deployment is successful if six or more instances are deployed to successfully. Otherwise, the deployment fails. If a FLEET_PERCENT of 40 is specified, deploy to up to five instances at a time. The deployment is successful if four or more instances are deployed to successfully. Otherwise, the deployment fails.</p><note>
65    /// <p>In a call to the <code>GetDeploymentConfig</code>, CodeDeployDefault.OneAtATime returns a minimum healthy instance type of MOST_CONCURRENCY and a value of 1. This means a deployment to only one instance at a time. (You cannot set the type to MOST_CONCURRENCY, only to HOST_COUNT or FLEET_PERCENT.) In addition, with CodeDeployDefault.OneAtATime, CodeDeploy attempts to ensure that all instances but one are kept in a healthy state during the deployment. Although this allows one instance at a time to be taken offline for a new deployment, it also means that if the deployment to the last instance fails, the overall deployment is still successful.</p>
66    /// </note>
67    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/instances-health.html">CodeDeploy Instance Health</a> in the <i>CodeDeploy User Guide</i>.</p>
68    pub fn r#type(mut self, input: crate::types::MinimumHealthyHostsType) -> Self {
69        self.r#type = ::std::option::Option::Some(input);
70        self
71    }
72    /// <p>The minimum healthy instance type:</p>
73    /// <ul>
74    /// <li>
75    /// <p><code>HOST_COUNT</code>: The minimum number of healthy instances as an absolute value.</p></li>
76    /// <li>
77    /// <p><code>FLEET_PERCENT</code>: The minimum number of healthy instances as a percentage of the total number of instances in the deployment.</p></li>
78    /// </ul>
79    /// <p>In an example of nine instances, if a HOST_COUNT of six is specified, deploy to up to three instances at a time. The deployment is successful if six or more instances are deployed to successfully. Otherwise, the deployment fails. If a FLEET_PERCENT of 40 is specified, deploy to up to five instances at a time. The deployment is successful if four or more instances are deployed to successfully. Otherwise, the deployment fails.</p><note>
80    /// <p>In a call to the <code>GetDeploymentConfig</code>, CodeDeployDefault.OneAtATime returns a minimum healthy instance type of MOST_CONCURRENCY and a value of 1. This means a deployment to only one instance at a time. (You cannot set the type to MOST_CONCURRENCY, only to HOST_COUNT or FLEET_PERCENT.) In addition, with CodeDeployDefault.OneAtATime, CodeDeploy attempts to ensure that all instances but one are kept in a healthy state during the deployment. Although this allows one instance at a time to be taken offline for a new deployment, it also means that if the deployment to the last instance fails, the overall deployment is still successful.</p>
81    /// </note>
82    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/instances-health.html">CodeDeploy Instance Health</a> in the <i>CodeDeploy User Guide</i>.</p>
83    pub fn set_type(mut self, input: ::std::option::Option<crate::types::MinimumHealthyHostsType>) -> Self {
84        self.r#type = input;
85        self
86    }
87    /// <p>The minimum healthy instance type:</p>
88    /// <ul>
89    /// <li>
90    /// <p><code>HOST_COUNT</code>: The minimum number of healthy instances as an absolute value.</p></li>
91    /// <li>
92    /// <p><code>FLEET_PERCENT</code>: The minimum number of healthy instances as a percentage of the total number of instances in the deployment.</p></li>
93    /// </ul>
94    /// <p>In an example of nine instances, if a HOST_COUNT of six is specified, deploy to up to three instances at a time. The deployment is successful if six or more instances are deployed to successfully. Otherwise, the deployment fails. If a FLEET_PERCENT of 40 is specified, deploy to up to five instances at a time. The deployment is successful if four or more instances are deployed to successfully. Otherwise, the deployment fails.</p><note>
95    /// <p>In a call to the <code>GetDeploymentConfig</code>, CodeDeployDefault.OneAtATime returns a minimum healthy instance type of MOST_CONCURRENCY and a value of 1. This means a deployment to only one instance at a time. (You cannot set the type to MOST_CONCURRENCY, only to HOST_COUNT or FLEET_PERCENT.) In addition, with CodeDeployDefault.OneAtATime, CodeDeploy attempts to ensure that all instances but one are kept in a healthy state during the deployment. Although this allows one instance at a time to be taken offline for a new deployment, it also means that if the deployment to the last instance fails, the overall deployment is still successful.</p>
96    /// </note>
97    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/instances-health.html">CodeDeploy Instance Health</a> in the <i>CodeDeploy User Guide</i>.</p>
98    pub fn get_type(&self) -> &::std::option::Option<crate::types::MinimumHealthyHostsType> {
99        &self.r#type
100    }
101    /// <p>The minimum healthy instance value.</p>
102    pub fn value(mut self, input: i32) -> Self {
103        self.value = ::std::option::Option::Some(input);
104        self
105    }
106    /// <p>The minimum healthy instance value.</p>
107    pub fn set_value(mut self, input: ::std::option::Option<i32>) -> Self {
108        self.value = input;
109        self
110    }
111    /// <p>The minimum healthy instance value.</p>
112    pub fn get_value(&self) -> &::std::option::Option<i32> {
113        &self.value
114    }
115    /// Consumes the builder and constructs a [`MinimumHealthyHosts`](crate::types::MinimumHealthyHosts).
116    pub fn build(self) -> crate::types::MinimumHealthyHosts {
117        crate::types::MinimumHealthyHosts {
118            r#type: self.r#type,
119            value: self.value.unwrap_or_default(),
120        }
121    }
122}