Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tobiasehlert/terraform-http-echoip
Terraform module that returns your external information by any echoip API.
https://github.com/tobiasehlert/terraform-http-echoip
echoip terraform terraform-module
Last synced: 13 days ago
JSON representation
Terraform module that returns your external information by any echoip API.
- Host: GitHub
- URL: https://github.com/tobiasehlert/terraform-http-echoip
- Owner: tobiasehlert
- License: mit
- Created: 2024-08-06T07:28:47.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-06T10:28:03.000Z (3 months ago)
- Last Synced: 2024-10-17T11:41:54.321Z (29 days ago)
- Topics: echoip, terraform, terraform-module
- Language: HCL
- Homepage: https://registry.terraform.io/modules/tobiasehlert/echoip/http/latest
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# terraform-http-echoip
[![GitHub release](https://img.shields.io/github/v/release/tobiasehlert/terraform-http-echoip?sort=semver&logo=github)](https://github.com/tobiasehlert/terraform-http-echoip/releases)
[![GitHub license](https://img.shields.io/github/license/tobiasehlert/terraform-http-echoip)](https://github.com/tobiasehlert/terraform-http-echoip/blob/main/LICENSE)Terraform module that returns your external information by any echoip API.
## Features
1. Get your external public IP address (and other related information).
1. Use any echoip APIs ([ipconfig.io](https://ipconfig.io), [ifconfig.co](https://ifconfig.co), etc.).## Usage
Example mininal usage:
```hcl
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:
```hcl
resource digitalocean_firewall "home_ssh" {
name = "home_ssh"
inbound_rule {
protocol = "tcp"
port_range = "22"
source_addresses = ["${module.echoip.ip}/32"]
}
}
```## Examples
- [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.
- [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.## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.2 |
| [http](#requirement\_http) | ~> 3.4.0 |## Providers
| Name | Version |
|------|---------|
| [http](#provider\_http) | ~> 3.4.0 |## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [http_http.echoip](https://registry.terraform.io/providers/hashicorp/http/latest/docs/data-sources/http) | data source |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [http\_method](#input\_http\_method) | HTTP method to use for the request | `string` | `"GET"` | no |
| [http\_request\_headers](#input\_http\_request\_headers) | HTTP headers to send with the request | `map(any)` |{| no |
"Accept": "application/json"
}
| [http\_url](#input\_http\_url) | URL for echoip service to use. | `string` | `"https://ipconfig.io"` | no |## Outputs
| Name | Description |
|------|-------------|
| [asn](#output\_asn) | The `asn` field of the echoip response. |
| [asn\_org](#output\_asn\_org) | The `asn_org` field of the echoip response. |
| [city](#output\_city) | The `city` field of the echoip response. |
| [country](#output\_country) | The `country` field of the echoip response. |
| [country\_eu](#output\_country\_eu) | The `country_eu` field of the echoip response. |
| [country\_iso](#output\_country\_iso) | The `country_iso` field of the echoip response. |
| [ip](#output\_ip) | The `ip` field of the echoip response. |
| [ip\_decimal](#output\_ip\_decimal) | The `ip_decimal` field of the echoip response. |
| [latitude](#output\_latitude) | The `latitude` field of the echoip response. |
| [longitude](#output\_longitude) | The `longitude` field of the echoip response. |
| [region\_code](#output\_region\_code) | The `region_code` field of the echoip response. |
| [region\_name](#output\_region\_name) | The `region_name` field of the echoip response. |
| [time\_zone](#output\_time\_zone) | The `time_zone` field of the echoip response. |
| [user\_agent](#output\_user\_agent) | The `user_agent` field of the echoip response. |
| [zip\_code](#output\_zip\_code) | The `zip_code` field of the echoip response. |## Credits
- Authors: Tobias Lindberg – [List of contributors](https://github.com/tobiasehlert/terraform-http-echoip/graphs/contributors)
- Distributed under MIT License