AutoScalingClient#
Index > AutoScaling > AutoScalingClient
Auto-generated documentation for AutoScaling type annotations stubs module mypy-boto3-autoscaling.
AutoScalingClient#
Type annotations and code completion for boto3.client("autoscaling")
.
boto3 documentation
# AutoScalingClient usage example
from boto3.session import Session
from mypy_boto3_autoscaling.client import AutoScalingClient
def get_autoscaling_client() -> AutoScalingClient:
return Session().client("autoscaling")
Exceptions#
boto3
client exceptions are generated in runtime.
This class provides code completion for boto3.client("autoscaling").exceptions
structure.
# Exceptions.exceptions usage example
client = boto3.client("autoscaling")
try:
do_something(client)
except (
client.exceptions.ActiveInstanceRefreshNotFoundFault,
client.exceptions.AlreadyExistsFault,
client.exceptions.ClientError,
client.exceptions.InstanceRefreshInProgressFault,
client.exceptions.InvalidNextToken,
client.exceptions.IrreversibleInstanceRefreshFault,
client.exceptions.LimitExceededFault,
client.exceptions.ResourceContentionFault,
client.exceptions.ResourceInUseFault,
client.exceptions.ScalingActivityInProgressFault,
client.exceptions.ServiceLinkedRoleFailure,
) as e:
print(e)
# Exceptions.exceptions type checking example
from mypy_boto3_autoscaling.client import Exceptions
def handle_error(exc: Exceptions.ActiveInstanceRefreshNotFoundFault) -> None:
...
Methods#
attach_instances#
Attaches one or more EC2 instances to the specified Auto Scaling group.
Type annotations and code completion for boto3.client("autoscaling").attach_instances
method.
boto3 documentation
# attach_instances method definition
def attach_instances(
self,
*,
AutoScalingGroupName: str,
InstanceIds: Sequence[str] = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# attach_instances method usage example with argument unpacking
kwargs: AttachInstancesQueryRequestTypeDef = { # (1)
"AutoScalingGroupName": ...,
}
parent.attach_instances(**kwargs)
attach_load_balancer_target_groups#
.
Type annotations and code completion for boto3.client("autoscaling").attach_load_balancer_target_groups
method.
boto3 documentation
# attach_load_balancer_target_groups method definition
def attach_load_balancer_target_groups(
self,
*,
AutoScalingGroupName: str,
TargetGroupARNs: Sequence[str],
) -> Dict[str, Any]:
...
# attach_load_balancer_target_groups method usage example with argument unpacking
kwargs: AttachLoadBalancerTargetGroupsTypeRequestTypeDef = { # (1)
"AutoScalingGroupName": ...,
"TargetGroupARNs": ...,
}
parent.attach_load_balancer_target_groups(**kwargs)
attach_load_balancers#
.
Type annotations and code completion for boto3.client("autoscaling").attach_load_balancers
method.
boto3 documentation
# attach_load_balancers method definition
def attach_load_balancers(
self,
*,
AutoScalingGroupName: str,
LoadBalancerNames: Sequence[str],
) -> Dict[str, Any]:
...
# attach_load_balancers method usage example with argument unpacking
kwargs: AttachLoadBalancersTypeRequestTypeDef = { # (1)
"AutoScalingGroupName": ...,
"LoadBalancerNames": ...,
}
parent.attach_load_balancers(**kwargs)
attach_traffic_sources#
Attaches one or more traffic sources to the specified Auto Scaling group.
Type annotations and code completion for boto3.client("autoscaling").attach_traffic_sources
method.
boto3 documentation
# attach_traffic_sources method definition
def attach_traffic_sources(
self,
*,
AutoScalingGroupName: str,
TrafficSources: Sequence[TrafficSourceIdentifierTypeDef], # (1)
) -> Dict[str, Any]:
...
# attach_traffic_sources method usage example with argument unpacking
kwargs: AttachTrafficSourcesTypeRequestTypeDef = { # (1)
"AutoScalingGroupName": ...,
"TrafficSources": ...,
}
parent.attach_traffic_sources(**kwargs)
batch_delete_scheduled_action#
Deletes one or more scheduled actions for the specified Auto Scaling group.
Type annotations and code completion for boto3.client("autoscaling").batch_delete_scheduled_action
method.
boto3 documentation
# batch_delete_scheduled_action method definition
def batch_delete_scheduled_action(
self,
*,
AutoScalingGroupName: str,
ScheduledActionNames: Sequence[str],
) -> BatchDeleteScheduledActionAnswerTypeDef: # (1)
...
# batch_delete_scheduled_action method usage example with argument unpacking
kwargs: BatchDeleteScheduledActionTypeRequestTypeDef = { # (1)
"AutoScalingGroupName": ...,
"ScheduledActionNames": ...,
}
parent.batch_delete_scheduled_action(**kwargs)
batch_put_scheduled_update_group_action#
Creates or updates one or more scheduled scaling actions for an Auto Scaling group.
Type annotations and code completion for boto3.client("autoscaling").batch_put_scheduled_update_group_action
method.
boto3 documentation
# batch_put_scheduled_update_group_action method definition
def batch_put_scheduled_update_group_action(
self,
*,
AutoScalingGroupName: str,
ScheduledUpdateGroupActions: Sequence[ScheduledUpdateGroupActionRequestTypeDef], # (1)
) -> BatchPutScheduledUpdateGroupActionAnswerTypeDef: # (2)
...
# batch_put_scheduled_update_group_action method usage example with argument unpacking
kwargs: BatchPutScheduledUpdateGroupActionTypeRequestTypeDef = { # (1)
"AutoScalingGroupName": ...,
"ScheduledUpdateGroupActions": ...,
}
parent.batch_put_scheduled_update_group_action(**kwargs)
can_paginate#
Check if an operation can be paginated.
Type annotations and code completion for boto3.client("autoscaling").can_paginate
method.
boto3 documentation
# can_paginate method definition
def can_paginate(
self,
operation_name: str,
) -> bool:
...
cancel_instance_refresh#
Cancels an instance refresh or rollback that is in progress.
Type annotations and code completion for boto3.client("autoscaling").cancel_instance_refresh
method.
boto3 documentation
# cancel_instance_refresh method definition
def cancel_instance_refresh(
self,
*,
AutoScalingGroupName: str,
) -> CancelInstanceRefreshAnswerTypeDef: # (1)
...
# cancel_instance_refresh method usage example with argument unpacking
kwargs: CancelInstanceRefreshTypeRequestTypeDef = { # (1)
"AutoScalingGroupName": ...,
}
parent.cancel_instance_refresh(**kwargs)
close#
Closes underlying endpoint connections.
Type annotations and code completion for boto3.client("autoscaling").close
method.
boto3 documentation
# close method definition
def close(
self,
) -> None:
...
complete_lifecycle_action#
Completes the lifecycle action for the specified token or instance with the specified result.
Type annotations and code completion for boto3.client("autoscaling").complete_lifecycle_action
method.
boto3 documentation
# complete_lifecycle_action method definition
def complete_lifecycle_action(
self,
*,
LifecycleHookName: str,
AutoScalingGroupName: str,
LifecycleActionResult: str,
LifecycleActionToken: str = ...,
InstanceId: str = ...,
) -> Dict[str, Any]:
...
# complete_lifecycle_action method usage example with argument unpacking
kwargs: CompleteLifecycleActionTypeRequestTypeDef = { # (1)
"LifecycleHookName": ...,
"AutoScalingGroupName": ...,
"LifecycleActionResult": ...,
}
parent.complete_lifecycle_action(**kwargs)
create_auto_scaling_group#
We strongly recommend using a launch template when calling this operation to ensure full functionality for Amazon EC2 Auto Scaling and Amazon EC2. Creates an Auto Scaling group with the specified name and attributes.
Type annotations and code completion for boto3.client("autoscaling").create_auto_scaling_group
method.
boto3 documentation
# create_auto_scaling_group method definition
def create_auto_scaling_group(
self,
*,
AutoScalingGroupName: str,
MinSize: int,
MaxSize: int,
LaunchConfigurationName: str = ...,
LaunchTemplate: LaunchTemplateSpecificationTypeDef = ..., # (1)
MixedInstancesPolicy: MixedInstancesPolicyTypeDef = ..., # (2)
InstanceId: str = ...,
DesiredCapacity: int = ...,
DefaultCooldown: int = ...,
AvailabilityZones: Sequence[str] = ...,
LoadBalancerNames: Sequence[str] = ...,
TargetGroupARNs: Sequence[str] = ...,
HealthCheckType: str = ...,
HealthCheckGracePeriod: int = ...,
PlacementGroup: str = ...,
VPCZoneIdentifier: str = ...,
TerminationPolicies: Sequence[str] = ...,
NewInstancesProtectedFromScaleIn: bool = ...,
CapacityRebalance: bool = ...,
LifecycleHookSpecificationList: Sequence[LifecycleHookSpecificationTypeDef] = ..., # (3)
Tags: Sequence[TagTypeDef] = ..., # (4)
ServiceLinkedRoleARN: str = ...,
MaxInstanceLifetime: int = ...,
Context: str = ...,
DesiredCapacityType: str = ...,
DefaultInstanceWarmup: int = ...,
TrafficSources: Sequence[TrafficSourceIdentifierTypeDef] = ..., # (5)
InstanceMaintenancePolicy: InstanceMaintenancePolicyTypeDef = ..., # (6)
) -> EmptyResponseMetadataTypeDef: # (7)
...
- See LaunchTemplateSpecificationTypeDef
- See MixedInstancesPolicyTypeDef
- See LifecycleHookSpecificationTypeDef
- See TagTypeDef
- See TrafficSourceIdentifierTypeDef
- See InstanceMaintenancePolicyTypeDef
- See EmptyResponseMetadataTypeDef
# create_auto_scaling_group method usage example with argument unpacking
kwargs: CreateAutoScalingGroupTypeRequestTypeDef = { # (1)
"AutoScalingGroupName": ...,
"MinSize": ...,
"MaxSize": ...,
}
parent.create_auto_scaling_group(**kwargs)
create_launch_configuration#
Creates a launch configuration.
Type annotations and code completion for boto3.client("autoscaling").create_launch_configuration
method.
boto3 documentation
# create_launch_configuration method definition
def create_launch_configuration(
self,
*,
LaunchConfigurationName: str,
ImageId: str = ...,
KeyName: str = ...,
SecurityGroups: Sequence[str] = ...,
ClassicLinkVPCId: str = ...,
ClassicLinkVPCSecurityGroups: Sequence[str] = ...,
UserData: str = ...,
InstanceId: str = ...,
InstanceType: str = ...,
KernelId: str = ...,
RamdiskId: str = ...,
BlockDeviceMappings: Sequence[BlockDeviceMappingTypeDef] = ..., # (1)
InstanceMonitoring: InstanceMonitoringTypeDef = ..., # (2)
SpotPrice: str = ...,
IamInstanceProfile: str = ...,
EbsOptimized: bool = ...,
AssociatePublicIpAddress: bool = ...,
PlacementTenancy: str = ...,
MetadataOptions: InstanceMetadataOptionsTypeDef = ..., # (3)
) -> EmptyResponseMetadataTypeDef: # (4)
...
- See BlockDeviceMappingTypeDef
- See InstanceMonitoringTypeDef
- See InstanceMetadataOptionsTypeDef
- See EmptyResponseMetadataTypeDef
# create_launch_configuration method usage example with argument unpacking
kwargs: CreateLaunchConfigurationTypeRequestTypeDef = { # (1)
"LaunchConfigurationName": ...,
}
parent.create_launch_configuration(**kwargs)
create_or_update_tags#
Creates or updates tags for the specified Auto Scaling group.
Type annotations and code completion for boto3.client("autoscaling").create_or_update_tags
method.