Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Data Resource To Get Elastic Cloud Static IPS #804

Open
emoshaya opened this issue Apr 3, 2024 · 0 comments
Open

New Data Resource To Get Elastic Cloud Static IPS #804

emoshaya opened this issue Apr 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@emoshaya
Copy link

emoshaya commented Apr 3, 2024

Overview

We would like to access Elastic Cloud's rangs of static ip addresses currently published here: https://ips.cld.elstc.co/ described here. This will allow us to dynamically pull the latest ip addresses for elastic cloud servers to add to our security group rules for whitelisting purposes. This would be a similar data resources to https://registry.terraform.io/providers/env0/env0/latest/docs/data-sources/ip_ranges offered by the env0 provider.

Possible Implementation

data "ec_ip_ranges" "test" {}

Context

Our workaround was to use the anschoewe/curl provider as follows:

data "curl" "this" {
  count       = var.enable ? 1 : 0
  http_method = "GET"
  uri         = "https://ips.cld.elstc.co/"
}

output "curl" {
  value = jsondecode(data.curl.this[0].response).regions.aws-us-west-2.egress_from_elastic
}
@emoshaya emoshaya added the enhancement New feature or request label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant