VM::EC...caling(3pm)

πŸ“¦
version 1.28 Β· 7 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

VM::EC2::REST::autoscaling β€” autoscaling groups and launch configurations. That's it, that's the whole vibe. ✨

(Also, for the record bestie, this page is part of the User Contributed Perl Documentation, and the manual name is VM::EC2::REST::autoscaling(3pm) β€” now you know. 🫢)


πŸ¦‹ SYNOPSIS πŸ¦‹

use VM::EC2 ':autoscaling';

πŸ’… METHODS πŸ’…

This module provides VM::EC2 methods for autoscaling groups and launch configurations. Not all of the Amazon API is implemented, but the most common functions are available. So like… the hits, the essentials, the main character methods. πŸ‘‘

🌸 Implemented (we ate, no crumbs)

  • CreateAutoScalingGroup
  • CreateLaunchConfiguration
  • DeleteAutoScalingGroup
  • DeleteLaunchConfiguration
  • DeletePolicy
  • DescribeAutoScalingGroups
  • DescribeLaunchConfigurations
  • DescribePolicies
  • ExecutePolicy
  • PutScalingPolicy
  • ResumeProcesses
  • SuspendProcesses
  • UpdateAutoScalingGroup

πŸ™ˆ Unimplemented (not yet, and we're not mad about it)

  • CreateOrUpdateTags
  • DeleteNotificationConfiguration
  • DeleteScheduledAction
  • DeleteTags
  • DescribeAdjustmentTypes
  • DescribeAutoScalingInstances
  • DescribeAutoScalingNotificationTypes
  • DescribeMetricCollectionTypes
  • DescribeNotificationConfigurations
  • DescribeScalingActivities
  • DescribeScalingProcessTypes
  • DescribeScheduledActions
  • DescribeTags
  • DescribeTerminationPolicyTypes
  • DisableMetricsCollection
  • EnableMetricsCollection
  • PutNotificationConfiguration
  • PutScheduledUpdateGroupAction
  • SetDesiredCapacity
  • SetInstanceHealth
  • TerminateInstanceInAutoScalingGroup

πŸ” describe_launch_configurations

@lc = $ec2->describe_launch_configurations(-names => \@names);
@lc = $ec->describe_launch_configurations(@names);

Gives you the detailed tea β˜• on the launch configuration(s) you point at.

Optional parameters are:

  • -launch_configuration_names β€” name of the Launch config. This can be a string scalar or an arrayref.
  • -name β€” alias for -launch_configuration_names

Returns a series of VM::EC2::LaunchConfiguration objects. πŸ’–


πŸ› οΈ create_launch_configuration

$success = $ec2->create_launch_configuration(%args);

Makes you a brand new launch configuration. Glow up time. ✨

Required arguments:

  • -name β€” scalar, name for the Launch config.
  • -image_id β€” scalar, AMI id which this launch config will use
  • -instance_type β€” scalar, instance type of the Amazon EC2 instance.

Optional arguments:

  • -block_device_mappings β€” list of hashref
  • -ebs_optimized β€” scalar (boolean). false by default
  • -iam_instance_profile β€” scalar
  • -instance_monitoring β€” scalar (boolean). true by default
  • -kernel_id β€” scalar
  • -key_name β€” scalar
  • -ramdisk β€” scalar
  • -security_groups β€” list of scalars
  • -spot_price β€” scalar
  • -user_data β€” scalar

Returns true on successful execution.


πŸ—‘οΈ delete_launch_configuration

$success = $ec2->delete_launch_configuration(-name => $name);

Deletes a launch config. Gone. Poof. πŸ’€

  • -name β€” Required. Name of the launch config to delete

Returns true on success.


πŸ“‹ describe_autoscaling_groups

@asg = $ec2->describe_autoscaling_groups(-auto_scaling_group_names =>
    \@names);

Returns information about autoscaling groups.

  • -auto_scaling_group_names β€” List of auto scaling groups to describe
  • -names β€” Alias of -auto_scaling_group_names

Returns a list of VM::EC2::ASG.


🌈 create_autoscaling_group

$success = $ec2->create_autoscaling_group(-name => $name, -launch_config =>
    $lc, -max_size => $max_size, -min_size => $min_size);

Creates a new autoscaling group. New group, who dis. πŸ‘‘

Required arguments:

  • -name β€” Name for the autoscaling group
  • -launch_config β€” Name of the launch configuration to be used
  • -max_size β€” Max number of instances to be run at once
  • -min_size β€” Min number of instances

Optional arguments:

  • -availability_zones β€” List of availability zone names
  • -load_balancer_names β€” List of ELB names
  • -tags β€” List of tags to apply to the instances run
  • -termination_policies β€” List of policy names
  • -default_cooldown β€” Time in seconds between autoscaling activities
  • -desired_capacity β€” Number of instances to be run after creation
  • -health_check_type β€” One of "ELB" or "EC2"
  • -health_check_grace_period β€” Mandatory for health check type ELB. Number of seconds between an instance is started and the autoscaling group starts checking its health
  • -placement_group β€” Physical location of your cluster placement group
  • -vpc_zone_identifier β€” String containing a comma-separated list of subnet identifiers

Returns true on success.


πŸ’” delete_autoscaling_group

$success = $ec2->delete_autoscaling_group(-name => $name)

Deletes an autoscaling group.

  • -name β€” Name of the autoscaling group to delete

Returns true on success.


πŸ”„ update_autoscaling_group

$success = $ec2->update_autoscaling_group(-name => $name);

Updates an autoscaling group. Only required parameter is -name.

Optional arguments:

  • -availability_zones β€” List of AZ's
  • -termination_policies β€” List of policy names
  • -default_cooldown
  • -desired_capacity
  • -health_check_type
  • -health_check_grace_period
  • -launch_configuration_name
  • -placement_group
  • -vpc_zone_identifier
  • -max_size
  • -min_size

Returns true on success;


⏸️ suspend_processes

$success = $ec2->suspend_processes(-name => $asg_name, -scaling_processes =>
    \@procs);

Suspend the requested autoscaling processes. Everything hold still for a sec. βœ‹

  • -name β€” Name of the autoscaling group
  • -scaling_processes β€” List of process names to suspend. Valid processes are:
    • Launch
    • Terminate
    • HealthCheck
    • ReplaceUnhealty
    • AZRebalance
    • AlarmNotification
    • ScheduledActions
    • AddToLoadBalancer

Returns true on success.


▢️ resume_processes

$success = $ec2->resume_processes(-name => $asg_name, -scaling_processes =>
    \@procs);

Resumes the requested autoscaling processes. It accepts the same arguments than suspend_processes.

Returns true on success.


🏷️ autoscaling_tags

@arguments = $ec2->autoscaling_tags($argname, \%args)

(That's the whole line bestie, that's all she gave us. 🫠)


πŸ“œ describe_policies

@asg = $ec2->describe_policies(-auto_scaling_group_name => $name);

Returns information about autoscaling policies.

  • -auto_scaling_group_name β€” The name of the Auto Scaling group
  • -policy_names β€” An array of policy names or policy ARNs to be described. If this list is omitted, all policy names are described. If an auto scaling group name is provided, the results are limited to that group. The list of requested policy names cannot contain more than 50 items. If unknown policy names are requested, they are ignored with no error.
  • -names β€” Alias of -auto_scaling_group_names

Returns a list of VM::EC2::ScalingPolicy.


πŸ“ put_scaling_policy

$success = $ec2->put_scaling_policy

Creates or updates a policy for an Auto Scaling group.

Required arguments:

  • -policy_name β€” The name of the policy to update or create.
  • -name β€” Alias for -policy_name
  • -auto_scaling_group_name β€” The name or ARN of the Auto Scaling group.
  • -scaling_adjustment β€” Number of instances by which to scale.
  • -adjustment_type β€” Specifies whether -scaling_adjustment is an absolute number or a percentage of the current capacity. Valid values are:
    • ChangeInCapacity
    • ExactCapacity
    • PercentChangeInCapacity

Optional arguments:

  • -cooldown β€” The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.
  • -min_adjustment_step β€” Used with PercentChangeInCapacity as -adjustment_type.

Returns true on success


🧹 delete_policy

$success = $ec2->delete_policy(-policy_name => $name)

Deletes a policy. Bye bye. πŸ‘‹

Required arguments:

  • -policy_name β€” Name or ARN of the policy
  • -name β€” Alias for -policy_name
  • -auto_scaling_group_name β€” Name of the Auto Scaling Group, required when specifying policy by name (not by ARN)

Returns true on success


⚑ execute_policy

$success = $ec2->execute_policy(-policy_name => $name)

Runs a policy. Let her cook. πŸ”₯

Required arguments:

  • -policy_name β€” Name or ARN of the policy
  • -name β€” Alias for -policy_name
  • -auto_scaling_group_name β€” Name of the Auto Scaling Group, required when specifying policy by name (not by ARN)

Optional arguments:

  • -honor_cooldown β€” Set to true if you want AutoScaling to reject the request when it is in cooldown

Returns true on success


πŸ‘€ SEE ALSO πŸ‘€

  • VM::EC2

πŸŽ€ AUTHOR πŸŽ€

Lincoln Stein <lincoln.stein@gmail.com>.

Copyright (c) 2011 Ontario Institute for Cancer Research

This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty.


That's the whole page bestie, you're officially autoscaling-pilled. πŸ’–βœ¨

Okay so this was perl v5.38.2, dated 2024-08-10, and honestly? Iconic of her. Go forth and scale, queen. πŸ’…πŸŒˆπŸ¦‹

πŸ“¦ where this page comes from