0
我似乎無法在特定區域和已定義的vpc中創建啓動配置。在不同地區創建啓動配置,並在Boto上創建vpc
aws_access_key_id = 'XXX'
aws_secret_access_key = 'XXX'
ec2_keypair = 'XXX'
ec2_security_groups = ['sg-XXXX']
ec2_region = 'us-west-1'
instance_type = 'm1.medium'
user_data = None
# Build the launch configuration
launch_config = LaunchConfiguration(
name=name, image_id=image_id, key_name=ec2_keypair, user_data=user_data,
security_groups=ec2_security_groups, instance_type=instance_type)
# Get the Region
conn = EC2Connection(aws_access_key_id=access_key_id,
aws_secret_access_key=secret_access_key)
region = next((r for r in conn.get_all_regions() if r.name == ec2_region), None)
# Connect to the Autoscaler
conn = boto.ec2.autoscale.connect_to_region(
region, aws_access_key_id=access_key_id,
aws_secret_access_key=secret_access_key)
conn.create_launch_configuration(launch_config)
當我運行此我得到的錯誤No default VPC
。這與在命令行(run_instances)中這樣做是一致的,所以我剛剛添加了子網。
<ErrorResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/">
<Error>
<Type>Sender</Type>
<Code>ValidationError</Code>
<Message>No default VPC for this user</Message>
</Error>
我該在哪裏追加子網或VPC以使其工作?
曾經找到一個答案?我目前收到同樣的錯誤? – David