aws_sdk_codedeploy/operation/create_deployment/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_deployment::_create_deployment_output::CreateDeploymentOutputBuilder;
3
4pub use crate::operation::create_deployment::_create_deployment_input::CreateDeploymentInputBuilder;
5
6impl crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_deployment::CreateDeploymentOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_deployment::CreateDeploymentError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_deployment();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateDeployment`.
24///
25/// <p>Deploys an application revision through the specified deployment group.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateDeploymentFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_deployment::builders::CreateDeploymentInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_deployment::CreateDeploymentOutput,
35 crate::operation::create_deployment::CreateDeploymentError,
36 > for CreateDeploymentFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::create_deployment::CreateDeploymentOutput,
44 crate::operation::create_deployment::CreateDeploymentError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateDeploymentFluentBuilder {
51 /// Creates a new `CreateDeploymentFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the CreateDeployment as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::create_deployment::CreateDeploymentOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_deployment::CreateDeploymentError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::create_deployment::CreateDeployment::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_deployment::CreateDeployment::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::create_deployment::CreateDeploymentOutput,
97 crate::operation::create_deployment::CreateDeploymentError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
112 pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.application_name(input.into());
114 self
115 }
116 /// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
117 pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_application_name(input);
119 self
120 }
121 /// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
122 pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_application_name()
124 }
125 /// <p>The name of the deployment group.</p>
126 pub fn deployment_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.deployment_group_name(input.into());
128 self
129 }
130 /// <p>The name of the deployment group.</p>
131 pub fn set_deployment_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_deployment_group_name(input);
133 self
134 }
135 /// <p>The name of the deployment group.</p>
136 pub fn get_deployment_group_name(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_deployment_group_name()
138 }
139 /// <p>The type and location of the revision to deploy.</p>
140 pub fn revision(mut self, input: crate::types::RevisionLocation) -> Self {
141 self.inner = self.inner.revision(input);
142 self
143 }
144 /// <p>The type and location of the revision to deploy.</p>
145 pub fn set_revision(mut self, input: ::std::option::Option<crate::types::RevisionLocation>) -> Self {
146 self.inner = self.inner.set_revision(input);
147 self
148 }
149 /// <p>The type and location of the revision to deploy.</p>
150 pub fn get_revision(&self) -> &::std::option::Option<crate::types::RevisionLocation> {
151 self.inner.get_revision()
152 }
153 /// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
154 /// <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>
155 pub fn deployment_config_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156 self.inner = self.inner.deployment_config_name(input.into());
157 self
158 }
159 /// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
160 /// <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>
161 pub fn set_deployment_config_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162 self.inner = self.inner.set_deployment_config_name(input);
163 self
164 }
165 /// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
166 /// <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>
167 pub fn get_deployment_config_name(&self) -> &::std::option::Option<::std::string::String> {
168 self.inner.get_deployment_config_name()
169 }
170 /// <p>A comment about the deployment.</p>
171 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.inner = self.inner.description(input.into());
173 self
174 }
175 /// <p>A comment about the deployment.</p>
176 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177 self.inner = self.inner.set_description(input);
178 self
179 }
180 /// <p>A comment about the deployment.</p>
181 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
182 self.inner.get_description()
183 }
184 /// <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>
185 /// <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>
186 /// <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>
187 /// <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>
188 pub fn ignore_application_stop_failures(mut self, input: bool) -> Self {
189 self.inner = self.inner.ignore_application_stop_failures(input);
190 self
191 }
192 /// <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>
193 /// <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>
194 /// <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>
195 /// <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>
196 pub fn set_ignore_application_stop_failures(mut self, input: ::std::option::Option<bool>) -> Self {
197 self.inner = self.inner.set_ignore_application_stop_failures(input);
198 self
199 }
200 /// <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>
201 /// <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>
202 /// <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>
203 /// <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>
204 pub fn get_ignore_application_stop_failures(&self) -> &::std::option::Option<bool> {
205 self.inner.get_ignore_application_stop_failures()
206 }
207 /// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
208 pub fn target_instances(mut self, input: crate::types::TargetInstances) -> Self {
209 self.inner = self.inner.target_instances(input);
210 self
211 }
212 /// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
213 pub fn set_target_instances(mut self, input: ::std::option::Option<crate::types::TargetInstances>) -> Self {
214 self.inner = self.inner.set_target_instances(input);
215 self
216 }
217 /// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
218 pub fn get_target_instances(&self) -> &::std::option::Option<crate::types::TargetInstances> {
219 self.inner.get_target_instances()
220 }
221 /// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
222 pub fn auto_rollback_configuration(mut self, input: crate::types::AutoRollbackConfiguration) -> Self {
223 self.inner = self.inner.auto_rollback_configuration(input);
224 self
225 }
226 /// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
227 pub fn set_auto_rollback_configuration(mut self, input: ::std::option::Option<crate::types::AutoRollbackConfiguration>) -> Self {
228 self.inner = self.inner.set_auto_rollback_configuration(input);
229 self
230 }
231 /// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
232 pub fn get_auto_rollback_configuration(&self) -> &::std::option::Option<crate::types::AutoRollbackConfiguration> {
233 self.inner.get_auto_rollback_configuration()
234 }
235 /// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
236 pub fn update_outdated_instances_only(mut self, input: bool) -> Self {
237 self.inner = self.inner.update_outdated_instances_only(input);
238 self
239 }
240 /// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
241 pub fn set_update_outdated_instances_only(mut self, input: ::std::option::Option<bool>) -> Self {
242 self.inner = self.inner.set_update_outdated_instances_only(input);
243 self
244 }
245 /// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
246 pub fn get_update_outdated_instances_only(&self) -> &::std::option::Option<bool> {
247 self.inner.get_update_outdated_instances_only()
248 }
249 /// <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>
250 /// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
251 /// <ul>
252 /// <li>
253 /// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
254 /// <li>
255 /// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
256 /// <li>
257 /// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
258 /// </ul>
259 pub fn file_exists_behavior(mut self, input: crate::types::FileExistsBehavior) -> Self {
260 self.inner = self.inner.file_exists_behavior(input);
261 self
262 }
263 /// <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>
264 /// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
265 /// <ul>
266 /// <li>
267 /// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
268 /// <li>
269 /// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
270 /// <li>
271 /// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
272 /// </ul>
273 pub fn set_file_exists_behavior(mut self, input: ::std::option::Option<crate::types::FileExistsBehavior>) -> Self {
274 self.inner = self.inner.set_file_exists_behavior(input);
275 self
276 }
277 /// <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>
278 /// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
279 /// <ul>
280 /// <li>
281 /// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
282 /// <li>
283 /// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
284 /// <li>
285 /// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
286 /// </ul>
287 pub fn get_file_exists_behavior(&self) -> &::std::option::Option<crate::types::FileExistsBehavior> {
288 self.inner.get_file_exists_behavior()
289 }
290 /// <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>
291 /// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
292 /// </note>
293 pub fn override_alarm_configuration(mut self, input: crate::types::AlarmConfiguration) -> Self {
294 self.inner = self.inner.override_alarm_configuration(input);
295 self
296 }
297 /// <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>
298 /// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
299 /// </note>
300 pub fn set_override_alarm_configuration(mut self, input: ::std::option::Option<crate::types::AlarmConfiguration>) -> Self {
301 self.inner = self.inner.set_override_alarm_configuration(input);
302 self
303 }
304 /// <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>
305 /// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
306 /// </note>
307 pub fn get_override_alarm_configuration(&self) -> &::std::option::Option<crate::types::AlarmConfiguration> {
308 self.inner.get_override_alarm_configuration()
309 }
310}