有没有办法使用 boto3 做等效的aws ec2 create-default-vpc
?(更一般地说,我想知道是否有办法找出 boto3/botocore 等效于 aws CLI 指令(
使用create_default_vpc()
:
import boto3
client = boto3.client('ec2', region_name = 'ap-southeast-2') # Adjust as desired
client.create_default_vpc()
这一切都在 boto3 文档中!(事实上,AWS CLI 使用 botocore!