aws_sdk_codedeploy/operation/create_deployment/_create_deployment_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of a <code>CreateDeployment</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateDeploymentInput {
7 /// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
8 pub application_name: ::std::option::Option<::std::string::String>,
9 /// <p>The name of the deployment group.</p>
10 pub deployment_group_name: ::std::option::Option<::std::string::String>,
11 /// <p>The type and location of the revision to deploy.</p>
12 pub revision: ::std::option::Option<crate::types::RevisionLocation>,
13 /// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
14 /// <p>If not specified, the value configured in the deployment group is used as the default. If the deployment group does not have a deployment configuration associated with it, <code>CodeDeployDefault</code>.<code>OneAtATime</code> is used by default.</p>
15 pub deployment_config_name: ::std::option::Option<::std::string::String>,
16 /// <p>A comment about the deployment.</p>
17 pub description: ::std::option::Option<::std::string::String>,
18 /// <p>If true, then if an <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, or <code>AfterBlockTraffic</code> deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if <code>ApplicationStop</code> fails, the deployment continues with <code>DownloadBundle</code>. If <code>BeforeBlockTraffic</code> fails, the deployment continues with <code>BlockTraffic</code>. If <code>AfterBlockTraffic</code> fails, the deployment continues with <code>ApplicationStop</code>.</p>
19 /// <p>If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.</p>
20 /// <p>During a deployment, the CodeDeploy agent runs the scripts specified for <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail.</p>
21 /// <p>If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use <code>ignoreApplicationStopFailures</code> to specify that the <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> failures should be ignored.</p>
22 pub ignore_application_stop_failures: ::std::option::Option<bool>,
23 /// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
24 pub target_instances: ::std::option::Option<crate::types::TargetInstances>,
25 /// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
26 pub auto_rollback_configuration: ::std::option::Option<crate::types::AutoRollbackConfiguration>,
27 /// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
28 pub update_outdated_instances_only: ::std::option::Option<bool>,
29 /// <p>Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment.</p>
30 /// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
31 /// <ul>
32 /// <li>
33 /// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
34 /// <li>
35 /// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
36 /// <li>
37 /// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
38 /// </ul>
39 pub file_exists_behavior: ::std::option::Option<crate::types::FileExistsBehavior>,
40 /// The deployment mode to use for the deployment. When set to STANDARD (the default), the deployment runs the standard set of deployment lifecycle events. When set to RESTART, an EC2/On-premises in-place deployment runs a shortened set of lifecycle events to quickly restart the application on the target instances.
41 pub deployment_mode: ::std::option::Option<crate::types::DeploymentMode>,
42 /// <p>Allows you to specify information about alarms associated with a deployment. The alarm configuration that you specify here will override the alarm configuration at the deployment group level. Consider overriding the alarm configuration if you have set up alarms at the deployment group level that are causing deployment failures. In this case, you would call <code>CreateDeployment</code> to create a new deployment that uses a previous application revision that is known to work, and set its alarm configuration to turn off alarm polling. Turning off alarm polling ensures that the new deployment proceeds without being blocked by the alarm that was generated by the previous, failed, deployment.</p><note>
43 /// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
44 /// </note>
45 pub override_alarm_configuration: ::std::option::Option<crate::types::AlarmConfiguration>,
46}
47impl CreateDeploymentInput {
48 /// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
49 pub fn application_name(&self) -> ::std::option::Option<&str> {
50 self.application_name.as_deref()
51 }
52 /// <p>The name of the deployment group.</p>
53 pub fn deployment_group_name(&self) -> ::std::option::Option<&str> {
54 self.deployment_group_name.as_deref()
55 }
56 /// <p>The type and location of the revision to deploy.</p>
57 pub fn revision(&self) -> ::std::option::Option<&crate::types::RevisionLocation> {
58 self.revision.as_ref()
59 }
60 /// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
61 /// <p>If not specified, the value configured in the deployment group is used as the default. If the deployment group does not have a deployment configuration associated with it, <code>CodeDeployDefault</code>.<code>OneAtATime</code> is used by default.</p>
62 pub fn deployment_config_name(&self) -> ::std::option::Option<&str> {
63 self.deployment_config_name.as_deref()
64 }
65 /// <p>A comment about the deployment.</p>
66 pub fn description(&self) -> ::std::option::Option<&str> {
67 self.description.as_deref()
68 }
69 /// <p>If true, then if an <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, or <code>AfterBlockTraffic</code> deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if <code>ApplicationStop</code> fails, the deployment continues with <code>DownloadBundle</code>. If <code>BeforeBlockTraffic</code> fails, the deployment continues with <code>BlockTraffic</code>. If <code>AfterBlockTraffic</code> fails, the deployment continues with <code>ApplicationStop</code>.</p>
70 /// <p>If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.</p>
71 /// <p>During a deployment, the CodeDeploy agent runs the scripts specified for <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail.</p>
72 /// <p>If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use <code>ignoreApplicationStopFailures</code> to specify that the <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> failures should be ignored.</p>
73 pub fn ignore_application_stop_failures(&self) -> ::std::option::Option<bool> {
74 self.ignore_application_stop_failures
75 }
76 /// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
77 pub fn target_instances(&self) -> ::std::option::Option<&crate::types::TargetInstances> {
78 self.target_instances.as_ref()
79 }
80 /// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
81 pub fn auto_rollback_configuration(&self) -> ::std::option::Option<&crate::types::AutoRollbackConfiguration> {
82 self.auto_rollback_configuration.as_ref()
83 }
84 /// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
85 pub fn update_outdated_instances_only(&self) -> ::std::option::Option<bool> {
86 self.update_outdated_instances_only
87 }
88 /// <p>Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment.</p>
89 /// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
90 /// <ul>
91 /// <li>
92 /// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
93 /// <li>
94 /// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
95 /// <li>
96 /// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
97 /// </ul>
98 pub fn file_exists_behavior(&self) -> ::std::option::Option<&crate::types::FileExistsBehavior> {
99 self.file_exists_behavior.as_ref()
100 }
101 /// The deployment mode to use for the deployment. When set to STANDARD (the default), the deployment runs the standard set of deployment lifecycle events. When set to RESTART, an EC2/On-premises in-place deployment runs a shortened set of lifecycle events to quickly restart the application on the target instances.
102 pub fn deployment_mode(&self) -> ::std::option::Option<&crate::types::DeploymentMode> {
103 self.deployment_mode.as_ref()
104 }
105 /// <p>Allows you to specify information about alarms associated with a deployment. The alarm configuration that you specify here will override the alarm configuration at the deployment group level. Consider overriding the alarm configuration if you have set up alarms at the deployment group level that are causing deployment failures. In this case, you would call <code>CreateDeployment</code> to create a new deployment that uses a previous application revision that is known to work, and set its alarm configuration to turn off alarm polling. Turning off alarm polling ensures that the new deployment proceeds without being blocked by the alarm that was generated by the previous, failed, deployment.</p><note>
106 /// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
107 /// </note>
108 pub fn override_alarm_configuration(&self) -> ::std::option::Option<&crate::types::AlarmConfiguration> {
109 self.override_alarm_configuration.as_ref()
110 }
111}
112impl CreateDeploymentInput {
113 /// Creates a new builder-style object to manufacture [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
114 pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
115 crate::operation::create_deployment::builders::CreateDeploymentInputBuilder::default()
116 }
117}
118
119/// A builder for [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
120#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
121#[non_exhaustive]
122pub struct CreateDeploymentInputBuilder {
123 pub(crate) application_name: ::std::option::Option<::std::string::String>,
124 pub(crate) deployment_group_name: ::std::option::Option<::std::string::String>,
125 pub(crate) revision: ::std::option::Option<crate::types::RevisionLocation>,
126 pub(crate) deployment_config_name: ::std::option::Option<::std::string::String>,
127 pub(crate) description: ::std::option::Option<::std::string::String>,
128 pub(crate) ignore_application_stop_failures: ::std::option::Option<bool>,
129 pub(crate) target_instances: ::std::option::Option<crate::types::TargetInstances>,
130 pub(crate) auto_rollback_configuration: ::std::option::Option<crate::types::AutoRollbackConfiguration>,
131 pub(crate) update_outdated_instances_only: ::std::option::Option<bool>,
132 pub(crate) file_exists_behavior: ::std::option::Option<crate::types::FileExistsBehavior>,
133 pub(crate) deployment_mode: ::std::option::Option<crate::types::DeploymentMode>,
134 pub(crate) override_alarm_configuration: ::std::option::Option<crate::types::AlarmConfiguration>,
135}
136impl CreateDeploymentInputBuilder {
137 /// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
138 /// This field is required.
139 pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140 self.application_name = ::std::option::Option::Some(input.into());
141 self
142 }
143 /// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
144 pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145 self.application_name = input;
146 self
147 }
148 /// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
149 pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
150 &self.application_name
151 }
152 /// <p>The name of the deployment group.</p>
153 pub fn deployment_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.deployment_group_name = ::std::option::Option::Some(input.into());
155 self
156 }
157 /// <p>The name of the deployment group.</p>
158 pub fn set_deployment_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.deployment_group_name = input;
160 self
161 }
162 /// <p>The name of the deployment group.</p>
163 pub fn get_deployment_group_name(&self) -> &::std::option::Option<::std::string::String> {
164 &self.deployment_group_name
165 }
166 /// <p>The type and location of the revision to deploy.</p>
167 pub fn revision(mut self, input: crate::types::RevisionLocation) -> Self {
168 self.revision = ::std::option::Option::Some(input);
169 self
170 }
171 /// <p>The type and location of the revision to deploy.</p>
172 pub fn set_revision(mut self, input: ::std::option::Option<crate::types::RevisionLocation>) -> Self {
173 self.revision = input;
174 self
175 }
176 /// <p>The type and location of the revision to deploy.</p>
177 pub fn get_revision(&self) -> &::std::option::Option<crate::types::RevisionLocation> {
178 &self.revision
179 }
180 /// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
181 /// <p>If not specified, the value configured in the deployment group is used as the default. If the deployment group does not have a deployment configuration associated with it, <code>CodeDeployDefault</code>.<code>OneAtATime</code> is used by default.</p>
182 pub fn deployment_config_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183 self.deployment_config_name = ::std::option::Option::Some(input.into());
184 self
185 }
186 /// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
187 /// <p>If not specified, the value configured in the deployment group is used as the default. If the deployment group does not have a deployment configuration associated with it, <code>CodeDeployDefault</code>.<code>OneAtATime</code> is used by default.</p>
188 pub fn set_deployment_config_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189 self.deployment_config_name = input;
190 self
191 }
192 /// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
193 /// <p>If not specified, the value configured in the deployment group is used as the default. If the deployment group does not have a deployment configuration associated with it, <code>CodeDeployDefault</code>.<code>OneAtATime</code> is used by default.</p>
194 pub fn get_deployment_config_name(&self) -> &::std::option::Option<::std::string::String> {
195 &self.deployment_config_name
196 }
197 /// <p>A comment about the deployment.</p>
198 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199 self.description = ::std::option::Option::Some(input.into());
200 self
201 }
202 /// <p>A comment about the deployment.</p>
203 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204 self.description = input;
205 self
206 }
207 /// <p>A comment about the deployment.</p>
208 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
209 &self.description
210 }
211 /// <p>If true, then if an <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, or <code>AfterBlockTraffic</code> deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if <code>ApplicationStop</code> fails, the deployment continues with <code>DownloadBundle</code>. If <code>BeforeBlockTraffic</code> fails, the deployment continues with <code>BlockTraffic</code>. If <code>AfterBlockTraffic</code> fails, the deployment continues with <code>ApplicationStop</code>.</p>
212 /// <p>If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.</p>
213 /// <p>During a deployment, the CodeDeploy agent runs the scripts specified for <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail.</p>
214 /// <p>If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use <code>ignoreApplicationStopFailures</code> to specify that the <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> failures should be ignored.</p>
215 pub fn ignore_application_stop_failures(mut self, input: bool) -> Self {
216 self.ignore_application_stop_failures = ::std::option::Option::Some(input);
217 self
218 }
219 /// <p>If true, then if an <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, or <code>AfterBlockTraffic</code> deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if <code>ApplicationStop</code> fails, the deployment continues with <code>DownloadBundle</code>. If <code>BeforeBlockTraffic</code> fails, the deployment continues with <code>BlockTraffic</code>. If <code>AfterBlockTraffic</code> fails, the deployment continues with <code>ApplicationStop</code>.</p>
220 /// <p>If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.</p>
221 /// <p>During a deployment, the CodeDeploy agent runs the scripts specified for <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail.</p>
222 /// <p>If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use <code>ignoreApplicationStopFailures</code> to specify that the <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> failures should be ignored.</p>
223 pub fn set_ignore_application_stop_failures(mut self, input: ::std::option::Option<bool>) -> Self {
224 self.ignore_application_stop_failures = input;
225 self
226 }
227 /// <p>If true, then if an <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, or <code>AfterBlockTraffic</code> deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if <code>ApplicationStop</code> fails, the deployment continues with <code>DownloadBundle</code>. If <code>BeforeBlockTraffic</code> fails, the deployment continues with <code>BlockTraffic</code>. If <code>AfterBlockTraffic</code> fails, the deployment continues with <code>ApplicationStop</code>.</p>
228 /// <p>If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.</p>
229 /// <p>During a deployment, the CodeDeploy agent runs the scripts specified for <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail.</p>
230 /// <p>If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use <code>ignoreApplicationStopFailures</code> to specify that the <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> failures should be ignored.</p>
231 pub fn get_ignore_application_stop_failures(&self) -> &::std::option::Option<bool> {
232 &self.ignore_application_stop_failures
233 }
234 /// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
235 pub fn target_instances(mut self, input: crate::types::TargetInstances) -> Self {
236 self.target_instances = ::std::option::Option::Some(input);
237 self
238 }
239 /// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
240 pub fn set_target_instances(mut self, input: ::std::option::Option<crate::types::TargetInstances>) -> Self {
241 self.target_instances = input;
242 self
243 }
244 /// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
245 pub fn get_target_instances(&self) -> &::std::option::Option<crate::types::TargetInstances> {
246 &self.target_instances
247 }
248 /// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
249 pub fn auto_rollback_configuration(mut self, input: crate::types::AutoRollbackConfiguration) -> Self {
250 self.auto_rollback_configuration = ::std::option::Option::Some(input);
251 self
252 }
253 /// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
254 pub fn set_auto_rollback_configuration(mut self, input: ::std::option::Option<crate::types::AutoRollbackConfiguration>) -> Self {
255 self.auto_rollback_configuration = input;
256 self
257 }
258 /// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
259 pub fn get_auto_rollback_configuration(&self) -> &::std::option::Option<crate::types::AutoRollbackConfiguration> {
260 &self.auto_rollback_configuration
261 }
262 /// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
263 pub fn update_outdated_instances_only(mut self, input: bool) -> Self {
264 self.update_outdated_instances_only = ::std::option::Option::Some(input);
265 self
266 }
267 /// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
268 pub fn set_update_outdated_instances_only(mut self, input: ::std::option::Option<bool>) -> Self {
269 self.update_outdated_instances_only = input;
270 self
271 }
272 /// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
273 pub fn get_update_outdated_instances_only(&self) -> &::std::option::Option<bool> {
274 &self.update_outdated_instances_only
275 }
276 /// <p>Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment.</p>
277 /// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
278 /// <ul>
279 /// <li>
280 /// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
281 /// <li>
282 /// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
283 /// <li>
284 /// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
285 /// </ul>
286 pub fn file_exists_behavior(mut self, input: crate::types::FileExistsBehavior) -> Self {
287 self.file_exists_behavior = ::std::option::Option::Some(input);
288 self
289 }
290 /// <p>Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment.</p>
291 /// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
292 /// <ul>
293 /// <li>
294 /// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
295 /// <li>
296 /// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
297 /// <li>
298 /// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
299 /// </ul>
300 pub fn set_file_exists_behavior(mut self, input: ::std::option::Option<crate::types::FileExistsBehavior>) -> Self {
301 self.file_exists_behavior = input;
302 self
303 }
304 /// <p>Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment.</p>
305 /// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
306 /// <ul>
307 /// <li>
308 /// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
309 /// <li>
310 /// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
311 /// <li>
312 /// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
313 /// </ul>
314 pub fn get_file_exists_behavior(&self) -> &::std::option::Option<crate::types::FileExistsBehavior> {
315 &self.file_exists_behavior
316 }
317 /// The deployment mode to use for the deployment. When set to STANDARD (the default), the deployment runs the standard set of deployment lifecycle events. When set to RESTART, an EC2/On-premises in-place deployment runs a shortened set of lifecycle events to quickly restart the application on the target instances.
318 pub fn deployment_mode(mut self, input: crate::types::DeploymentMode) -> Self {
319 self.deployment_mode = ::std::option::Option::Some(input);
320 self
321 }
322 /// The deployment mode to use for the deployment. When set to STANDARD (the default), the deployment runs the standard set of deployment lifecycle events. When set to RESTART, an EC2/On-premises in-place deployment runs a shortened set of lifecycle events to quickly restart the application on the target instances.
323 pub fn set_deployment_mode(mut self, input: ::std::option::Option<crate::types::DeploymentMode>) -> Self {
324 self.deployment_mode = input;
325 self
326 }
327 /// The deployment mode to use for the deployment. When set to STANDARD (the default), the deployment runs the standard set of deployment lifecycle events. When set to RESTART, an EC2/On-premises in-place deployment runs a shortened set of lifecycle events to quickly restart the application on the target instances.
328 pub fn get_deployment_mode(&self) -> &::std::option::Option<crate::types::DeploymentMode> {
329 &self.deployment_mode
330 }
331 /// <p>Allows you to specify information about alarms associated with a deployment. The alarm configuration that you specify here will override the alarm configuration at the deployment group level. Consider overriding the alarm configuration if you have set up alarms at the deployment group level that are causing deployment failures. In this case, you would call <code>CreateDeployment</code> to create a new deployment that uses a previous application revision that is known to work, and set its alarm configuration to turn off alarm polling. Turning off alarm polling ensures that the new deployment proceeds without being blocked by the alarm that was generated by the previous, failed, deployment.</p><note>
332 /// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
333 /// </note>
334 pub fn override_alarm_configuration(mut self, input: crate::types::AlarmConfiguration) -> Self {
335 self.override_alarm_configuration = ::std::option::Option::Some(input);
336 self
337 }
338 /// <p>Allows you to specify information about alarms associated with a deployment. The alarm configuration that you specify here will override the alarm configuration at the deployment group level. Consider overriding the alarm configuration if you have set up alarms at the deployment group level that are causing deployment failures. In this case, you would call <code>CreateDeployment</code> to create a new deployment that uses a previous application revision that is known to work, and set its alarm configuration to turn off alarm polling. Turning off alarm polling ensures that the new deployment proceeds without being blocked by the alarm that was generated by the previous, failed, deployment.</p><note>
339 /// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
340 /// </note>
341 pub fn set_override_alarm_configuration(mut self, input: ::std::option::Option<crate::types::AlarmConfiguration>) -> Self {
342 self.override_alarm_configuration = input;
343 self
344 }
345 /// <p>Allows you to specify information about alarms associated with a deployment. The alarm configuration that you specify here will override the alarm configuration at the deployment group level. Consider overriding the alarm configuration if you have set up alarms at the deployment group level that are causing deployment failures. In this case, you would call <code>CreateDeployment</code> to create a new deployment that uses a previous application revision that is known to work, and set its alarm configuration to turn off alarm polling. Turning off alarm polling ensures that the new deployment proceeds without being blocked by the alarm that was generated by the previous, failed, deployment.</p><note>
346 /// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
347 /// </note>
348 pub fn get_override_alarm_configuration(&self) -> &::std::option::Option<crate::types::AlarmConfiguration> {
349 &self.override_alarm_configuration
350 }
351 /// Consumes the builder and constructs a [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
352 pub fn build(
353 self,
354 ) -> ::std::result::Result<crate::operation::create_deployment::CreateDeploymentInput, ::aws_smithy_types::error::operation::BuildError> {
355 ::std::result::Result::Ok(crate::operation::create_deployment::CreateDeploymentInput {
356 application_name: self.application_name,
357 deployment_group_name: self.deployment_group_name,
358 revision: self.revision,
359 deployment_config_name: self.deployment_config_name,
360 description: self.description,
361 ignore_application_stop_failures: self.ignore_application_stop_failures,
362 target_instances: self.target_instances,
363 auto_rollback_configuration: self.auto_rollback_configuration,
364 update_outdated_instances_only: self.update_outdated_instances_only,
365 file_exists_behavior: self.file_exists_behavior,
366 deployment_mode: self.deployment_mode,
367 override_alarm_configuration: self.override_alarm_configuration,
368 })
369 }
370}