Create the custom domain name separately. Since the domain name is a longer-lived resource, you may not want it modified, or deleted by your application stack.
Do this in the console as shown in this blog, or use your favorite IaC tool.
Example with CDK:
import * as cdk from '@aws-cdk/core'