【发布时间】:2020-01-28 02:07:35
【问题描述】:
以下是我在自定义 VPC 上启动实例的代码,但我看到以下错误。在查找问题时需要您的帮助:
import json
import boto3
def lambda_handler(event, context):
session_client=boto3.client(service_name='ec2')
response = session_client.run_instances(
#SecurityGroupIds=['sg-0ffb80bb93205a004'],
#SubnetId='subnet-0bb30254459fd4714',
MaxCount=1,
MinCount=1,
NetworkInterfaces=[
{
'NetworkInterfaceId':'eni-0846a5c0c47e98b3c',
'Description': 'Network Interface Description',
'DeviceIndex': 123,
'SubnetId': 'subnet-0bb30254459fd4714'
},
],
LaunchTemplate={
'LaunchTemplateId': 'lt-0d3c7dd295796ad6b',
'Version': '1'
})
Error: Network interfaces and an instance-level subnet ID may not be specified on the same request",
"errorType": "ClientError",
谢谢, 巴普雷迪巴图
【问题讨论】:
标签: python aws-lambda boto3