Terraform module that returns your external information by any echoip API.
- Get your external public IP address (and other related information).
- Use any echoip APIs (ipconfig.io, ifconfig.co, etc.).
Example mininal usage:
module "echoip" {
source = "tobiasehlert/echoip/http"
}
The modules output can then be used in some other module or resource.
Example of use with DigitalOcean firewall:
resource digitalocean_firewall "home_ssh" {
name = "home_ssh"
inbound_rule {
protocol = "tcp"
port_range = "22"
source_addresses = ["${module.echoip.ip}/32"]
}
}
- default – This is an example of how to use the module with the defaults.
- ifconfig.co – This is an example of how to use the module with another echoip service.
Name | Version |
---|---|
terraform | >= 1.2 |
http | ~> 3.4.0 |
Name | Version |
---|---|
http | ~> 3.4.0 |
No modules.
Name | Type |
---|---|
http_http.echoip | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
http_method | HTTP method to use for the request | string |
"GET" |
no |
http_request_headers | HTTP headers to send with the request | map(any) |
{ |
no |
http_url | URL for echoip service to use. | string |
"https://ipconfig.io" |
no |
Name | Description |
---|---|
asn | The asn field of the echoip response. |
asn_org | The asn_org field of the echoip response. |
city | The city field of the echoip response. |
country | The country field of the echoip response. |
country_eu | The country_eu field of the echoip response. |
country_iso | The country_iso field of the echoip response. |
ip | The ip field of the echoip response. |
ip_decimal | The ip_decimal field of the echoip response. |
latitude | The latitude field of the echoip response. |
longitude | The longitude field of the echoip response. |
region_code | The region_code field of the echoip response. |
region_name | The region_name field of the echoip response. |
time_zone | The time_zone field of the echoip response. |
user_agent | The user_agent field of the echoip response. |
zip_code | The zip_code field of the echoip response. |
- Authors: Tobias Lindberg – List of contributors
- Distributed under MIT License