Comments (5)
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.
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.
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.
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.
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)
- digitalocean_spaces_bucket_cors_configuration: Updating allowed origins has no effect HOT 4
- Add optional "signature" field for `digitalocean_custom_image` resources
- Missing registry_credentials in digitalocean_app.service.image for registry_type = "GHCR" HOT 4
- feature: resource for firewall rule
- digitalocean_cdn custom domain certificate fails "invalid certificate issued by Cloudflare origin CA" HOT 1
- Add Postgres database attributes HOT 2
- digitalocean_spaces_bucket_cors_configuration: Does not allow to order CORS rules
- `digitalocean_project` created on failure, absent from TF state HOT 2
- App Platform image credentials set as required HOT 3
- Dedicated egress IP addresses support for App platform
- digitalocean_spaces_bucket NoSuchBucket while creating bucket HOT 3
- digitalocean_kubernetes_cluster. to support database operator HOT 2
- Consider adding GPG key to OpenTofu registry for the digitalocean provider HOT 2
- Support for database fork
- digitalocean_firewall blocks all ports
- digitalocean_ssh_key race condition (roduced an unexpected new value: Root object was present, but now absent) HOT 1
- digitalocean_database_cluster password is always empty HOT 5
- functions: feature: add resource, and data source for functions and namespaces
- Add OpenSearch Documentation
- digitalocean_app panic HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-digitalocean.