Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add domain_endpoint_v2_hosted_zone_id to outputs #33

Conversation

YanivZl
Copy link
Contributor

@YanivZl YanivZl commented Nov 30, 2024

Description

Added a new output, domain_endpoint_v2_hosted_zone_id, to facilitate the creation of Route53 alias records for custom domains in this module.

Motivation and Context

Amazon OpenSearch Service now supports Route 53 alias record for custom endpoint. This enhancement simplifies the process of integrating custom domains by directly providing the hosted zone ID required for Route53 configurations.

Usage Example:

data "aws_acm_certificate" "certificate" {
  domain = local.domain_name
}

data "aws_route53_zone" "this" {
  name = local.domain_name
}

module "opensearch" {
  // Your OpenSearch Configuration...

  ip_address_type = "dualstack"
  domain_endpoint_options = {
    enforce_https       = true
    tls_security_policy = "Policy-Min-TLS-1-2-PFS-2023-10"

    custom_endpoint_enabled         = true
    custom_endpoint                 = "${local.name}.${local.domain_name}"
    custom_endpoint_certificate_arn = data.aws_acm_certificate.certificate.arn
  }
}

module "records" {
  source  = "terraform-aws-modules/route53/aws//modules/records"
  version = "~> 2.0"

  zone_id = data.aws_route53_zone.this.zone_id

  records = [
    {
      name = local.name
      type = "A"
      alias = {
        name    = module.opensearch.domain_endpoint_v2
        zone_id = module.opensearch.domain_endpoint_v2_hosted_zone_id
      }
    }
  ]

  depends_on = [module.opensearch]
}

Breaking Changes

no

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@bryantbiggs bryantbiggs changed the title feat: Added domain_endpoint_v2_hosted_zone_id output feat: Add domain_endpoint_v2_hosted_zone_id to outputs Dec 1, 2024
@bryantbiggs bryantbiggs merged commit 7440825 into terraform-aws-modules:master Dec 1, 2024
12 checks passed
antonbabenko pushed a commit that referenced this pull request Dec 1, 2024
## [1.5.0](v1.4.1...v1.5.0) (2024-12-01)

### Features

* Add `domain_endpoint_v2_hosted_zone_id` to outputs ([#33](#33)) ([7440825](7440825))
@antonbabenko
Copy link
Member

This PR is included in version 1.5.0 🎉

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.

4 participants