AutoScaling class

Amazon EC2 Auto Scaling is designed to automatically launch or terminate EC2 instances based on user-defined scaling policies, scheduled actions, and health checks. Use this service with AWS Auto Scaling, Amazon CloudWatch, and Elastic Load Balancing.

Constructors

AutoScaling({required String region, AwsClientCredentials? credentials, AwsClientCredentialsProvider? credentialsProvider, Client? client, String? endpointUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shapes Map<String, Shape>
final

Methods

attachInstances({required String autoScalingGroupName, List<String>? instanceIds}) Future<void>
Attaches one or more EC2 instances to the specified Auto Scaling group.
attachLoadBalancers({required String autoScalingGroupName, required List<String> loadBalancerNames}) Future<void>
To describe the load balancers for an Auto Scaling group, call the DescribeLoadBalancers API. To detach the load balancer from the Auto Scaling group, call the DetachLoadBalancers API.
attachLoadBalancerTargetGroups({required String autoScalingGroupName, required List<String> targetGroupARNs}) Future<void>
Attaches one or more target groups to the specified Auto Scaling group.
batchDeleteScheduledAction({required String autoScalingGroupName, required List<String> scheduledActionNames}) Future<BatchDeleteScheduledActionAnswer>
Deletes one or more scheduled actions for the specified Auto Scaling group.
batchPutScheduledUpdateGroupAction({required String autoScalingGroupName, required List<ScheduledUpdateGroupActionRequest> scheduledUpdateGroupActions}) Future<BatchPutScheduledUpdateGroupActionAnswer>
Creates or updates one or more scheduled scaling actions for an Auto Scaling group. If you leave a parameter unspecified when updating a scheduled scaling action, the corresponding value remains unchanged.
cancelInstanceRefresh({required String autoScalingGroupName}) Future<CancelInstanceRefreshAnswer>
Cancels an instance refresh operation in progress. Cancellation does not roll back any replacements that have already been completed, but it prevents new replacements from being started.
close() → void
Closes the internal HTTP client if none was provided at creation. If a client was passed as a constructor argument, this becomes a noop.
completeLifecycleAction({required String autoScalingGroupName, required String lifecycleActionResult, required String lifecycleHookName, String? instanceId, String? lifecycleActionToken}) Future<void>
Completes the lifecycle action for the specified token or instance with the specified result.
createAutoScalingGroup({required String autoScalingGroupName, required int maxSize, required int minSize, List<String>? availabilityZones, bool? capacityRebalance, int? defaultCooldown, int? desiredCapacity, int? healthCheckGracePeriod, String? healthCheckType, String? instanceId, String? launchConfigurationName, LaunchTemplateSpecification? launchTemplate, List<LifecycleHookSpecification>? lifecycleHookSpecificationList, List<String>? loadBalancerNames, int? maxInstanceLifetime, MixedInstancesPolicy? mixedInstancesPolicy, bool? newInstancesProtectedFromScaleIn, String? placementGroup, String? serviceLinkedRoleARN, List<Tag>? tags, List<String>? targetGroupARNs, List<String>? terminationPolicies, String? vPCZoneIdentifier}) Future<void>
Creates an Auto Scaling group with the specified name and attributes.
createLaunchConfiguration({required String launchConfigurationName, bool? associatePublicIpAddress, List<BlockDeviceMapping>? blockDeviceMappings, String? classicLinkVPCId, List<String>? classicLinkVPCSecurityGroups, bool? ebsOptimized, String? iamInstanceProfile, String? imageId, String? instanceId, InstanceMonitoring? instanceMonitoring, String? instanceType, String? kernelId, String? keyName, InstanceMetadataOptions? metadataOptions, String? placementTenancy, String? ramdiskId, List<String>? securityGroups, String? spotPrice, String? userData}) Future<void>
Creates a launch configuration.
createOrUpdateTags({required List<Tag> tags}) Future<void>
Creates or updates tags for the specified Auto Scaling group.
deleteAutoScalingGroup({required String autoScalingGroupName, bool? forceDelete}) Future<void>
Deletes the specified Auto Scaling group.
deleteLaunchConfiguration({required String launchConfigurationName}) Future<void>
Deletes the specified launch configuration.
deleteLifecycleHook({required String autoScalingGroupName, required String lifecycleHookName}) Future<void>
Deletes the specified lifecycle hook.
deleteNotificationConfiguration({required String autoScalingGroupName, required String topicARN}) Future<void>
Deletes the specified notification.
deletePolicy({required String policyName, String? autoScalingGroupName}) Future<void>
Deletes the specified scaling policy.
deleteScheduledAction({required String autoScalingGroupName, required String scheduledActionName}) Future<void>
Deletes the specified scheduled action.
deleteTags({required List<Tag> tags}) Future<void>
Deletes the specified tags.
describeAccountLimits() Future<DescribeAccountLimitsAnswer>
Describes the current Amazon EC2 Auto Scaling resource quotas for your AWS account.
describeAdjustmentTypes() Future<DescribeAdjustmentTypesAnswer>
Describes the available adjustment types for Amazon EC2 Auto Scaling scaling policies. These settings apply to step scaling policies and simple scaling policies; they do not apply to target tracking scaling policies.
describeAutoScalingGroups({List<String>? autoScalingGroupNames, int? maxRecords, String? nextToken}) Future<AutoScalingGroupsType>
Describes one or more Auto Scaling groups.
describeAutoScalingInstances({List<String>? instanceIds, int? maxRecords, String? nextToken}) Future<AutoScalingInstancesType>
Describes one or more Auto Scaling instances.
describeAutoScalingNotificationTypes() Future<DescribeAutoScalingNotificationTypesAnswer>
Describes the notification types that are supported by Amazon EC2 Auto Scaling.
describeInstanceRefreshes({required String autoScalingGroupName, List<String>? instanceRefreshIds, int? maxRecords, String? nextToken}) Future<DescribeInstanceRefreshesAnswer>
Describes one or more instance refreshes.
describeLaunchConfigurations({List<String>? launchConfigurationNames, int? maxRecords, String? nextToken}) Future<LaunchConfigurationsType>
Describes one or more launch configurations.
describeLifecycleHooks({required String autoScalingGroupName, List<String>? lifecycleHookNames}) Future<DescribeLifecycleHooksAnswer>
Describes the lifecycle hooks for the specified Auto Scaling group.
describeLifecycleHookTypes() Future<DescribeLifecycleHookTypesAnswer>
Describes the available types of lifecycle hooks.
describeLoadBalancers({required String autoScalingGroupName, int? maxRecords, String? nextToken}) Future<DescribeLoadBalancersResponse>
Describes the load balancers for the specified Auto Scaling group.
describeLoadBalancerTargetGroups({required String autoScalingGroupName, int? maxRecords, String? nextToken}) Future<DescribeLoadBalancerTargetGroupsResponse>
Describes the target groups for the specified Auto Scaling group.
describeMetricCollectionTypes() Future<DescribeMetricCollectionTypesAnswer>
Describes the available CloudWatch metrics for Amazon EC2 Auto Scaling.
describeNotificationConfigurations({List<String>? autoScalingGroupNames, int? maxRecords, String? nextToken}) Future<DescribeNotificationConfigurationsAnswer>
Describes the notification actions associated with the specified Auto Scaling group.
describePolicies({String? autoScalingGroupName, int? maxRecords, String? nextToken, List<String>? policyNames, List<String>? policyTypes}) Future<PoliciesType>
Describes the policies for the specified Auto Scaling group.
describeScalingActivities({List<String>? activityIds, String? autoScalingGroupName, int? maxRecords, String? nextToken}) Future<ActivitiesType>
Describes one or more scaling activities for the specified Auto Scaling group.
describeScalingProcessTypes() Future<ProcessesType>
Describes the scaling process types for use with the ResumeProcesses and SuspendProcesses APIs.
describeScheduledActions({String? autoScalingGroupName, DateTime? endTime, int? maxRecords, String? nextToken, List<String>? scheduledActionNames, DateTime? startTime}) Future<ScheduledActionsType>
Describes the actions scheduled for your Auto Scaling group that haven't run or that have not reached their end time. To describe the actions that have already run, call the DescribeScalingActivities API.
describeTags({List<Filter>? filters, int? maxRecords, String? nextToken}) Future<TagsType>
Describes the specified tags.
describeTerminationPolicyTypes() Future<DescribeTerminationPolicyTypesAnswer>
Describes the termination policies supported by Amazon EC2 Auto Scaling.
detachInstances({required String autoScalingGroupName, required bool shouldDecrementDesiredCapacity, List<String>? instanceIds}) Future<DetachInstancesAnswer>
Removes one or more instances from the specified Auto Scaling group.
detachLoadBalancers({required String autoScalingGroupName, required List<String> loadBalancerNames}) Future<void>
Detaches one or more Classic Load Balancers from the specified Auto Scaling group.
detachLoadBalancerTargetGroups({required String autoScalingGroupName, required List<String> targetGroupARNs}) Future<void>
Detaches one or more target groups from the specified Auto Scaling group.
disableMetricsCollection({required String autoScalingGroupName, List<String>? metrics}) Future<void>
Disables group metrics for the specified Auto Scaling group.
enableMetricsCollection({required String autoScalingGroupName, required String granularity, List<String>? metrics}) Future<void>
Enables group metrics for the specified Auto Scaling group. For more information, see Monitoring CloudWatch metrics for your Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide.
enterStandby({required String autoScalingGroupName, required bool shouldDecrementDesiredCapacity, List<String>? instanceIds}) Future<EnterStandbyAnswer>
Moves the specified instances into the standby state.
executePolicy({required String policyName, String? autoScalingGroupName, double? breachThreshold, bool? honorCooldown, double? metricValue}) Future<void>
Executes the specified policy. This can be useful for testing the design of your scaling policy.
exitStandby({required String autoScalingGroupName, List<String>? instanceIds}) Future<ExitStandbyAnswer>
Moves the specified instances out of the standby state.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putLifecycleHook({required String autoScalingGroupName, required String lifecycleHookName, String? defaultResult, int? heartbeatTimeout, String? lifecycleTransition, String? notificationMetadata, String? notificationTargetARN, String? roleARN}) Future<void>
Creates or updates a lifecycle hook for the specified Auto Scaling group.
putNotificationConfiguration({required String autoScalingGroupName, required List<String> notificationTypes, required String topicARN}) Future<void>
Configures an Auto Scaling group to send notifications when specified events take place. Subscribers to the specified topic can have messages delivered to an endpoint such as a web server or an email address.
putScalingPolicy({required String autoScalingGroupName, required String policyName, String? adjustmentType, int? cooldown, bool? enabled, int? estimatedInstanceWarmup, String? metricAggregationType, int? minAdjustmentMagnitude, int? minAdjustmentStep, String? policyType, int? scalingAdjustment, List<StepAdjustment>? stepAdjustments, TargetTrackingConfiguration? targetTrackingConfiguration}) Future<PolicyARNType>
Creates or updates a scaling policy for an Auto Scaling group.
putScheduledUpdateGroupAction({required String autoScalingGroupName, required String scheduledActionName, int? desiredCapacity, DateTime? endTime, int? maxSize, int? minSize, String? recurrence, DateTime? startTime, DateTime? time}) Future<void>
Creates or updates a scheduled scaling action for an Auto Scaling group. If you leave a parameter unspecified when updating a scheduled scaling action, the corresponding value remains unchanged.
recordLifecycleActionHeartbeat({required String autoScalingGroupName, required String lifecycleHookName, String? instanceId, String? lifecycleActionToken}) Future<void>
Records a heartbeat for the lifecycle action associated with the specified token or instance. This extends the timeout by the length of time defined using the PutLifecycleHook API call.
resumeProcesses({required String autoScalingGroupName, List<String>? scalingProcesses}) Future<void>
Resumes the specified suspended auto scaling processes, or all suspended process, for the specified Auto Scaling group.
setDesiredCapacity({required String autoScalingGroupName, required int desiredCapacity, bool? honorCooldown}) Future<void>
Sets the size of the specified Auto Scaling group.
setInstanceHealth({required String healthStatus, required String instanceId, bool? shouldRespectGracePeriod}) Future<void>
Sets the health status of the specified instance.
setInstanceProtection({required String autoScalingGroupName, required List<String> instanceIds, required bool protectedFromScaleIn}) Future<void>
Updates the instance protection settings of the specified instances.
startInstanceRefresh({required String autoScalingGroupName, RefreshPreferences? preferences, RefreshStrategy? strategy}) Future<StartInstanceRefreshAnswer>
Starts a new instance refresh operation, which triggers a rolling replacement of all previously launched instances in the Auto Scaling group with a new group of instances.
suspendProcesses({required String autoScalingGroupName, List<String>? scalingProcesses}) Future<void>
Suspends the specified auto scaling processes, or all processes, for the specified Auto Scaling group.
terminateInstanceInAutoScalingGroup({required String instanceId, required bool shouldDecrementDesiredCapacity}) Future<ActivityType>
Terminates the specified instance and optionally adjusts the desired group size.
toString() String
A string representation of this object.
inherited
updateAutoScalingGroup({required String autoScalingGroupName, List<String>? availabilityZones, bool? capacityRebalance, int? defaultCooldown, int? desiredCapacity, int? healthCheckGracePeriod, String? healthCheckType, String? launchConfigurationName, LaunchTemplateSpecification? launchTemplate, int? maxInstanceLifetime, int? maxSize, int? minSize, MixedInstancesPolicy? mixedInstancesPolicy, bool? newInstancesProtectedFromScaleIn, String? placementGroup, String? serviceLinkedRoleARN, List<String>? terminationPolicies, String? vPCZoneIdentifier}) Future<void>
Updates the configuration for the specified Auto Scaling group.

Operators

operator ==(Object other) bool
The equality operator.
inherited