Lambda问题,增加了自动缩放组的最大大小

问题描述 投票:0回答:1

[尝试使用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')
python aws-lambda boto3
1个回答
0
投票

请按如下所示更改代码,然后尝试:

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')

我能够使其成功运行。

© www.soinside.com 2019 - 2024. All rights reserved.