awslabs / route53-dynamic-dns-with-lambda

A Dynamic DNS system built with API Gateway, Lambda & Route 53.
Apache License 2.0
486 stars 167 forks source link

MacOS issues with publicIP - Solved #26

Closed MaxThroughput closed 5 years ago

MaxThroughput commented 5 years ago

Hey, thanks for all your work here in getting this put together. I used v1 unsuccessfully but had much better luck with v2. I was however running into an issue getting the script to find my public IP. This is running on a MacOS Mojave work station and my public IP resides two hops upstream. I replaced line 163 with "myPublicIP=$(curl ifconfig.me)" which was successful in retrieving the IP from my internet router. Additionally, the very last piece of selection logic fails to get the intended echo. I deleted it so the script runs without any validation message as opposed to the error.

seangreathouse commented 5 years ago

The client makes a simple curl GET to fetch the public IP. On the AWS end, Lambda is is simply reflecting the public address of the request back. If you are going through a proxy, it would be the proxy address. Did you try to execute the command outside the script? (replacing all the variables with your own values) curl -q --$ipVersion -s -H "x-api-key: $apiKey" "$myAPIURL?mode=get"