Repository navigation
fix(ec2): use regional private DNS names - #5033
Conversation
|
pgermosen
left a comment
There was a problem hiding this comment.
@aniketshukla1 Thanks, pulling the domain rule into one helper is a nice cleanup.
Greptile's DNS point holds up, though. Floci accepts requests for any region that fits a partition's naming pattern, not just the published ones, so EC2 can hand out a name like ip-10-0-0-5.us-new-1.compute.internal that the new isRegionId check then refuses to resolve. Using the same check the request gate uses, RegionResolver.isKnownRegion, would keep the two in step.
Two small things while you're in there: the inline org.hamcrest.Matchers.equalTo in the integration test wants an import, and removing the search-domain constant in EcsTaskMetadataController left its doc comment behind on its own.
| ExtractableResponse<Response> instanceResponse = given().formParam("Action", "RunInstances") | ||
| .formParam("ImageId", "ami-0abcdef1234567890") | ||
| .formParam("InstanceType", "t3.micro") | ||
| .formParam("MinCount", "1") | ||
| .formParam("MaxCount", "1") | ||
| .formParam("SubnetId", subnetId) | ||
| .header("Authorization", auth) | ||
| .when().post("/").then().statusCode(200).extract(); |
There was a problem hiding this comment.
This new test checks DescribeSubnets, RunInstances, DescribeInstances, and CreateNetworkInterface only with handcrafted Query requests. The repository guide calls for SDK-based validation where possible, particularly for management APIs. Please satisfy that requirement before merging so the test also checks that an EC2 SDK client can consume the regional private DNS names.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
pgermosen
left a comment
There was a problem hiding this comment.
@aniketshukla1 Thanks, all three look right, and the us-new-1 test pins the DNS part. No need for the SDK test Greptile asked for: this changes a value, not the wire shape. I dropped the draft note and put the checklist back to the template in the description, since it becomes the squash commit.
… and the master (#5169) * fix(emr): use the cluster's regional private DNS domain for instances and the master ListInstances built every synthetic instance's PrivateDnsName as ip-10-0-0-N.ec2.internal, the us-east-1 domain, in every region, while RunJobFlow set MasterPublicDnsName to <region>.compute.internal, which is wrong in us-east-1. Both now use the shared EC2 helper, so names end in ec2.internal in us-east-1 and <region>.compute.internal elsewhere, as EC2 itself does since #5033. * fix(emr): report the regional master DNS name for a cluster stored before the fix DescribeCluster returned the stored MasterPublicDnsName, so a us-east-1 cluster persisted before the previous commit kept reporting <region>.compute.internal after an upgrade. The name is now derived from the cluster's region when the response is built.
* fix(ec2): use regional private DNS names * fix(ec2): resolve private DNS for pattern regions Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* fix(ec2): use regional private DNS names * fix(ec2): resolve private DNS for pattern regions Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
… and the master (floci-io#5169) * fix(emr): use the cluster's regional private DNS domain for instances and the master ListInstances built every synthetic instance's PrivateDnsName as ip-10-0-0-N.ec2.internal, the us-east-1 domain, in every region, while RunJobFlow set MasterPublicDnsName to <region>.compute.internal, which is wrong in us-east-1. Both now use the shared EC2 helper, so names end in ec2.internal in us-east-1 and <region>.compute.internal elsewhere, as EC2 itself does since floci-io#5033. * fix(emr): report the regional master DNS name for a cluster stored before the fix DescribeCluster returned the stored MasterPublicDnsName, so a us-east-1 cluster persisted before the previous commit kept reporting <region>.compute.internal after an upgrade. The name is now derived from the cluster's region when the response is built. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
… and the master (floci-io#5169) * fix(emr): use the cluster's regional private DNS domain for instances and the master ListInstances built every synthetic instance's PrivateDnsName as ip-10-0-0-N.ec2.internal, the us-east-1 domain, in every region, while RunJobFlow set MasterPublicDnsName to <region>.compute.internal, which is wrong in us-east-1. Both now use the shared EC2 helper, so names end in ec2.internal in us-east-1 and <region>.compute.internal elsewhere, as EC2 itself does since floci-io#5033. * fix(emr): report the regional master DNS name for a cluster stored before the fix DescribeCluster returned the stored MasterPublicDnsName, so a us-east-1 cluster persisted before the previous commit kept reporting <region>.compute.internal after an upgrade. The name is now derived from the cluster's region when the response is built. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
Summary
Closes #4959.
Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
Previously RunInstances and CreateNetworkInterface returned the us-east-1 private DNS suffix in every region. The integration test validates both us-east-1 and us-west-2 through the existing EC2 Query protocol. No live AWS comparison was run.
Checklist
./mvnw testpasses locally