Terraform provider for getting your current external IP as a data source.
Follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init
to initialize it.
data "extip" "external_ip" {
}
output "external_ip" {
value = data.extip.external_ip.ipaddress
}
Gives the result:
data.extip.external_ip: Refreshing state...
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Outputs:
external_ip = 238.209.109.16
You can also specify what resolver you want to use to get the URL:
data "extip" "external_ip_from_aws" {
resolver = "https://checkip.amazonaws.com/"
}
output "external_ip_from_aws" {
value = data.extip.external_ip_from_aws.ipaddress
}
Examples are under /examples.
Clone and build the repository
go get github.com/petems/terraform-provider-extip
make build
Symlink the binary to your terraform plugins directory:
ln -s $GOPATH/bin/terraform-provider-extip ~/.terraform.d/plugins/
go get -u github.com/petems/terraform-provider-extip
make build
Add configuration of the consensus timing (ie. how long it will wait to resolve)#5Add option of getting ipv6 or ipv4 ipaddressValidate if returned address is a valid IP #10
- Write code
- Run tests:
make test
- Build the binary:
make build
\ - Open a pull-request