简体   繁体   中英

AWS EC2 can create instances asynchronously?

I'm using boto3 to create aws ec2 instances.

ec2 = boto3.resource('ec2', region_name='ap-northeast-2')
ec2.create_instances(..)

can't found async options.

Like aws lambda "InvocationType":

awslambda.invoke(FunctionName='TEST', InvocationType='Event',
                                           Payload=json.dumps(new))

Unfortunately there is no async function for that in the API.

If you want to ignore the result you have to do an async call in another thread, there is multiple ways to do this in python.

Note that there is an unofficial Async AWS python SDK aioboto3 . It does not contain your API call today but you can contribute if you like.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM