fix(apigateway): report the published regional hosted zones (#7487)

* fix(apigateway): report the published regional hosted zones

A regional custom domain reported the invented Z2FDTNDATAQYL2 everywhere outside
GovCloud, so a Route 53 alias built from it pointed at a zone AWS does not have.
Vendor the data plane table of the API Gateway General Reference page into
region-facts.json, with the GovCloud guide kept as a cross-check. A region with no
row keeps the placeholder, now documented as one. Stored domains keep their id.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* test(apigateway): read the regional hosted zone through the SDK clients

Create and read the custom domains with ApiGatewayClient and ApiGatewayV2Client, so the test also shows both SDKs parse the zone fields.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-11-04 05:17:48 -04:00
1 parent 27057e2c00
commit e46579ec03
10 files changed
+298 -69

No files matched your search

@@ -13,8 +13,8 @@ import java.util.Set;
/**
* The per-region and per-partition constants AWS publishes only as prose tables, vendored in
* {@code aws/region-facts.json} by {@code tools/aws/regen_region_facts.py} from the Terraform
* provider, the CDK, the botocore models and the China and GovCloud user guides: load balancer,
* S3 website and GovCloud API Gateway hosted zone ids, the CloudFront hosted zone and distribution
* provider, the CDK, the botocore models, the API Gateway General Reference page and the China and
* GovCloud user guides: load balancer, S3 website and API Gateway regional hosted zone ids, the CloudFront hosted zone and distribution
* domain suffix per partition, the SAML sign-on URL and the management console host per partition
* and the VPC endpoint service-name prefixes. Every accessor is {@link Optional}: the ISO and EUSC partitions have no published
* hosted zones, and a service that needs one there has nothing faithful to answer.
@@ -56,7 +56,8 @@ public final class AwsRegionFacts {
/**
* The hosted zone of an API Gateway regional endpoint, which a Route 53 alias to a regional
* custom domain targets. Published in the corpus for the two GovCloud regions only.
* custom domain targets, from the General Reference table. Absent for a region with no row:
* the China, ISO and EUSC regions and {@code ap-southeast-6}.
*/
public static Optional<String> apiGatewayRegionalHostedZoneId(String region) {
return regionText(region, "apiGatewayRegionalHostedZoneId");
@@ -93,8 +93,9 @@ public class ApiGatewayService implements ResourceProvider {
private static final Set<String> EDGE_OPTIMIZED_PARTITIONS = Set.of("aws");
/**
* The regional hosted zone a custom domain reports in a region with no published one. Only
* the two GovCloud regions have a sourced zone ({@link AwsRegionFacts#apiGatewayRegionalHostedZoneId}).
* The regional hosted zone a custom domain reports in a region the General Reference does not
* list ({@link AwsRegionFacts#apiGatewayRegionalHostedZoneId}). The id is invented and is no
* AWS zone: a Route 53 alias to it resolves to nothing on AWS.
*/
private static final String UNSOURCED_REGIONAL_HOSTED_ZONE_ID = "Z2FDTNDATAQYL2"; // partition-literal: placeholder kept where no per-region source exists