Skip to content

Commit

Permalink
remove default reliance on icanhazip.com (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
steved authored Jun 7, 2021
1 parent e687fd3 commit bd74aab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 29 deletions.
6 changes: 1 addition & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ terraform {
}
}

data "http" "myip" {
url = "http://ipv4.icanhazip.com"
}

locals {
cluster = var.cluster == null ? terraform.workspace : var.cluster
enable_private_endpoint = length(var.master_authorized_networks_config) == 0
Expand All @@ -20,7 +16,7 @@ locals {
region = length(split("-", var.location)) == 2 ? var.location : substr(var.location, 0, length(var.location) - 2)
zone = length(split("-", var.location)) == 3 ? var.location : format("%s-a", var.location)

authorized_networks = var.allow_local_ip_access ? concat(var.master_authorized_networks_config, [{ "display_name" : "myip", "cidr_block" : "${chomp(data.http.myip.body)}/32" }]) : var.master_authorized_networks_config
authorized_networks = var.master_authorized_networks_config
}

provider "google" {
Expand Down
26 changes: 2 additions & 24 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,35 +141,13 @@ variable "master_authorized_networks_config" {
}))
default = [
{
cidr_block = "12.245.82.18/32"
display_name = "domino-hq"
},
{
cidr_block = "52.206.158.130/32"
display_name = "aviatrix-east"
},
{
cidr_block = "52.25.178.121/32"
display_name = "aviatrix-west"
},
{
cidr_block = "52.56.39.158/32"
display_name = "aviatrix-eu"
},
{
cidr_block = "13.126.91.85/32"
display_name = "aviatrix-ap"
cidr_block = "0.0.0.0/0"
display_name = "global-access"
}
]
description = "Configuration options for master authorized networks. Default is for debugging only, and should be removed for production."
}

variable "allow_local_ip_access" {
type = bool
default = false
description = "Adds firewall rule to allow local access to Kubernetes cluster. This is required when executing terraform outside the master authorized networks."
}

variable "platform_nodes_max" {
type = number
default = 3
Expand Down

0 comments on commit bd74aab

Please sign in to comment.