This commit is contained in:
dzikafoczka 2024-12-20 21:23:37 +01:00
parent 5c20a1775f
commit 57ce363575

3
lb2.py
View File

@ -36,11 +36,12 @@ def create_vpc(ec2_client):
return vpc_id return vpc_id
def create_subnet(ec2_client, vpc_id): def create_subnet(ec2_client, vpc_id, availability_zone):
# Create subnet # Create subnet
response = ec2_client.create_subnet( response = ec2_client.create_subnet(
VpcId=vpc_id, VpcId=vpc_id,
CidrBlock='10.0.1.0/24', CidrBlock='10.0.1.0/24',
AvailabilityZone=availability_zone,
TagSpecifications=[ TagSpecifications=[
{ {
'ResourceType': 'subnet', 'ResourceType': 'subnet',