Giter VIP home page Giter VIP logo

Comments (5)

mzupan avatar mzupan commented on July 26, 2024 2

This seems like a work around

resource "digitalocean_tag" "elk" {
  name = "elk"
}

resource "digitalocean_tag" "region" {
  name = "${var.region}"
}

resource "digitalocean_droplet" "elk" {
  count              = "${var.count}"
  image              = "${var.image}"
  region             = "${var.region}"
  name               = "..."
  size               = "${var.size}"
  private_networking = true
  ipv6               = true
  ssh_keys           = ["${split(",", var.ssh_keys)}"]
  tags               = ["${digitalocean_tag.elk.id}", "${digitalocean_tag.region.id}"]
}

from terraform-provider-digitalocean.

mzupan avatar mzupan commented on July 26, 2024

Seeing the same thing

module.elk-nyc3.digitalocean_droplet.elk[1]: Modifying... (ID: 82998399)
  tags.#: "1" => "2"
  tags.1: "" => "nyc3"
module.elk-nyc3.digitalocean_droplet.elk[2]: Modifying... (ID: 82998398)
  tags.#: "1" => "2"
  tags.1: "" => "nyc3"
module.elk-nyc3.digitalocean_droplet.elk[0]: Modifying... (ID: 82998397)
  tags.#: "1" => "2"
  tags.1: "" => "nyc3"

Error: Error applying plan:

3 error(s) occurred:

* module.elk-nyc3.digitalocean_droplet.elk[0]: 1 error(s) occurred:

* digitalocean_droplet.elk.0: Error updating tags: POST https://api.digitalocean.com/v2/tags/nyc3/resources: 404 The resource you were accessing could not be found.
* module.elk-nyc3.digitalocean_droplet.elk[1]: 1 error(s) occurred:

* digitalocean_droplet.elk.1: Error updating tags: POST https://api.digitalocean.com/v2/tags/nyc3/resources: 404 The resource you were accessing could not be found.
* module.elk-nyc3.digitalocean_droplet.elk[2]: 1 error(s) occurred:

* digitalocean_droplet.elk.2: Error updating tags: POST https://api.digitalocean.com/v2/tags/nyc3/resources: 404 The resource you were accessing could not be found.

Version info

$ terraform version
Terraform v0.11.1
+ provider.digitalocean v0.1.3

from terraform-provider-digitalocean.

mzupan avatar mzupan commented on July 26, 2024

To add on.. it seems to only happen with more then one tag

works

  tags               = ["elk"]

Does not work

tags               = ["elk", "${var.region}"]

from terraform-provider-digitalocean.

holms avatar holms commented on July 26, 2024

It's actually mentioned in docs that tag has to be created first. But this could crash gracefully by providing same info in the output.

from terraform-provider-digitalocean.

andrewsomething avatar andrewsomething commented on July 26, 2024

Terraform upstream has closed their side of this issue with:

Prior to Terraform 0.12 there were some missing validation rules in the SDK that were causing these crashes. From 0.12 onwards, the type checking validations are handled by Terraform Core itself and so it's no longer possible to hit these crashing codepaths.

The parts of Terraform that deal with validation were changed significantly in Terraform 0.12, so if you see any similar problems with validation rules in Terraform 0.12.0 or later, please open a new issue so we can capture an updated set of debug information about the new situation. Because the codepath that was crashing here should no longer run in Terraform 0.12, we're going to close this now.

On the DO provider side, I think we can close this out as well. For the first piece about tags, the DigitalOcean API has been updated so that if you specify a tag for a Droplet that doesn't exist it will be created automatically. For the second piece leading to the crash, as upstream mentions there have been significant changes in Terraform 0.12. The config below works with the new Terraform 0.12 syntax.

If you're still running into related issues, please feel free to open a new issue.

variable "environment" {
  description = "this environment"
  default     = "poc1"
}

# Get CloudFlare IPs 
data "http" "cf_ip4" {
  url = "https://www.cloudflare.com/ips-v4"
}

data "http" "cf_ip6" {
  url = "https://www.cloudflare.com/ips-v6"
}

# Get my IP
data "http" "myip" {
  url = "https://ident.me/"
}

resource "digitalocean_droplet" "web" {
  name               = "web-1-${var.environment}"
  size               = "512mb"
  image              = "ubuntu-14-04-x64"
  region             = "lon1"
  tags               = ["web", var.environment]
  ipv6               = false
  private_networking = false
}

resource "digitalocean_firewall" "web" {
  name = "onlyMeAndCf"

  tags = ["web"]

  inbound_rule {
    protocol         = "tcp"
    port_range       = "443"
    source_addresses = split(",",join(",",split("\n", trimspace(data.http.cf_ip4.body)), split("\n", trimspace(data.http.cf_ip6.body))))
  }
  inbound_rule {
    protocol         = "tcp"
    port_range       = "22"
    source_addresses = [data.http.myip.body]
  }
}

from terraform-provider-digitalocean.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.