1
當我嘗試創建自動縮放組時,出現錯誤。是否可以將運行實例添加到我的代碼中。創建自動縮放組時出錯。 ['HmacAuthV4Handler']。如何解決它
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']