You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terraform module that returns your external information by any echoip API.
@@ -9,6 +10,89 @@ Terraform module that returns your external information by any echoip API.
9
10
1. Get your external public IP address (and other related information).
10
11
1. Use any echoip APIs ([ipconfig.io](https://ipconfig.io), [ifconfig.co](https://ifconfig.co), etc.).
11
12
13
+
## Usage
14
+
15
+
Example mininal usage:
16
+
17
+
```hcl
18
+
module "echoip" {
19
+
source = "tobiasehlert/echoip/http"
20
+
}
21
+
```
22
+
23
+
The modules output can then be used in some other module or resource.
24
+
25
+
Example of use with DigitalOcean firewall:
26
+
27
+
```hcl
28
+
resource digitalocean_firewall "home_ssh" {
29
+
name = "home_ssh"
30
+
inbound_rule {
31
+
protocol = "tcp"
32
+
port_range = "22"
33
+
source_addresses = ["${module.echoip.ip}/32"]
34
+
}
35
+
}
36
+
```
37
+
38
+
## Examples
39
+
40
+
-[default](https://github.com/tobiasehlert/terraform-http-echoip/blob/main/examples/default/README.md) – This is an example of how to use the module with the defaults.
41
+
-[ifconfig.co](https://github.com/tobiasehlert/terraform-http-echoip/blob/main/examples/ifconfig.co/README.md) – This is an example of how to use the module with another echoip service.
| <aname="input_http_method"></a> [http\_method](#input\_http\_method)| HTTP method to use for the request |`string`|`"GET"`| no |
72
+
| <aname="input_http_request_headers"></a> [http\_request\_headers](#input\_http\_request\_headers)| HTTP headers to send with the request |`map(any)`| <pre>{<br> "Accept": "application/json"<br>}</pre> | no |
73
+
| <aname="input_http_url"></a> [http\_url](#input\_http\_url)| URL for echoip service to use. |`string`|`"https://ipconfig.io"`| no |
74
+
75
+
## Outputs
76
+
77
+
| Name | Description |
78
+
|------|-------------|
79
+
| <aname="output_asn"></a> [asn](#output\_asn)| The `asn` field of the echoip response. |
80
+
| <aname="output_asn_org"></a> [asn\_org](#output\_asn\_org)| The `asn_org` field of the echoip response. |
81
+
| <aname="output_city"></a> [city](#output\_city)| The `city` field of the echoip response. |
82
+
| <aname="output_country"></a> [country](#output\_country)| The `country` field of the echoip response. |
83
+
| <aname="output_country_eu"></a> [country\_eu](#output\_country\_eu)| The `country_eu` field of the echoip response. |
84
+
| <aname="output_country_iso"></a> [country\_iso](#output\_country\_iso)| The `country_iso` field of the echoip response. |
85
+
| <aname="output_ip"></a> [ip](#output\_ip)| The `ip` field of the echoip response. |
86
+
| <aname="output_ip_decimal"></a> [ip\_decimal](#output\_ip\_decimal)| The `ip_decimal` field of the echoip response. |
87
+
| <aname="output_latitude"></a> [latitude](#output\_latitude)| The `latitude` field of the echoip response. |
88
+
| <aname="output_longitude"></a> [longitude](#output\_longitude)| The `longitude` field of the echoip response. |
89
+
| <aname="output_region_code"></a> [region\_code](#output\_region\_code)| The `region_code` field of the echoip response. |
90
+
| <aname="output_region_name"></a> [region\_name](#output\_region\_name)| The `region_name` field of the echoip response. |
91
+
| <aname="output_time_zone"></a> [time\_zone](#output\_time\_zone)| The `time_zone` field of the echoip response. |
92
+
| <aname="output_user_agent"></a> [user\_agent](#output\_user\_agent)| The `user_agent` field of the echoip response. |
93
+
| <aname="output_zip_code"></a> [zip\_code](#output\_zip\_code)| The `zip_code` field of the echoip response. |
94
+
<!-- END_TF_DOCS -->
95
+
12
96
## Credits
13
97
14
98
- Authors: Tobias Lindberg – [List of contributors](https://github.com/tobiasehlert/terraform-http-echoip/graphs/contributors)
0 commit comments