pub struct Client { /* private fields */ }
Expand description

Client for Auto Scaling

Client for invoking operations on Auto Scaling. Each operation on Auto Scaling is a method on this this struct. .send() MUST be invoked on the generated operations to dispatch the request to the service.

Constructing a Client

A Config is required to construct a client. For most use cases, the aws-config crate should be used to automatically resolve this config using aws_config::load_from_env(), since this will resolve an SdkConfig which can be shared across multiple different AWS SDK clients. This config resolution process can be customized by calling aws_config::from_env() instead, which returns a ConfigLoader that uses the builder pattern to customize the default config.

In the simplest case, creating a client looks as follows:

let config = aws_config::load_from_env().await;
let client = aws_sdk_autoscaling::Client::new(&config);

Occasionally, SDKs may have additional service-specific that can be set on the Config that is absent from SdkConfig, or slightly different settings for a specific client may be desired. The Config struct implements From<&SdkConfig>, so setting these specific settings can be done as follows:

let sdk_config = aws_config::load_from_env().await;
let config = aws_sdk_autoscaling::config::Builder::from(&sdk_config)
    .some_service_specific_setting("value")
    .build();

See the aws-config docs and Config for more information on customizing configuration.

Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.

Using the Client

A client has a function for every operation that can be performed by the service. For example, the AttachInstances operation has a Client::attach_instances, function which returns a builder for that operation. The fluent builder ultimately has a send() function that returns an async future that returns a result, as illustrated below:

let result = client.attach_instances()
    .auto_scaling_group_name("example")
    .send()
    .await;

The underlying HTTP requests that get made by this can be modified with the customize_operation function on the fluent builder. See the customize module for more information.

Implementations§

source§

impl Client

source

pub fn attach_instances(&self) -> AttachInstancesFluentBuilder

Constructs a fluent builder for the AttachInstances operation.

source§

impl Client

source

pub fn attach_load_balancer_target_groups( &self ) -> AttachLoadBalancerTargetGroupsFluentBuilder

Constructs a fluent builder for the AttachLoadBalancerTargetGroups operation.

source§

impl Client

source

pub fn attach_load_balancers(&self) -> AttachLoadBalancersFluentBuilder

Constructs a fluent builder for the AttachLoadBalancers operation.

source§

impl Client

source

pub fn attach_traffic_sources(&self) -> AttachTrafficSourcesFluentBuilder

Constructs a fluent builder for the AttachTrafficSources operation.

source§

impl Client

source

pub fn batch_delete_scheduled_action( &self ) -> BatchDeleteScheduledActionFluentBuilder

Constructs a fluent builder for the BatchDeleteScheduledAction operation.

source§

impl Client

source

pub fn batch_put_scheduled_update_group_action( &self ) -> BatchPutScheduledUpdateGroupActionFluentBuilder

Constructs a fluent builder for the BatchPutScheduledUpdateGroupAction operation.

source§

impl Client

source

pub fn cancel_instance_refresh(&self) -> CancelInstanceRefreshFluentBuilder

Constructs a fluent builder for the CancelInstanceRefresh operation.

source§

impl Client

source

pub fn complete_lifecycle_action(&self) -> CompleteLifecycleActionFluentBuilder

Constructs a fluent builder for the CompleteLifecycleAction operation.

source§

impl Client

source

pub fn create_auto_scaling_group(&self) -> CreateAutoScalingGroupFluentBuilder

Constructs a fluent builder for the CreateAutoScalingGroup operation.

source§

impl Client

source

pub fn create_launch_configuration( &self ) -> CreateLaunchConfigurationFluentBuilder

Constructs a fluent builder for the CreateLaunchConfiguration operation.

source§

impl Client

source

pub fn create_or_update_tags(&self) -> CreateOrUpdateTagsFluentBuilder

Constructs a fluent builder for the CreateOrUpdateTags operation.

source§

impl Client

source

pub fn delete_auto_scaling_group(&self) -> DeleteAutoScalingGroupFluentBuilder

Constructs a fluent builder for the DeleteAutoScalingGroup operation.

source§

impl Client

source

pub fn delete_launch_configuration( &self ) -> DeleteLaunchConfigurationFluentBuilder

