Skip to content
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

Changed host ip lookup to IPv4 #17

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ resource "aws_key_pair" "cdp_keypair" {

# ------- Lookup public ip for ingress settings if ingress_extra_cidrs_and_ports variable is not specified
locals {
# flag to determine if public ip lookup should be performed for ingress
# flag to determine if public ip of host should be used for ingress
lookup_ip = var.ingress_extra_cidrs_and_ports == null ? true : false

# ingress value
ingress_extra_cidrs_and_ports = (
local.lookup_ip == false ?
var.ingress_extra_cidrs_and_ports :
{ cidrs = ["${data.http.my_ip[0].response_body}/32"],
{ cidrs = ["${chomp(data.http.my_ip[0].response_body)}/32"],
ports = [443, 22]
}
)
Expand All @@ -142,6 +142,5 @@ locals {
data "http" "my_ip" {
count = local.lookup_ip ? 1 : 0

url = "https://ifconfig.me/ip"
url = "https://ipv4.icanhazip.com"
}

6 changes: 3 additions & 3 deletions azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ resource "local_sensitive_file" "pem_file" {

# ------- Lookup public ip for ingress settings if ingress_extra_cidrs_and_ports variable is not specified
locals {
# flag to determine if public ip lookup should be performed for ingress
# flag to determine if public ip of host should be used for ingress
lookup_ip = var.ingress_extra_cidrs_and_ports == null ? true : false

# ingress value
ingress_extra_cidrs_and_ports = (
local.lookup_ip == false ?
var.ingress_extra_cidrs_and_ports :
{ cidrs = ["${data.http.my_ip[0].response_body}/32"],
{ cidrs = ["${chomp(data.http.my_ip[0].response_body)}/32"],
ports = [443, 22]
}
)
Expand All @@ -130,5 +130,5 @@ locals {
data "http" "my_ip" {
count = local.lookup_ip ? 1 : 0

url = "https://ifconfig.me/ip"
url = "https://ipv4.icanhazip.com"
}
6 changes: 3 additions & 3 deletions gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ resource "local_sensitive_file" "pem_file" {

# ------- Lookup public ip for ingress settings if ingress_extra_cidrs_and_ports variable is not specified
locals {
# flag to determine if public ip lookup should be performed for ingress
# flag to determine if public ip of host should be used for ingress
lookup_ip = var.ingress_extra_cidrs_and_ports == null ? true : false

# ingress value
ingress_extra_cidrs_and_ports = (
local.lookup_ip == false ?
var.ingress_extra_cidrs_and_ports :
{ cidrs = ["${data.http.my_ip[0].response_body}/32"],
{ cidrs = ["${chomp(data.http.my_ip[0].response_body)}/32"],
ports = [443, 22]
}
)
Expand All @@ -117,5 +117,5 @@ locals {
data "http" "my_ip" {
count = local.lookup_ip ? 1 : 0

url = "https://ifconfig.me/ip"
url = "https://ipv4.icanhazip.com"
}