Python 3.x 无法使用boto3创建ec2实例
我无法使用boto3创建EC2实例Python 3.x 无法使用boto3创建ec2实例,python-3.x,amazon-web-services,amazon-ec2,boto3,Python 3.x,Amazon Web Services,Amazon Ec2,Boto3,我无法使用boto3创建EC2实例 ec2 = boto3.resource('ec2') ec2.create_instances(ImageId='ami-0d8f6eb4f641ef691', MinCount=1, MaxCount=1, InstanceType='t2.micro') 我正在尝试使用boto3创建一个实例 ec2 = boto3.resource('ec2') ec2.create_instances(ImageId='ami-0d8f6eb4f641ef691',
ec2 = boto3.resource('ec2')
ec2.create_instances(ImageId='ami-0d8f6eb4f641ef691', MinCount=1, MaxCount=1, InstanceType='t2.micro')
我正在尝试使用boto3创建一个实例
ec2 = boto3.resource('ec2')
ec2.create_instances(ImageId='ami-0d8f6eb4f641ef691', MinCount=1, MaxCount=1, InstanceType='t2.micro')
我所在的地区是美国东部(俄亥俄州)
我不知道如何找到特定区域的AMI。我只是选择了可用的
错误消息是
botocore.exceptions.ClientError: An error occurred (InvalidAMIID.NotFound) when calling the RunInstances operation: The image id '[ami-0d8f6eb4f641ef691]' does not exist
我从以下位置复制了AMI ID:
我认为您缺少region\u name参数 您可以将代码中的区域名称设置为:
ec2 = boto3.resource('ec2', region_name='us-east-2')
希望能有帮助