Constructs a fluent builder for the DeleteLaunchConfiguration operation.

source§

impl Client

source

pub fn delete_lifecycle_hook(&self) -> DeleteLifecycleHookFluentBuilder

Constructs a fluent builder for the DeleteLifecycleHook operation.

source§

impl Client

source

pub fn delete_notification_configuration( &self ) -> DeleteNotificationConfigurationFluentBuilder

Constructs a fluent builder for the DeleteNotificationConfiguration operation.

source§

impl Client

source

pub fn delete_policy(&self) -> DeletePolicyFluentBuilder

Constructs a fluent builder for the DeletePolicy operation.

source§

impl Client

source

pub fn delete_scheduled_action(&self) -> DeleteScheduledActionFluentBuilder

Constructs a fluent builder for the DeleteScheduledAction operation.

source§

impl Client

source

pub fn delete_tags(&self) -> DeleteTagsFluentBuilder

Constructs a fluent builder for the DeleteTags operation.

source§

impl Client

source

pub fn delete_warm_pool(&self) -> DeleteWarmPoolFluentBuilder

Constructs a fluent builder for the DeleteWarmPool operation.

source§

impl Client

source

pub fn describe_account_limits(&self) -> DescribeAccountLimitsFluentBuilder

Constructs a fluent builder for the DescribeAccountLimits operation.

source§

impl Client

source

pub fn describe_adjustment_types(&self) -> DescribeAdjustmentTypesFluentBuilder

Constructs a fluent builder for the DescribeAdjustmentTypes operation.

source§

impl Client

source

pub fn describe_auto_scaling_groups( &self ) -> DescribeAutoScalingGroupsFluentBuilder

Constructs a fluent builder for the DescribeAutoScalingGroups operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn describe_auto_scaling_instances( &self ) -> DescribeAutoScalingInstancesFluentBuilder

Constructs a fluent builder for the DescribeAutoScalingInstances operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn describe_auto_scaling_notification_types( &self ) -> DescribeAutoScalingNotificationTypesFluentBuilder

Constructs a fluent builder for the DescribeAutoScalingNotificationTypes operation.

source§

impl Client

source

pub fn describe_instance_refreshes( &self ) -> DescribeInstanceRefreshesFluentBuilder

Constructs a fluent builder for the DescribeInstanceRefreshes operation.

source§

impl Client

source

pub fn describe_launch_configurations( &self ) -> DescribeLaunchConfigurationsFluentBuilder

Constructs a fluent builder for the DescribeLaunchConfigurations operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn describe_lifecycle_hook_types( &self ) -> DescribeLifecycleHookTypesFluentBuilder

Constructs a fluent builder for the DescribeLifecycleHookTypes operation.

source§

impl Client

source

pub fn describe_lifecycle_hooks(&self) -> DescribeLifecycleHooksFluentBuilder

Constructs a fluent builder for the DescribeLifecycleHooks operation.

source§

impl Client

source

pub fn describe_load_balancer_target_groups( &self ) -> DescribeLoadBalancerTargetGroupsFluentBuilder

Constructs a fluent builder for the DescribeLoadBalancerTargetGroups operation.

source§

impl Client

source

pub fn describe_load_balancers(&self) -> DescribeLoadBalancersFluentBuilder

Constructs a fluent builder for the DescribeLoadBalancers operation.

source§

impl Client

source

pub fn describe_metric_collection_types( &self ) -> DescribeMetricCollectionTypesFluentBuilder

Constructs a fluent builder for the DescribeMetricCollectionTypes operation.

source§

impl Client

source

pub fn describe_notification_configurations( &self ) -> DescribeNotificationConfigurationsFluentBuilder

Constructs a fluent builder for the DescribeNotificationConfigurations operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn describe_policies(&self) -> DescribePoliciesFluentBuilder

Constructs a fluent builder for the DescribePolicies operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn describe_scaling_activities( &self ) -> DescribeScalingActivitiesFluentBuilder

Constructs a fluent builder for the DescribeScalingActivities operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn describe_scaling_process_types( &self ) -> DescribeScalingProcessTypesFluentBuilder

Constructs a fluent builder for the DescribeScalingProcessTypes operation.

source§

impl Client

source

