angel_30
angel_30

Reputation: 1

How to set availability zone in Boto3

Putting it simple: I created an AWS subnet with boto3 with the following simple one-liner script, but how can I set availability zone for my subnet?

subnet1 = vpc.create_subnet(CidrBlock='10.0.0.0/24')

Upvotes: 1

Views: 1866

Answers (1)

grahamlyons
grahamlyons

Reputation: 717

Add the argument AvailabilityZone='eu-west-1a', for example.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.create_subnet

Upvotes: 4

Related Questions