Skip to content

Commit

Permalink
🐛♻️Clusters-keeper: use private dns name instead of public IP (ITISFo…
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg authored May 28, 2024
1 parent ae630cf commit a93de84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions packages/aws-library/src/aws_library/ec2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,7 @@ async def start_aws_instance(
launch_time=instance["LaunchTime"],
id=instance["InstanceId"],
aws_private_dns=instance["PrivateDnsName"],
aws_public_ip=(
instance["PublicIpAddress"]
if "PublicIpAddress" in instance
else None
),
aws_public_ip=instance.get("PublicIpAddress", None),
type=instance["InstanceType"],
state=instance["State"]["Name"],
tags=parse_obj_as(
Expand Down Expand Up @@ -263,11 +259,7 @@ async def get_instances(
launch_time=instance["LaunchTime"],
id=instance["InstanceId"],
aws_private_dns=instance["PrivateDnsName"],
aws_public_ip=(
instance["PublicIpAddress"]
if "PublicIpAddress" in instance
else None
),
aws_public_ip=instance.get("PublicIpAddress", None),
type=instance["InstanceType"],
state=instance["State"]["Name"],
resources=ec2_instance_types[0].resources,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def get_scheduler_url(ec2_instance: EC2InstanceData) -> AnyUrl:
url: AnyUrl = parse_obj_as(AnyUrl, f"tls://{ec2_instance.aws_public_ip}:8786")
url: AnyUrl = parse_obj_as(AnyUrl, f"tls://{ec2_instance.aws_private_dns}:8786")
return url


Expand Down

0 comments on commit a93de84

Please sign in to comment.