pub fn describe_scheduled_actions( &self ) -> DescribeScheduledActionsFluentBuilder

Constructs a fluent builder for the DescribeScheduledActions operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn describe_tags(&self) -> DescribeTagsFluentBuilder

Constructs a fluent builder for the DescribeTags operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn describe_termination_policy_types( &self ) -> DescribeTerminationPolicyTypesFluentBuilder

Constructs a fluent builder for the DescribeTerminationPolicyTypes operation.

source§

impl Client

source

pub fn describe_traffic_sources(&self) -> DescribeTrafficSourcesFluentBuilder

Constructs a fluent builder for the DescribeTrafficSources operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn describe_warm_pool(&self) -> DescribeWarmPoolFluentBuilder

Constructs a fluent builder for the DescribeWarmPool operation.

source§

impl Client

source

pub fn detach_instances(&self) -> DetachInstancesFluentBuilder

Constructs a fluent builder for the DetachInstances operation.

source§

impl Client

source

pub fn detach_load_balancer_target_groups( &self ) -> DetachLoadBalancerTargetGroupsFluentBuilder

Constructs a fluent builder for the DetachLoadBalancerTargetGroups operation.

source§

impl Client

source

pub fn detach_load_balancers(&self) -> DetachLoadBalancersFluentBuilder

Constructs a fluent builder for the DetachLoadBalancers operation.

source§

impl Client

source

pub fn detach_traffic_sources(&self) -> DetachTrafficSourcesFluentBuilder

Constructs a fluent builder for the DetachTrafficSources operation.

source§

impl Client

source

pub fn disable_metrics_collection( &self ) -> DisableMetricsCollectionFluentBuilder

Constructs a fluent builder for the DisableMetricsCollection operation.

source§

impl Client

source

pub fn enable_metrics_collection(&self) -> EnableMetricsCollectionFluentBuilder

Constructs a fluent builder for the EnableMetricsCollection operation.

source§

impl Client

source

pub fn enter_standby(&self) -> EnterStandbyFluentBuilder

Constructs a fluent builder for the EnterStandby operation.

source§

impl Client

source

pub fn execute_policy(&self) -> ExecutePolicyFluentBuilder

Constructs a fluent builder for the ExecutePolicy operation.

source§

impl Client

source

pub fn exit_standby(&self) -> ExitStandbyFluentBuilder

Constructs a fluent builder for the ExitStandby operation.

source§

impl Client

source

pub fn get_predictive_scaling_forecast( &self ) -> GetPredictiveScalingForecastFluentBuilder

Constructs a fluent builder for the GetPredictiveScalingForecast operation.

source§

impl Client

source

pub fn put_lifecycle_hook(&self) -> PutLifecycleHookFluentBuilder

Constructs a fluent builder for the PutLifecycleHook operation.

source§

impl Client

source

pub fn put_notification_configuration( &self ) -> PutNotificationConfigurationFluentBuilder

Constructs a fluent builder for the PutNotificationConfiguration operation.

source§

impl Client

source

pub fn put_scaling_policy(&self) -> PutScalingPolicyFluentBuilder

Constructs a fluent builder for the PutScalingPolicy operation.

source§

impl Client

source

pub fn put_scheduled_update_group_action( &self ) -> PutScheduledUpdateGroupActionFluentBuilder

Constructs a fluent builder for the PutScheduledUpdateGroupAction operation.

source§

impl Client

source

pub fn put_warm_pool(&self) -> PutWarmPoolFluentBuilder

