Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Implicit curl dependency can be removed Fixes #9 #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ data "aws_ami" "windows_ami" {
}
}

data "external" "local_ip" {
# curl should (hopefully) be available everywhere
program = ["curl", "https://api.ipify.org?format=json"]
data "http" "local_ip" {
url = "https://api.ipify.org?format=json"
}

locals {
availability_zone = "${var.region}${element(var.allowed_availability_zone_identifier, random_integer.az_id.result)}"
local_ip = jsondecode(data.http.local_ip.response_body).ip
}

resource "random_integer" "az_id" {
Expand Down Expand Up @@ -56,7 +56,7 @@ resource "aws_security_group_rule" "rdp_ingress" {
from_port = 3389
to_port = 3389
protocol = "tcp"
cidr_blocks = ["${data.external.local_ip.result.ip}/32"]
cidr_blocks = ["${local.local_ip}/32"]
security_group_id = aws_security_group.default.id
}

Expand All @@ -67,7 +67,7 @@ resource "aws_security_group_rule" "vnc_ingress" {
from_port = 5900
to_port = 5900
protocol = "tcp"
cidr_blocks = ["${data.external.local_ip.result.ip}/32"]
cidr_blocks = ["${local.local_ip}/32"]
security_group_id = aws_security_group.default.id
}

Expand Down