I searched for "stackdriver" in issues but found none.
Something similar to Fastly's: https://www.terraform.io/docs/providers/fastly/d/ip_ranges.html.
Does not exist yet: stackdriver_ip_ranges
data "stackdriver_ip_ranges" "stackdriver" {
project = "some-project"
}
resource "aws_security_group" "from_stackdriver" {
name = "from_stackdriver"
ingress {
from_port = "443"
to_port = "443"
protocol = "tcp"
cidr_blocks = ["${data.stackdriver_ip_ranges.stackdriver.cidr_blocks}"]
}
}
Get the current set of IP addresses used for uptime checking by Stackdriver.
https://cloud.google.com/monitoring/alerts/uptime-checks#get-ips
This seems possible with the new Stackdriver monitoring API: https://cloud.google.com/monitoring/api/ref_v3/rest/v3/uptimeCheckIps/list
Happy to implement if someone could point me in a way if I missed anything.
Moved from: https://github.com/hashicorp/terraform/issues/12728
I can probably give this a go using these as examples:
google_compute_lb_ip_ranges is probably the closest to what you're after I think?
@srivasta
@tonglil I can have a go sometime next week, if you don't get to this by then. I am planning on adding Stackdriver monitoing and dashboard resources to terraform (this is gated by having the currently alpha Stackdriver API going general availability), this seems like is is in the same realm of work.
I can try and flex my muscles here if you want to focus on the rest of the SD resources (group creation + dashboard resources would be something fantastic to start using).
@tonglil @srivasta Came across this while looking for the same data source.
Have a WIP version here:
https://github.com/markosamuli/terraform-provider-google/commit/be208c416c12836ede6b16057e478842dee464cd
Prefixed with with google_ as couldn't figure out how to get it working otherwise.
@srivasta @tonglil I've created a PR for this data source.
Does this conflict with any other work your planning to do? I've used naming convention from the API.
The project attribute in the data source looks obsolete, unless I've missed something.
Example:
data "google_stackdriver_uptime_check_ips" "stackdriver" {}
resource "google_compute_firewall" "monitoring" {
name = "allow-traffic-from-stackdriver-monitoring"
network = "${google_compute_network.other.name}"
allow {
protocol = "tcp"
ports = ["443"]
}
source_ranges = ["${data.google_stackdriver_uptime_check_ips.stackdriver.uptime_check_ips}"]
target_tags = ["allow-traffic-from-stackdriver-monitoring"]
}
If we're adding uptime checks is it easy enough to add support for alert policies?
FYI, it seems that REST API for listing Uptime Check IPs has been implemented since May 2019.
https://cloud.google.com/monitoring/api/ref_v3/rest/v3/uptimeCheckIps/list
@danawillow can we add this soon ? it would be very useful
Pings on issues aren't the best way to get something prioritized, unfortunately. If there's a customer request you can file it internally with our team, otherwise we prioritize based on 👍s.
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
Most helpful comment
If we're adding uptime checks is it easy enough to add support for alert policies?