- Notifications
You must be signed in to change notification settings - Fork0
A terraform module to reliably get my ip (v4 and/or v6) even when some services could fail or give wrong answers or you have hashed connections.
License
atrull/terraform-overbuilt-getmyip
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This module polls a series of fairly well known but occasionally unreliable 'what is my ip' services. It then produces the most common response that is a valid ipv4 or ipv6 address (both outputs are separately provided).
Especially useful if you have connection hashing - the distinct matches outputs will provide a list of your current public source addresses.
Name | Version |
---|---|
terraform | ~> 1.0 |
curl2 | ~> 1.6 |
external | ~> 2.3.1 |
http | ~> 3 |
Name | Version |
---|---|
curl2 | 1.6.1 |
external | 2.3.5 |
http | 3.5.0 |
No modules.
Name | Type |
---|---|
curl2_curl2.myip | data source |
external_external.external_curl | data source |
http_http.myip | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
data_provider | curl2 orhttp providers are also supported - we recommendexternal_curl because it handles failure better | string | "external_curl" | no |
extra_service_urls | Put your own in here if you want extra ones, this gets merged with theservice_urls list | list(string) | [] | no |
request_timeout | Request timeout in milliseconds | number | 500 | no |
retry_attempts | Request retries | number | 1 | no |
service_urls | List of urls to use for getting our IP (includes both IPv4 and IPv6 services) | list(string) | [ | no |
Name | Description |
---|---|
ipv4 | The most common ipv4 response |
ipv4_all_matches | List of all ipv4 matches (informational/testing) |
ipv4_distinct_matches | List of unique ipv4 matches |
ipv4_frequency_map | Map of IPv4 addresses to their frequency count |
ipv6 | The most common ipv6 response |
ipv6_all_matches | List of all ipv6 matches (informational/testing) |
ipv6_distinct_matches | List of unique ipv6 matches |
ipv6_frequency_map | Map of IPv6 addresses to their frequency count |
service_statistics | Statistics about service responses |
The goal of this module is to provide a valid-enough answer even when the internet does what the internet does, which is to be flaky and broken somewhere, sometime.
Neither thecurl2
norhttp
providers are perfectly suited to the internet since they will fail a run if the url doesn't respond and/or the url doesn't resolve. Thecurl2
provider is slightly more reliable than thehttp
provider. This failure mode makes sense if it's a critical part of your terraform..
Both ofcurl2
andhttp
providers are provided as a matter of them being possibly better in the future if/when they have someignore_failure
options.
Since we're aggregating results to achieve a 'most common' response it frankly shouldn't matter if one of the endpoints in the list fails to respond - we will have gathered enough data to make a good response. Let the build roll on!
As such we implement anexternal_curl
using theexternal
provider and a shim scriptexternal_curl.sh
, which will survive a truly non-resolving non-responsive endpoint by faking the response data, which will be filtered out later by ouripv4_matches
andipv6_matches
filters.
Alex Trull (firstname@lastname.org)
BSD-3
The failed builds because the myip service I had chosen wasn't working or there was a routing error in the pipeline. I owe it all to you!
- I am very fond of you all.
About
A terraform module to reliably get my ip (v4 and/or v6) even when some services could fail or give wrong answers or you have hashed connections.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.