当我尝试创建自动缩放组时出错。是否可以将正在运行的实例添加到我的代码中。
import boto.ec2.autoscale
from boto.connection import AWSQueryConnection
autoscale = boto.ec2.autoscale.connect_to_region('us-west-2')
from boto.ec2.autoscale import AutoScaleConnection
from boto.ec2.autoscale import LaunchConfiguration
from boto.ec2.autoscale import AutoScalingGroup
ACAK = 'xxxxxxxx'
ASAK = 'yyyyyyy'
conn= boto.connect_autoscale(ACAK, ASAK)
conn.get_all_groups()
print ('Creating Launch Configuration')
lc = LaunchConfiguration(name='test-launch_config', image_id='ami-6989a659', key_name='ki',security_groups='')
conn.create_launch_configuration(lc)
print ('Launch Configuration Created Successfully')
print ('Creating AutoScalingGroup')
ag = AutoScalingGroup(group_name='test_group', load_balancers=['my-lb'],availability_zones=['us-west-2a', 'us-west-2b'],launch_config=lc, min_size=2, max_size=4,connection=conn)
conn.create_auto_scaling_group(ag)
ag.get_activities()
print ('AutoScalingGroup Created Successfully')
boto.exception.NoAuthHandlerFound: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV4Handler']
答案 0 :(得分:0)
检查密钥和访问密钥凭据。