[尝试使用boto3创建Lambda函数并通过lambda增加我的缩放组。
import boto3
region = 'us-east-1'
asgname = 'ASG'
autoscaling = boto3.client('autoscaling')
def lambda_handler(event, context):
autoscaling.update_auto_scaling_groups(AutoScalingGroupName=ASG, MaxSize=4)
print('Thank You')
请按如下所示更改代码,然后尝试:
import boto3
region = 'us-west-2'
asgname = 'ASG'
autoscaling = boto3.client('autoscaling')
def lambda_handler(event, context):
autoscaling.update_auto_scaling_group(AutoScalingGroupName='ASG', MaxSize=4)
print('Thank You')
我能够使其成功运行。