DNS record for cognito user pool domain

I don’t see anything in the documentation that suggests I can get the DNS record for the Cloudfront distribution that is created with a new aws_cognito_user_pool_domain, when creating one for a custom subdomain. What I’d like to do is create the aws_cognito_user_pool_domain and generate the associated aws_route53_record from the cognito user pool. If this isn’t possible, I’ll create a request on the github page for the AWS provider.

Thanks in advance!

Use something like

resource "aws_route53_record" "domain" {
  name = "Cognito Domain"
  type = "A"
  alias {
    name                   = aws_cognito_user_pool_domain.XXX.cloudfront_distribution_arn
    evaluate_target_health = false
    zone_id                = "Z2FDTNDATAQYW2" # Every CloudFront distribution's zone ID is Z2FDTNDATAQYW2
  allow_overwrite = true
  zone_id         = data.aws_route53_zone.cognito.zone_id