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

googleapi: Error 400: The 'entity.managedZone.dnssecConfig' parameter is required but was missing #227

Open
arkadiusz-konopka-collibra opened this issue Oct 13, 2022 · 0 comments

Comments

@arkadiusz-konopka-collibra
Copy link

I have Jenkins X running in GCP, after switching the source in my terraform to github.com/jenkins-x/terraform-google-jx?ref=v1.11.2 I've started to have an error from google API with the required dnssecConfig parameter.

Error message:

module.jx.module.dns.google_dns_managed_zone.externaldns_managed_zone_with_sub[0]: Modifying... [id=projects/cicd-jenkinsx-prd/managedZones/dev-jx-xxxxx-dev-sub]
╷
│ Error: Error updating ManagedZone "projects/cicd-jenkinsx-prd/managedZones/dev-jx-xxxxx-dev-sub": googleapi: Error 400: The 'entity.managedZone.dnssecConfig' parameter is required but was missing., required
│ 
│   with module.jx.module.dns.google_dns_managed_zone.externaldns_managed_zone_with_sub[0],
│   on .terraform/modules/jx/modules/dns/main.tf line 37, in resource "google_dns_managed_zone" "externaldns_managed_zone_with_sub":
│   37: resource "google_dns_managed_zone" "externaldns_managed_zone_with_sub" {
│ 
╵
Releasing state lock. This may take a few moments...

Error: Terraform exited with code 1.
Error: Process completed with exit code 1.

I have figured out that the dnssec_config is missing in .terraform/modules/jx/modules/dns/main.tf so I have forked the terraform-google-jx, added the missing configuration, and used it to deploy my infrastructure without errors.
It would be nice if a similar solution could be applied to the official repo because for now, it's a blocker for Jenkins X infrastructure deployment on GCP.

Below is the resource with my patch in main.tf and variables.tf:

// if we have a subdomain managed the zone here and add recordsets to the apex zone
resource "google_dns_managed_zone" "externaldns_managed_zone_with_sub" {
  count = var.apex_domain != "" && var.subdomain != "" ? 1 : 0

  name        = "${replace(var.subdomain, ".", "-")}-${replace(var.apex_domain, ".", "-")}-sub"
  dns_name    = "${var.subdomain}.${var.apex_domain}."
  description = "JX DNS subdomain zone managed by terraform"
  dnssec_config {
    kind          = "dns#managedZoneDnsSecConfig"
    non_existence = "nsec3"
    state         = var.dnssec_state

    default_key_specs {
      algorithm  = "rsasha256"
      key_length = 2048
      key_type   = "keySigning"
      kind       = "dns#dnsKeySpec"
    }
    default_key_specs {
      algorithm  = "rsasha256"
      key_length = 1024
      key_type   = "zoneSigning"
      kind       = "dns#dnsKeySpec"
    }
  }

  force_destroy = true
}

variables.tf

variable "dnssec_state" {
  description = "The apex domain to be allocated to the cluster"
  type        = string
  default     = "off"
}

Environment details:
Terraform version 1.3.2
Terraform init versions:

  • Installing hashicorp/helm v2.7.1...
  • Installed hashicorp/helm v2.7.1 (signed by HashiCorp)
  • Installing hashicorp/google v4.40.0...
  • Installed hashicorp/google v4.40.0 (signed by HashiCorp)
  • Installing hashicorp/random v3.4.3...
  • Installed hashicorp/random v3.4.3 (signed by HashiCorp)
  • Installing hashicorp/local v2.2.3...
  • Installed hashicorp/local v2.2.3 (signed by HashiCorp)
  • Installing hashicorp/null v3.1.1...
  • Installed hashicorp/null v3.1.1 (signed by HashiCorp)
  • Installing hashicorp/google-beta v4.40.0...
  • Installed hashicorp/google-beta v4.40.0 (signed by HashiCorp)
  • Installing hashicorp/kubernetes v2.14.0...
  • Installed hashicorp/kubernetes v2.14.0 (signed by HashiCorp)
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

No branches or pull requests

1 participant