feat: implement AppSync custom domain support#38
Merged
takaokouji merged 4 commits intomainfrom Jan 10, 2026
Merged
Conversation
- Added Route53 Hosted Zone lookup for smalruby.app - Added ACM certificate creation with DNS validation - Configured AppSync custom domain (CfnDomainName) - Added AppSync domain name association - Added Route53 CNAME record for graphql.smalruby.app - Added CustomDomainUrl output - Enabled env in cdk app for context lookups Related to: smalruby/smalruby3-develop#10
- Use L2 construct (GraphqlApi.domainName property) instead of L1 - Use environment variables APPSYNC_CUSTOM_DOMAIN and ROUTE53_PARENT_ZONE_NAME - Update domain naming to match Issue #10 requirements - Make custom domain configuration optional - Use Route53 Alias record with AppSyncTarget - Update .env.example with new variables
…logic - Corrected ARecord recordName to use relative subdomain instead of FQDN - Simplified custom domain optionality logic and allowed disabling via APPSYNC_CUSTOM_DOMAIN=false
- Update AppSyncSubscriptionHelper to correctly construct WebSocket URLs for custom domains - Append /realtime to custom domain WebSocket endpoints - Use DnsValidatedCertificate for cross-region certificate support - Skip Route53 lookup in CI by setting APPSYNC_CUSTOM_DOMAIN=false in ci.yml - Update manual WebSocket testing guide to use correct /realtime path
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 custom domain support for the AppSync GraphQL API, addressing review feedback.
Changes:
CfnDomainName) to L2 (GraphqlApi.domainName) property for better integration and adherence to CDK best practices.APPSYNC_CUSTOM_DOMAINandROUTE53_PARENT_ZONE_NAMEto configure the domain settings without hardcoding.graphql.api.smalruby.appstg.graphql.api.smalruby.appapi.smalruby.app(default)APPSYNC_CUSTOM_DOMAINis provided (or if a stage is detected to use the default naming).ARecordwithAppSyncTargetfor the custom domain..env.examplewith the new variables.Verification:
npm run buildpassesnpm testpassesaws-cdk-libRelated to: smalruby/smalruby3-develop#10