Reputation: 1
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?
boto3
subnet1 = vpc.create_subnet(CidrBlock='10.0.0.0/24')
Upvotes: 1
Views: 1866
Reputation: 717
Add the argument AvailabilityZone='eu-west-1a', for example.
AvailabilityZone='eu-west-1a',
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.create_subnet
Upvotes: 4