// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_deployment::_create_deployment_input::CreateDeploymentInputBuilder;
pub use crate::operation::create_deployment::_create_deployment_output::CreateDeploymentOutputBuilder;
impl crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::create_deployment::CreateDeploymentOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_deployment::CreateDeploymentError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.create_deployment();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `CreateDeployment`.
///
/// <p>Deploys an application revision through the specified deployment group.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateDeploymentFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_deployment::builders::CreateDeploymentInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::create_deployment::CreateDeploymentOutput,
crate::operation::create_deployment::CreateDeploymentError,
> for CreateDeploymentFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::create_deployment::CreateDeploymentOutput,
crate::operation::create_deployment::CreateDeploymentError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl CreateDeploymentFluentBuilder {
/// Creates a new `CreateDeploymentFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the CreateDeployment as a reference.
pub fn as_input(&self) -> &crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::create_deployment::CreateDeploymentOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_deployment::CreateDeploymentError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::create_deployment::CreateDeployment::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::create_deployment::CreateDeployment::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::create_deployment::CreateDeploymentOutput,
crate::operation::create_deployment::CreateDeploymentError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.application_name(input.into());
self
}
/// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_application_name(input);
self
}
/// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_application_name()
}
/// <p>The name of the deployment group.</p>
pub fn deployment_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.deployment_group_name(input.into());
self
}
/// <p>The name of the deployment group.</p>
pub fn set_deployment_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_deployment_group_name(input);
self
}
/// <p>The name of the deployment group.</p>
pub fn get_deployment_group_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_deployment_group_name()
}
/// <p>The type and location of the revision to deploy.</p>
pub fn revision(mut self, input: crate::types::RevisionLocation) -> Self {
self.inner = self.inner.revision(input);
self
}
/// <p>The type and location of the revision to deploy.</p>
pub fn set_revision(mut self, input: ::std::option::Option<crate::types::RevisionLocation>) -> Self {
self.inner = self.inner.set_revision(input);
self
}
/// <p>The type and location of the revision to deploy.</p>
pub fn get_revision(&self) -> &::std::option::Option<crate::types::RevisionLocation> {
self.inner.get_revision()
}
/// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
/// <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>
pub fn deployment_config_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.deployment_config_name(input.into());
self
}
/// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
/// <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>
pub fn set_deployment_config_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_deployment_config_name(input);
self
}
/// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
/// <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>
pub fn get_deployment_config_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_deployment_config_name()
}
/// <p>A comment about the deployment.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.description(input.into());
self
}
/// <p>A comment about the deployment.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_description(input);
self
}
/// <p>A comment about the deployment.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_description()
}
/// <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>
/// <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>
/// <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>
/// <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>
pub fn ignore_application_stop_failures(mut self, input: bool) -> Self {
self.inner = self.inner.ignore_application_stop_failures(input);
self
}
/// <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>
/// <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>
/// <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>
/// <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>
pub fn set_ignore_application_stop_failures(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_ignore_application_stop_failures(input);
self
}
/// <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>
/// <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>
/// <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>
/// <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>
pub fn get_ignore_application_stop_failures(&self) -> &::std::option::Option<bool> {
self.inner.get_ignore_application_stop_failures()
}
/// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
pub fn target_instances(mut self, input: crate::types::TargetInstances) -> Self {
self.inner = self.inner.target_instances(input);
self
}
/// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
pub fn set_target_instances(mut self, input: ::std::option::Option<crate::types::TargetInstances>) -> Self {
self.inner = self.inner.set_target_instances(input);
self
}
/// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
pub fn get_target_instances(&self) -> &::std::option::Option<crate::types::TargetInstances> {
self.inner.get_target_instances()
}
/// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
pub fn auto_rollback_configuration(mut self, input: crate::types::AutoRollbackConfiguration) -> Self {
self.inner = self.inner.auto_rollback_configuration(input);
self
}
/// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
pub fn set_auto_rollback_configuration(mut self, input: ::std::option::Option<crate::types::AutoRollbackConfiguration>) -> Self {
self.inner = self.inner.set_auto_rollback_configuration(input);
self
}
/// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
pub fn get_auto_rollback_configuration(&self) -> &::std::option::Option<crate::types::AutoRollbackConfiguration> {
self.inner.get_auto_rollback_configuration()
}
/// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
pub fn update_outdated_instances_only(mut self, input: bool) -> Self {
self.inner = self.inner.update_outdated_instances_only(input);
self
}
/// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
pub fn set_update_outdated_instances_only(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_update_outdated_instances_only(input);
self
}
/// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
pub fn get_update_outdated_instances_only(&self) -> &::std::option::Option<bool> {
self.inner.get_update_outdated_instances_only()
}
/// <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>
/// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
/// <ul>
/// <li>
/// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
/// <li>
/// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
/// <li>
/// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
/// </ul>
pub fn file_exists_behavior(mut self, input: crate::types::FileExistsBehavior) -> Self {
self.inner = self.inner.file_exists_behavior(input);
self
}
/// <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>
/// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
/// <ul>
/// <li>
/// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
/// <li>
/// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
/// <li>
/// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
/// </ul>
pub fn set_file_exists_behavior(mut self, input: ::std::option::Option<crate::types::FileExistsBehavior>) -> Self {
self.inner = self.inner.set_file_exists_behavior(input);
self
}
/// <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>
/// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
/// <ul>
/// <li>
/// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
/// <li>
/// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
/// <li>
/// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
/// </ul>
pub fn get_file_exists_behavior(&self) -> &::std::option::Option<crate::types::FileExistsBehavior> {
self.inner.get_file_exists_behavior()
}
/// <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>
/// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
/// </note>
pub fn override_alarm_configuration(mut self, input: crate::types::AlarmConfiguration) -> Self {
self.inner = self.inner.override_alarm_configuration(input);
self
}
/// <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>
/// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
/// </note>
pub fn set_override_alarm_configuration(mut self, input: ::std::option::Option<crate::types::AlarmConfiguration>) -> Self {
self.inner = self.inner.set_override_alarm_configuration(input);
self
}
/// <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>
/// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
/// </note>
pub fn get_override_alarm_configuration(&self) -> &::std::option::Option<crate::types::AlarmConfiguration> {
self.inner.get_override_alarm_configuration()
}
}