Comments (5)
I've been tearing apart my code bit by bit, and I've isolated it to this part.
filter_chains.tf:
resource "ns1_datafeed" "filter_chain" {
for_each = var.monitor_to_ip_and_record
name = each.key
source_id = ns1_datasource.datasource[var.record_to_pagerduty_service[each.value.record]].id
config = {
jobid = ns1_monitoringjob.filter_chain[each.key].id
}
}
resource "ns1_monitoringjob" "filter_chain" {
for_each = var.monitor_to_ip_and_record
active = true
regions = ["dal", "sin", "sjc", "lga", "ams"]
job_type = "tcp"
frequency = 60
rapid_recheck = true
policy = "quorum"
notify_failback = true
name = each.key
# notify_list = ns1_notifylist.notifylist[var.record_to_pagerduty_service[each.value.record]].id
# notify_regional = false
# rules {
# comparison = "contains"
# key = "output"
# value = "OK"
# }
# rules {
# comparison = "<"
# key = "connect"
# value = "5000"
# }
config = {
ssl = "1"
# send = "GET /info/healthcheck?source=ns1/ HTTP/1.1\r\nHost: ${var.record_to_host_header[each.value.record]}\r\n\r\n"
host = each.value.ip
port = "443"
}
}
variables.tf.json:
{
"variable": {
"monitor_to_ip_and_record": {
"default": {
"Americas Jobsearch pdxprod1-offload1001": {
"ip": "35.165.48.217",
"record": "americas"
},
"Americas Jobsearch pdxprod1-offload1002": {
"ip": "35.162.238.247",
"record": "americas"
}
}
}
}
}
I've been commenting out parts, but it seems to be throwing the divide by zero error from the main foreach:
resource "ns1_monitoringjob" "filter_chain" {
for_each = var.monitor_to_ip_and_record
from terraform-provider-ns1.
I had it wrong above. This works:
{
"variable": {
"monitor_to_ip_and_record": {
"default": {
"Americas Jobsearch pdxprod1-offload1001": {
"ip": "35.165.48.217",
"record": "americas"
},
"Americas Jobsearch pdxprod1-offload1002": {
"ip": "35.162.238.247",
"record": "americas"
},
"Americas Jobsearch pdxprod1-offload1003": {
"ip": "54.203.219.73",
"record": "americas"
}
}
}
}
}
This throws the error, however:
{
"variable": {
"Americas Jobsearch pdxprod1-offload1001": {
"ip": "35.165.48.217",
"record": "americas"
},
"Americas Jobsearch pdxprod1-offload1002": {
"ip": "35.162.238.247",
"record": "americas"
},
"Americas Jobsearch pdxprod1-offload1003": {
"ip": "54.203.219.73",
"record": "americas"
},
"Americas Jobsearch cmh-offload1001": {
"ip": "18.216.114.70",
"record": "americas"
},
"Americas Jobsearch cmh-offload1002": {
"ip": "3.17.53.43",
"record": "americas"
},
"Americas Jobsearch cmh-offload1003": {
"ip": "18.218.22.89",
"record": "americas"
}
}
}
}
}
from terraform-provider-ns1.
Sorry for the delayed response. We haven't tracked this problem all the way to the bottom yet, but we've released v1.13.2-pre1 which should prevent the crash. As it's a prerelease, you'll need to specify the version explicitly in your resource file:
source = "ns1-terraform/ns1"
version = "1.13.2-pre1"
If this doesn't solve the problem, please generate logs with TF_LOG=debug NS1_DEBUG=1 terraform apply ...
and submit them via an NS1 support ticket.
from terraform-provider-ns1.
Release 1.13.2-pre2 should fix this by adding retries for 502/503 errors (which exposed the divide-by-zero bug fixed in 1.13.2-pre1).
from terraform-provider-ns1.
Closing, this fixed in 1.13.2-pre2 and above.
from terraform-provider-ns1.
Related Issues (20)
- Acceptance Testing HOT 7
- `ns1_monitoringjob` does not persist `tls_add_verify` in the Terraform statefile HOT 4
- DNSKEY and RRSIG rr types are not supported
- some resources don't have import implemented HOT 1
- ns1_monitoringjob regions are unordered and nondeterministic HOT 5
- account_manage_plan shows deprecation on team HOT 1
- NS1 provider is not creating the user correctly HOT 3
- CAA records cannot have a space after domain HOT 1
- Linked records are force-recreated when "link" argument is modified HOT 4
- Add data source for Monitoring Regions HOT 2
- Feature Request - resource for "GLOBAL IP ALLOW LISTS" HOT 1
- Feature Request - Auto-Generated feed ID when creating ns1_monitoringjob HOT 2
- Add support for resource tags HOT 1
- Can't pull provider from registry due to checksums HOT 6
- Inconsistent Filter Chain State HOT 2
- Getting a TCP connect error on destroy
- ns1_notifylist notifications objects are not supposed to be ordered and deterministic HOT 2
- v2.0.9 of the Provider is a breaking change / not backwards compatible HOT 3
- Seeing a large number of HTTP "GOAWAY" errors when refreshing NS1 resources.
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-ns1.