EC2: Resource name DNS options for subnets#154
Merged
viren-nadkarni merged 3 commits intolocalstackfrom Apr 3, 2026
Merged
Conversation
baermat
reviewed
Apr 2, 2026
Member
baermat
left a comment
There was a problem hiding this comment.
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 |
Member
There was a problem hiding this comment.
I am quite surprised that the type change does not require any additional changes, especially in tests/snapshots. Can you give more context here?
Member
Author
There was a problem hiding this comment.
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.
baermat
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements support for DNS options in EC2 subnets.
DescribeSubnetsnow returns the default values forprivateDnsNameOptionsOnLaunchEnableResourceNameDnsARecordOnLaunch) can be modified usingModifySubnetAttributeSee localstack/localstack#13113
Closes PNX-714