New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Icanhazip data source #14936

Closed
wants to merge 5 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@deanwilson
Contributor

deanwilson commented May 30, 2017

I often need to have my AWS security groups update their "from" lines to suit the IP my ISP has assigned me. While this can be done out of bounds, or via a local exec, I'd rather have Terraform manage this via a data source.

Any feedback would be greatly welcomed.

deanwilson added some commits May 30, 2017

Add basic tests
This confirms that an IP address can be retrieved and looks like
a valid IP.
Add version attribute to specify IP version
This allows you to retrieve either an IPv4 or IPv6 address as required.
@cemo

This comment has been minimized.

Show comment
Hide comment
@cemo

cemo Jun 1, 2017

There are some other ip providers such as:

It might be better to support all of them with a sensible default. User can change its ip provider?

cemo commented Jun 1, 2017

There are some other ip providers such as:

It might be better to support all of them with a sensible default. User can change its ip provider?

@apparentlymart

This comment has been minimized.

Show comment
Hide comment
@apparentlymart

apparentlymart Jun 1, 2017

Contributor

Hi @deanwilson! Thanks for working on this.

I do share a little @cemo's concern that there are lots of "what is my ip?" services, and it feels weird to play favorites with one in particular, but equally weird to have a separate provider for each one given how simple they all are.

But when I thought about how this would generalize, I realized that ultimately most of these are just an HTTP request that returns a plaintext response. So maybe this would reduce to just being the http data source?

data "http" "example" {
  url = "https://ifconfig.co/ip"
}

Would it work to combine this with the chomp function to get the same information without a specialized provider?

Contributor

apparentlymart commented Jun 1, 2017

Hi @deanwilson! Thanks for working on this.

I do share a little @cemo's concern that there are lots of "what is my ip?" services, and it feels weird to play favorites with one in particular, but equally weird to have a separate provider for each one given how simple they all are.

But when I thought about how this would generalize, I realized that ultimately most of these are just an HTTP request that returns a plaintext response. So maybe this would reduce to just being the http data source?

data "http" "example" {
  url = "https://ifconfig.co/ip"
}

Would it work to combine this with the chomp function to get the same information without a specialized provider?

@cemo

This comment has been minimized.

Show comment
Hide comment
@cemo

cemo Jun 2, 2017

@apparentlymart this is nicer. 👍

cemo commented Jun 2, 2017

@apparentlymart this is nicer. 👍

@deanwilson

This comment has been minimized.

Show comment
Hide comment
@deanwilson

deanwilson Jun 8, 2017

Contributor

I think you're right, and this should be approached in a different way. Thank you both for taking the time to look it over. I'll close this one and come back with something hopefully better.

Contributor

deanwilson commented Jun 8, 2017

I think you're right, and this should be approached in a different way. Thank you both for taking the time to look it over. I'll close this one and come back with something hopefully better.

@deanwilson deanwilson closed this Jun 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment