Skip to content

Conversation

@konokenj
Copy link
Contributor

@konokenj konokenj commented Dec 7, 2025

Problem

The current documentation and code comments don't clearly explain why domainName is optional and what happens when it's not provided. Users might assume that a custom domain is required for the infrastructure to work, especially for Cognito authentication and CloudFront distribution.

Solution

Added comprehensive documentation comments throughout the codebase to clarify that:

  1. For Cognito: When no custom domain is provided, a random prefix is automatically generated to create a unique Cognito domain (e.g., webapp-abc123def4.auth.us-west-2.amazoncognito.com)
  2. For CloudFront: When no custom domain is provided, CloudFront's default domain is used (e.g., d1234567890.cloudfront.net)
  3. The infrastructure is fully functional without a custom domain setup

Changes

Updated documentation comments in:

  • cdk/bin/cdk.ts - EnvironmentProps.domainName
  • cdk/lib/main-stack.ts - MainStackProps
  • cdk/lib/us-east-1-stack.ts - UsEast1StackProps
  • cdk/lib/constructs/auth/index.ts - AuthProps and inline comments
  • cdk/lib/constructs/webapp.ts - WebappProps
  • cdk/lib/constructs/cf-lambda-furl-service/service.ts - CloudFrontLambdaFunctionUrlServiceProps

These improvements make it easier for users to understand that the custom domain is truly optional and how the system behaves in both scenarios.

@tmokmss
Copy link
Contributor

tmokmss commented Dec 7, 2025

Thanks!

@tmokmss tmokmss merged commit 5dfdbf9 into aws-samples:main Dec 7, 2025
2 checks passed
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