This commit is contained in:
dzikafoczka 2024-12-20 21:30:54 +01:00
parent 350c560e5d
commit 14161fd8ef

4
lb2.py
View File

@ -196,11 +196,11 @@ def create_target_group(elbv2_client, vpc_id):
return response['TargetGroups'][0]['TargetGroupArn'] return response['TargetGroups'][0]['TargetGroupArn']
def create_load_balancer(elbv2_client, subnet_id, security_group_id): def create_load_balancer(elbv2_client, subnet_ids, security_group_id):
# Create Load Balancer # Create Load Balancer
response = elbv2_client.create_load_balancer( response = elbv2_client.create_load_balancer(
Name=f"{PREFIX}-lb", Name=f"{PREFIX}-lb",
Subnets=[subnet_id], Subnets=subnet_ids,
SecurityGroups=[security_group_id], SecurityGroups=[security_group_id],
Scheme='internet-facing', Scheme='internet-facing',
Type='application', Type='application',