hashicorp / terraform-provider-docker

As part of our introduction to self-service publishing in the Terraform Registry, this copy of the provider has been archived, and ownership has been transferred to active maintainers in the community. Please see the new location on the Terraform Registry: https://registry.terraform.io/providers/kreuzwerker/docker/latest
https://registry.terraform.io/providers/kreuzwerker/docker/latest
Mozilla Public License 2.0
132 stars 91 forks source link

Update documentation to reflect changes in TF v12. #228

Closed wkokolis closed 4 years ago

wkokolis commented 4 years ago

Terraform Version

Terraform v0.12.17

Affected Resource(s)

Terraform Configuration Files

resource "docker_service" "service" {
  name                          = "service"
  task_spec {
    container_spec {
      image                     = "${var.registry}/${var.image}:${var.tag}"
    }
    restart_policy              {
      condition                 = "on-failure"
      delay                     = "10s"
      max_attempts              = 5
      window                    = "10s"
    }
    force_update                = 0
  }
  mode {
    replicated {
      replicas                  = 1
    }
  }
  update_config {
    parallelism                 = 1
    delay                       = "10s"
    failure_action              = "pause"
    monitor                     = "5s"
    max_failure_ratio           = "0.1"
    order                       = "start-first"
  }
  rollback_config {
    parallelism                 = 1
    delay                       = "5ms"
    failure_action              = "pause"
    monitor                     = "10h"
    max_failure_ratio           = "0.9"
    order                       = "stop-first"
  }
  endpoint_spec {
    mode                        = "vip"
    ports {
      protocol                  = "tcp"
      target_port               = "80"
      published_port            = "80"
      publish_mode              = "ingress"
    }
  }
}

Expected Behavior

Validation passes

Actual Behavior

Validation fails

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform validate

Fix

Change this code:

    restart_policy              {
      condition                 = "on-failure"
      delay                     = "10s"
      max_attempts              = 5
      window                    = "10s"
    }

to this:

    restart_policy              = {
      condition                 = "on-failure"
      delay                     = "10s"
      max_attempts              = 5
      window                    = "10s"
    }

Important Factoids

This should be a quick documentation fix. Something along the lines of a note mentioning that Terraform 12 expects restart_policy to have an equal sign before the opening curly brace.

mavogel commented 4 years ago

Thanks for pointing this one out :)