terraform-provider-cloudflare: seems, dynamics block inside cloudflare_record isn't work

Terraform Version

0.13.2

Affected Resource(s)

cloudflare_record

Terraform Configuration Files

resource "cloudflare_record" "foobar" {
  zone_id = cloudflare_zone.main.id
  name    = "test.site"
  type    = "A"

  dynamic "data" {
    for_each = var.record_data != null ? [var.record_data] : []
    content {
      values = data.value.field
    }
  }
}

Expected Behavior

A new record created

Actual Behavior

Error:

Error: Unsupported block type

  on main.tf line 34, in resource "cloudflare_record" "foobar":
  34:   dynamic "data" {

Blocks of type "data" are not expected here.

Steps to Reproduce

  1. terraform init
  2. terraform plan

Important Factoids

My idea to have one cloudflare_record resource described, but it should create multiple records depending on the configuration.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

In general - if you see some strange errors, try to do the same via UI In that case, you can’t create a proxied A record with the private IP address.