Constructs a fluent builder for the PutWarmPool operation.

  • The fluent builder is configurable:
    • auto_scaling_group_name(impl Into<String>) / set_auto_scaling_group_name(Option<String>):

      The name of the Auto Scaling group.

    • max_group_prepared_capacity(i32) / set_max_group_prepared_capacity(Option<i32>):

      Specifies the maximum number of instances that are allowed to be in the warm pool or in any state except Terminated for the Auto Scaling group. This is an optional property. Specify it only if you do not want the warm pool size to be determined by the difference between the group’s maximum capacity and its desired capacity.

      If a value for MaxGroupPreparedCapacity is not specified, Amazon EC2 Auto Scaling launches and maintains the difference between the group’s maximum capacity and its desired capacity. If you specify a value for MaxGroupPreparedCapacity, Amazon EC2 Auto Scaling uses the difference between the MaxGroupPreparedCapacity and the desired capacity instead.

      The size of the warm pool is dynamic. Only when MaxGroupPreparedCapacity and MinSize are set to the same value does the warm pool have an absolute size.

      If the desired capacity of the Auto Scaling group is higher than the MaxGroupPreparedCapacity, the capacity of the warm pool is 0, unless you specify a value for MinSize. To remove a value that you previously set, include the property but specify -1 for the value.

    • min_size(i32) / set_min_size(Option<i32>):

      Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.

    • pool_state(WarmPoolState) / set_pool_state(Option<WarmPoolState>):

      Sets the instance state to transition to after the lifecycle actions are complete. Default is Stopped.

    • instance_reuse_policy(InstanceReusePolicy) / set_instance_reuse_policy(Option<InstanceReusePolicy>):

      Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in. The default is to terminate instances in the Auto Scaling group when the group scales in.

  • On success, responds with PutWarmPoolOutput
  • On failure, responds with SdkError<PutWarmPoolError>
source§

impl Client

source

pub fn record_lifecycle_action_heartbeat( &self ) -> RecordLifecycleActionHeartbeatFluentBuilder

Constructs a fluent builder for the RecordLifecycleActionHeartbeat operation.

source§

impl Client

source

pub fn resume_processes(&self) -> ResumeProcessesFluentBuilder

Constructs a fluent builder for the ResumeProcesses operation.

source§

impl Client

source

pub fn rollback_instance_refresh(&self) -> RollbackInstanceRefreshFluentBuilder

Constructs a fluent builder for the RollbackInstanceRefresh operation.

source§

impl Client

source

pub fn set_desired_capacity(&self) -> SetDesiredCapacityFluentBuilder

Constructs a fluent builder for the SetDesiredCapacity operation.

source§

impl Client

source

pub fn set_instance_health(&self) -> SetInstanceHealthFluentBuilder

Constructs a fluent builder for the SetInstanceHealth operation.

source§

impl Client

source

pub fn set_instance_protection(&self) -> SetInstanceProtectionFluentBuilder

Constructs a fluent builder for the SetInstanceProtection operation.

source§

impl Client

source

pub fn start_instance_refresh(&self) -> StartInstanceRefreshFluentBuilder

Constructs a fluent builder for the StartInstanceRefresh operation.

source§

impl Client

source

pub fn suspend_processes(&self) -> SuspendProcessesFluentBuilder

Constructs a fluent builder for the SuspendProcesses operation.

source§

impl Client

source

pub fn terminate_instance_in_auto_scaling_group( &self ) -> TerminateInstanceInAutoScalingGroupFluentBuilder

Constructs a fluent builder for the TerminateInstanceInAutoScalingGroup operation.

source§

impl Client

source

pub fn update_auto_scaling_group(&self) -> UpdateAutoScalingGroupFluentBuilder

Constructs a fluent builder for the UpdateAutoScalingGroup operation.

source§

impl Client

source

pub fn with_config( client: Client<DynConnector, DynMiddleware<DynConnector>>, conf: Config ) -> Self

Creates a client with the given service configuration.

source

pub fn conf(&self) -> &Config

Returns the client’s configuration.

source§

impl Client

source

pub fn new(sdk_config: &SdkConfig) -> Self

Creates a new client from an SDK Config.

Panics
  • This method will panic if the sdk_config is missing an async sleep implementation. If you experience this panic, set the sleep_impl on the Config passed into this function to fix it.
  • This method will panic if the sdk_config is missing an HTTP connector. If you experience this panic, set the http_connector on the Config passed into this function to fix it.
source

pub fn from_conf(conf: Config) -> Self

Creates a new client from the service Config.

Panics
  • This method will panic if the conf is missing an async sleep implementation. If you experience this panic, set the sleep_impl on the Config passed into this function to fix it.
  • This method will panic if the conf is missing an HTTP connector. If you experience this panic, set the http_connector on the Config passed into this function to fix it.

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Client

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Client<DynConnector, DynMiddleware<DynConnector>, Standard>> for Client

source§

fn from(client: Client<DynConnector, DynMiddleware<DynConnector>>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more