Skip to content

Commit 7204747

Browse files
committed
Skip firewall setup for custom os_images
1 parent ddcddb7 commit 7204747

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

docs/docs/concepts/backends.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ There are two ways to configure AWS: using an access key or using the default cr
243243
* `user` with passwordless sudo access
244244
* Docker is installed
245245
* (For NVIDIA instances) NVIDIA/CUDA drivers and NVIDIA Container Toolkit are installed
246+
* The firewall (`iptables`, `ufw`, etc.) must allow external traffic to port 22 and all traffic within the private subnet, and should forbid any other incoming external traffic.
246247

247248
## Azure
248249

src/dstack/_internal/core/backends/aws/compute.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,12 @@ def create_instance(
292292
image_id=image_id,
293293
instance_type=instance_offer.instance.name,
294294
iam_instance_profile=self.config.iam_instance_profile,
295-
user_data=get_user_data(authorized_keys=instance_config.get_public_keys()),
295+
user_data=get_user_data(
296+
authorized_keys=instance_config.get_public_keys(),
297+
# Custom OS images may lack ufw, so don't attempt to set up the firewall.
298+
# Rely on security groups and the image's built-in firewall rules instead.
299+
skip_firewall_setup=self.config.os_images is not None,
300+
),
296301
tags=aws_resources.make_tags(tags),
297302
security_group_id=security_group_id,
298303
spot=instance_offer.instance.resources.spot,

0 commit comments

Comments
 (0)