aws 修改保留实例
aws modify reserved instances
AWS python boto3 调用有问题 ec2.meta.client.modify_reserved_instances()
。
我收到以下错误:
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in TargetConfigurations[0]: "Scope", must be one of: AvailabilityZone, Platform, InstanceCount, InstanceType
这是我的功能:
def modify_reserved_instance(self, region, iid, icount, itype):
ec2 = boto3.resource(
'ec2', region_name=region[:-1], api_version='2016-04-01')
response = ec2.meta.client.modify_reserved_instances(
ClientToken='string',
ReservedInstancesIds=[
iid,
],
TargetConfigurations=[
{
'AvailabilityZone': region,
'Platform': 'Linux/UNIX (Amazon VPC)',
'InstanceCount': icount,
'InstanceType': itype,
'Scope': 'Availability Zone'
},
]
)
print (response)
return response
我已经尝试将范围设为 AvailabilityZone
和 Availability Zone
。
更新的 botocore:sudo pip install botocore --upgrade
从 github 安装 boto3/botocore:https://github.com/boto/boto3
有没有其他人使用过来自 boto3.resource('ec2')
对象的方法?
boto3 documentation for modify_reserved_instance()
显示参数为:
- 可用性区域: 例如
us-west-2c
- 平台: EC2-Classic 或 EC2-VPC
- InstanceCount
- 实例类型
- 范围:
standard
或 convertible
您的错误消息说 boto3 无法识别 Scope
参数。
不是 说 Scope 参数应该设置为 "AvailabilityZone, Platform, InstanceCount, InstanceType" -- 它们只是 期望的参数列表(Scope 不是其中之一)。
可转换预留实例 became available in September 2016。您的 boto3
本地副本似乎已过期。
我建议您将 boto3
的版本更新为知道 Scope 参数的版本:
sudo pip install boto3 --upgrade
AWS python boto3 调用有问题 ec2.meta.client.modify_reserved_instances()
。
我收到以下错误:
botocore.exceptions.ParamValidationError: Parameter validation failed: Unknown parameter in TargetConfigurations[0]: "Scope", must be one of: AvailabilityZone, Platform, InstanceCount, InstanceType
这是我的功能:
def modify_reserved_instance(self, region, iid, icount, itype):
ec2 = boto3.resource(
'ec2', region_name=region[:-1], api_version='2016-04-01')
response = ec2.meta.client.modify_reserved_instances(
ClientToken='string',
ReservedInstancesIds=[
iid,
],
TargetConfigurations=[
{
'AvailabilityZone': region,
'Platform': 'Linux/UNIX (Amazon VPC)',
'InstanceCount': icount,
'InstanceType': itype,
'Scope': 'Availability Zone'
},
]
)
print (response)
return response
我已经尝试将范围设为 AvailabilityZone
和 Availability Zone
。
更新的 botocore:
sudo pip install botocore --upgrade
从 github 安装 boto3/botocore:
https://github.com/boto/boto3
有没有其他人使用过来自 boto3.resource('ec2')
对象的方法?
boto3 documentation for modify_reserved_instance()
显示参数为:
- 可用性区域: 例如
us-west-2c
- 平台: EC2-Classic 或 EC2-VPC
- InstanceCount
- 实例类型
- 范围:
standard
或convertible
您的错误消息说 boto3 无法识别 Scope
参数。
不是 说 Scope 参数应该设置为 "AvailabilityZone, Platform, InstanceCount, InstanceType" -- 它们只是 期望的参数列表(Scope 不是其中之一)。
可转换预留实例 became available in September 2016。您的 boto3
本地副本似乎已过期。
我建议您将 boto3
的版本更新为知道 Scope 参数的版本:
sudo pip install boto3 --upgrade