From 350c560e5db75d984da703e3c7d682c325fc5d41 Mon Sep 17 00:00:00 2001 From: dzikafoczka Date: Fri, 20 Dec 2024 21:29:03 +0100 Subject: [PATCH] lb2 --- lb2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lb2.py b/lb2.py index 2c5d14f..ccf9c27 100644 --- a/lb2.py +++ b/lb2.py @@ -36,11 +36,11 @@ def create_vpc(ec2_client): return vpc_id -def create_subnet(ec2_client, vpc_id, availability_zone): +def create_subnet(ec2_client, vpc_id, cidr_block, availability_zone): # Create subnet response = ec2_client.create_subnet( VpcId=vpc_id, - CidrBlock='10.0.1.0/24', + CidrBlock=cidr_block, AvailabilityZone=availability_zone, TagSpecifications=[ { @@ -266,11 +266,11 @@ def main(): # Create first subnet print("Creating first subnet...") - subnet_id_1 = create_subnet(ec2_client, vpc_id, availability_zone='us-east-1a') + subnet_id_1 = create_subnet(ec2_client, vpc_id, cidr_block='10.0.1.0/24', availability_zone='us-east-1a') # Create second subnet print("Creating second subnet...") - subnet_id_2 = create_subnet(ec2_client, vpc_id, availability_zone='us-east-1b') + subnet_id_2 = create_subnet(ec2_client, vpc_id, cidr_block='10.0.2.0/24', availability_zone='us-east-1b') # Create Internet Gateway print("Creating Internet Gateway...")