1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The details of the Auto Scaling group for the capacity provider.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AutoScalingGroupProvider {
/// <p>The Amazon Resource Name (ARN) that identifies the Auto Scaling group, or the Auto Scaling group name.</p>
pub auto_scaling_group_arn: ::std::string::String,
/// <p>The managed scaling settings for the Auto Scaling group capacity provider.</p>
pub managed_scaling: ::std::option::Option<crate::types::ManagedScaling>,
/// <p>The managed termination protection setting to use for the Auto Scaling group capacity provider. This determines whether the Auto Scaling group has managed termination protection. The default is off.</p><important>
/// <p>When using managed termination protection, managed scaling must also be used otherwise managed termination protection doesn't work.</p>
/// </important>
/// <p>When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and each instance in the Auto Scaling group must have instance protection from scale-in actions on as well. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection">Instance Protection</a> in the <i>Auto Scaling User Guide</i>.</p>
/// <p>When managed termination protection is off, your Amazon EC2 instances aren't protected from termination when the Auto Scaling group scales in.</p>
pub managed_termination_protection: ::std::option::Option<crate::types::ManagedTerminationProtection>,
/// <p>The managed draining option for the Auto Scaling group capacity provider. When you enable this, Amazon ECS manages and gracefully drains the EC2 container instances that are in the Auto Scaling group capacity provider.</p>
pub managed_draining: ::std::option::Option<crate::types::ManagedDraining>,
}
impl AutoScalingGroupProvider {
/// <p>The Amazon Resource Name (ARN) that identifies the Auto Scaling group, or the Auto Scaling group name.</p>
pub fn auto_scaling_group_arn(&self) -> &str {
use std::ops::Deref;
self.auto_scaling_group_arn.deref()
}
/// <p>The managed scaling settings for the Auto Scaling group capacity provider.</p>
pub fn managed_scaling(&self) -> ::std::option::Option<&crate::types::ManagedScaling> {
self.managed_scaling.as_ref()
}
/// <p>The managed termination protection setting to use for the Auto Scaling group capacity provider. This determines whether the Auto Scaling group has managed termination protection. The default is off.</p><important>
/// <p>When using managed termination protection, managed scaling must also be used otherwise managed termination protection doesn't work.</p>
/// </important>
/// <p>When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and each instance in the Auto Scaling group must have instance protection from scale-in actions on as well. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection">Instance Protection</a> in the <i>Auto Scaling User Guide</i>.</p>
/// <p>When managed termination protection is off, your Amazon EC2 instances aren't protected from termination when the Auto Scaling group scales in.</p>
pub fn managed_termination_protection(&self) -> ::std::option::Option<&crate::types::ManagedTerminationProtection> {
self.managed_termination_protection.as_ref()
}
/// <p>The managed draining option for the Auto Scaling group capacity provider. When you enable this, Amazon ECS manages and gracefully drains the EC2 container instances that are in the Auto Scaling group capacity provider.</p>
pub fn managed_draining(&self) -> ::std::option::Option<&crate::types::ManagedDraining> {
self.managed_draining.as_ref()
}
}
impl AutoScalingGroupProvider {
/// Creates a new builder-style object to manufacture [`AutoScalingGroupProvider`](crate::types::AutoScalingGroupProvider).
pub fn builder() -> crate::types::builders::AutoScalingGroupProviderBuilder {
crate::types::builders::AutoScalingGroupProviderBuilder::default()
}
}
/// A builder for [`AutoScalingGroupProvider`](crate::types::AutoScalingGroupProvider).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AutoScalingGroupProviderBuilder {
pub(crate) auto_scaling_group_arn: ::std::option::Option<::std::string::String>,
pub(crate) managed_scaling: ::std::option::Option<crate::types::ManagedScaling>,
pub(crate) managed_termination_protection: ::std::option::Option<crate::types::ManagedTerminationProtection>,
pub(crate) managed_draining: ::std::option::Option<crate::types::ManagedDraining>,
}
impl AutoScalingGroupProviderBuilder {
/// <p>The Amazon Resource Name (ARN) that identifies the Auto Scaling group, or the Auto Scaling group name.</p>
/// This field is required.
pub fn auto_scaling_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.auto_scaling_group_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) that identifies the Auto Scaling group, or the Auto Scaling group name.</p>
pub fn set_auto_scaling_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.auto_scaling_group_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) that identifies the Auto Scaling group, or the Auto Scaling group name.</p>
pub fn get_auto_scaling_group_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.auto_scaling_group_arn
}
/// <p>The managed scaling settings for the Auto Scaling group capacity provider.</p>
pub fn managed_scaling(mut self, input: crate::types::ManagedScaling) -> Self {
self.managed_scaling = ::std::option::Option::Some(input);
self
}
/// <p>The managed scaling settings for the Auto Scaling group capacity provider.</p>
pub fn set_managed_scaling(mut self, input: ::std::option::Option<crate::types::ManagedScaling>) -> Self {
self.managed_scaling = input;
self
}
/// <p>The managed scaling settings for the Auto Scaling group capacity provider.</p>
pub fn get_managed_scaling(&self) -> &::std::option::Option<crate::types::ManagedScaling> {
&self.managed_scaling
}
/// <p>The managed termination protection setting to use for the Auto Scaling group capacity provider. This determines whether the Auto Scaling group has managed termination protection. The default is off.</p><important>
/// <p>When using managed termination protection, managed scaling must also be used otherwise managed termination protection doesn't work.</p>
/// </important>
/// <p>When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and each instance in the Auto Scaling group must have instance protection from scale-in actions on as well. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection">Instance Protection</a> in the <i>Auto Scaling User Guide</i>.</p>
/// <p>When managed termination protection is off, your Amazon EC2 instances aren't protected from termination when the Auto Scaling group scales in.</p>
pub fn managed_termination_protection(mut self, input: crate::types::ManagedTerminationProtection) -> Self {
self.managed_termination_protection = ::std::option::Option::Some(input);
self
}
/// <p>The managed termination protection setting to use for the Auto Scaling group capacity provider. This determines whether the Auto Scaling group has managed termination protection. The default is off.</p><important>
/// <p>When using managed termination protection, managed scaling must also be used otherwise managed termination protection doesn't work.</p>
/// </important>
/// <p>When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and each instance in the Auto Scaling group must have instance protection from scale-in actions on as well. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection">Instance Protection</a> in the <i>Auto Scaling User Guide</i>.</p>
/// <p>When managed termination protection is off, your Amazon EC2 instances aren't protected from termination when the Auto Scaling group scales in.</p>
pub fn set_managed_termination_protection(mut self, input: ::std::option::Option<crate::types::ManagedTerminationProtection>) -> Self {
self.managed_termination_protection = input;
self
}
/// <p>The managed termination protection setting to use for the Auto Scaling group capacity provider. This determines whether the Auto Scaling group has managed termination protection. The default is off.</p><important>
/// <p>When using managed termination protection, managed scaling must also be used otherwise managed termination protection doesn't work.</p>
/// </important>
/// <p>When managed termination protection is on, Amazon ECS prevents the Amazon EC2 instances in an Auto Scaling group that contain tasks from being terminated during a scale-in action. The Auto Scaling group and each instance in the Auto Scaling group must have instance protection from scale-in actions on as well. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection">Instance Protection</a> in the <i>Auto Scaling User Guide</i>.</p>
/// <p>When managed termination protection is off, your Amazon EC2 instances aren't protected from termination when the Auto Scaling group scales in.</p>
pub fn get_managed_termination_protection(&self) -> &::std::option::Option<crate::types::ManagedTerminationProtection> {
&self.managed_termination_protection
}
/// <p>The managed draining option for the Auto Scaling group capacity provider. When you enable this, Amazon ECS manages and gracefully drains the EC2 container instances that are in the Auto Scaling group capacity provider.</p>
pub fn managed_draining(mut self, input: crate::types::ManagedDraining) -> Self {
self.managed_draining = ::std::option::Option::Some(input);
self
}
/// <p>The managed draining option for the Auto Scaling group capacity provider. When you enable this, Amazon ECS manages and gracefully drains the EC2 container instances that are in the Auto Scaling group capacity provider.</p>
pub fn set_managed_draining(mut self, input: ::std::option::Option<crate::types::ManagedDraining>) -> Self {
self.managed_draining = input;
self
}
/// <p>The managed draining option for the Auto Scaling group capacity provider. When you enable this, Amazon ECS manages and gracefully drains the EC2 container instances that are in the Auto Scaling group capacity provider.</p>
pub fn get_managed_draining(&self) -> &::std::option::Option<crate::types::ManagedDraining> {
&self.managed_draining
}
/// Consumes the builder and constructs a [`AutoScalingGroupProvider`](crate::types::AutoScalingGroupProvider).
/// This method will fail if any of the following fields are not set:
/// - [`auto_scaling_group_arn`](crate::types::builders::AutoScalingGroupProviderBuilder::auto_scaling_group_arn)
pub fn build(self) -> ::std::result::Result<crate::types::AutoScalingGroupProvider, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::AutoScalingGroupProvider {
auto_scaling_group_arn: self.auto_scaling_group_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"auto_scaling_group_arn",
"auto_scaling_group_arn was not specified but it is required when building AutoScalingGroupProvider",
)
})?,
managed_scaling: self.managed_scaling,
managed_termination_protection: self.managed_termination_protection,
managed_draining: self.managed_draining,
})
}
}