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

Add google_certificate_manager_dns_authorization as a data source #20422

Open
mans0954 opened this issue Nov 21, 2024 · 0 comments
Open

Add google_certificate_manager_dns_authorization as a data source #20422

mans0954 opened this issue Nov 21, 2024 · 0 comments
Labels

Comments

@mans0954
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Description

Currently google_certificate_manager_dns_authorization is supported as a resource, but not a data source.

In some cases one may wish to manage DNS and Certificates in separate terraform configurations (e.g. when the DNS is managed by a third party service external to Google Cloud). In these situations it would be useful to be able to create the DNS authorization resource in one configuration and reference it in another configuration to retrieve the value of dns_resource_record.

New or Affected Resource(s)

  • google_certificate_manager_dns_authorization

Potential Terraform Configuration

Certificate configuration:

resource "google_certificate_manager_dns_authorization" "example" {
  name        = "example-dns-auth"
  description = "example dns"
  domain      = "example.com"
}

resource "google_certificate_manager_certificate_map" "example" {
  name        = "example-cert-map"
  description = "example certificate map"
}

resource "google_certificate_manager_certificate" "example" {
  name        = "example-cert"
  description = "example cert"
  managed {
    domains = [
      join(".",["*",google_certificate_manager_dns_authorization.example.domain]),
    ]
    dns_authorizations = [
      google_certificate_manager_dns_authorization.example.id,
    ]
  }
}

resource "google_certificate_manager_certificate_map_entry" "example" {
  name        = "example-cert-map-entry"
  description = "example certificate map entry"
  map = google_certificate_manager_certificate_map.example.name 
  certificates = [google_certificate_manager_certificate.example.id]
  hostname = "*.example.com"
}

Separate DNS configuration:

data "google_certificate_manager_dns_authorization" "example" {
  name        = "example-dns-auth"
}

resource "cloudflare_record" "example_caa_gc_certman" {
  count   = 1
  zone_id = data.cloudflare_zone.example.id
  name    = split(".", google_certificate_manager_dns_authorization.example.dns_resource_record.0.name).0
  type    = google_certificate_manager_dns_authorization.example.dns_resource_record.0.type
  ttl     = 360
  content   = google_certificate_manager_dns_authorization.example.dns_resource_record.0.data
}

References

No response

@github-actions github-actions bot added forward/review In review; remove label to forward service/certificatemanager labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant