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 more allowed record filter #93

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

kokizzu
Copy link
Collaborator

@kokizzu kokizzu commented Mar 28, 2024

tested locally

terra.tf

terraform {
  required_providers {
    gcore = {
            source = "local.gcore.com/repo/gcore"
             version = ">=0.3.64"
     }
  }
}
provider gcore {
  permanent_api_token = "10090$xxx"
}

resource "gcore_dns_zone_record" "xyz_bar" {
    domain = "xyz.bar"
    #id     = jsonencode(
    #    {
    #        Domain = "xyz.bar"
    #        Type   = "A"
    #        Zone   = "xyz.bar"
    #    }
    #)
    ttl    = 120
    type   = "A"
    zone   = "xyz.bar"

    filter {
        limit  = 0
        strict = true
        type   = "healthcheck"
    }
    filter {
        limit  = 0
        strict = false
        type   = "weighted_shuffle"
    }

    meta {
        healthchecks {
            frequency        = 300
            host             = "monitor.tld"
            http_status_code = 200
            method           = "GET"
            port             = 80
            protocol         = "HTTP"
            timeout          = 10
            tls              = false
            url              = "/monitor"
        }
    }

    resource_record {
        content = "1.2.3.4"
        enabled = true
    }
    resource_record {
        content = "4.5.6.7"
        enabled = true
    }
}

terraform apply output

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # gcore_dns_zone_record.xyz_bar will be created
  + resource "gcore_dns_zone_record" "xyz_bar" {
      + domain = "xyz.bar"
      + id     = (known after apply)
      + ttl    = 120
      + type   = "A"
      + zone   = "xyz.bar"

      + filter {
          + limit  = 0
          + strict = true
          + type   = "healthcheck"
        }
      + filter {
          + limit  = 0
          + strict = false
          + type   = "weighted_shuffle"
        }

      + meta {
          + geodns_link = (known after apply)

          + healthchecks {
              + frequency        = 300
              + host             = "monitor.tld"
              + http_status_code = 200
              + method           = "GET"
              + port             = 80
              + protocol         = "HTTP"
              + timeout          = 10
              + tls              = false
              + url              = "/monitor"
            }
        }

      + resource_record {
          + content = "1.2.3.4"
          + enabled = true
        }
      + resource_record {
          + content = "4.5.6.7"
          + enabled = true
        }
    }

Plan: 1 to add, 0 to change, 0 to destroy.
gcore_dns_zone_record.xyz_bar: Creating...
gcore_dns_zone_record.xyz_bar: Creation complete after 7s [id={"Zone":"xyz.bar","Domain":"xyz.bar","Type":"A"}]
╷
│ Warning: Argument is deprecated
│
│   with provider["local.gcore.com/repo/gcore"],
│   on terra.tf line 10, in provider "gcore":
│   10: provider gcore {
│
│ Use permanent_api_token instead
│
│ (and 2 more similar warnings elsewhere)
╵

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

@kokizzu kokizzu marked this pull request as draft March 28, 2024 10:35
@kokizzu kokizzu force-pushed the add-more-allowed-record-filter branch from 7ac3064 to 008ff44 Compare March 28, 2024 10:36
@kokizzu kokizzu marked this pull request as ready for review March 28, 2024 10:38
@kokizzu kokizzu requested a review from bazilek April 2, 2024 09:27
@kokizzu kokizzu merged commit 27049a2 into G-Core:master Apr 2, 2024
1 check passed
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.

gcore_dns_zone_record : pickers "weighted shuffle" and "healthcheck" not supported
4 participants