Skip to content

EC2: Resource name DNS options for subnets#154

Merged
viren-nadkarni merged 3 commits intolocalstackfrom
subnet-dns-records
Apr 3, 2026
Merged

EC2: Resource name DNS options for subnets#154
viren-nadkarni merged 3 commits intolocalstackfrom
subnet-dns-records

Conversation

@viren-nadkarni
Copy link
Copy Markdown
Member

@viren-nadkarni viren-nadkarni commented Apr 1, 2026

This PR implements support for DNS options in EC2 subnets.

See localstack/localstack#13113

Closes PNX-714

@viren-nadkarni viren-nadkarni self-assigned this Apr 1, 2026
@viren-nadkarni viren-nadkarni requested a review from a team April 1, 2026 14:46
Copy link
Copy Markdown
Member

@baermat baermat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I have a question which has me a bit puzzled

Comment on lines 637 to +647

def modify_subnet_attribute(
self, subnet_id: str, attr_name: str, attr_value: str
self, subnet_id: str, attr_name: str, attr_value: bool
) -> None:
subnet = self.get_subnet(subnet_id)
if attr_name in ("map_public_ip_on_launch", "assign_ipv6_address_on_creation"):
setattr(subnet, attr_name, attr_value)
elif attr_name == "enable_resource_name_dns_a_record_on_launch":
subnet.private_dns_name_options_on_launch[
"EnableResourceNameDnsARecord"
] = attr_value
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am quite surprised that the type change does not require any additional changes, especially in tests/snapshots. Can you give more context here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ModifySubnetAttribute is used to modify a subnet parameter. This change makes it support a new parameter. It's actually being tested in the newly added test_private_dns_name_options, where it's used to change the default value.

AWS validation in Moto doesn't work like LocalStack -- it does not record the actual API response, just marks the test as runnable against AWS.

@viren-nadkarni viren-nadkarni requested a review from baermat April 2, 2026 11:59
@viren-nadkarni viren-nadkarni merged commit 86e1908 into localstack Apr 3, 2026
188 of 190 checks passed
@viren-nadkarni viren-nadkarni deleted the subnet-dns-records branch April 3, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants