Skip to content

Commit c65a208

Browse files
authored
Merge pull request #10 from WhistleLabs/kj-openvpn-dns
Add configurable DNS configuration
2 parents cfba039 + 8b0c44e commit c65a208

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Unreleased
22

3+
## 0.2.0
4+
5+
#### IMPROVEMENTS:
6+
- Update server.conf with VPC DNS IP address
7+
38
## 0.1.0
49

510
#### BREAKING CHANGES:

certs/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ data "template_file" "user_data" {
196196
s3_bucket = "${var.s3_bucket}"
197197
s3_bucket_prefix = "${var.s3_bucket_prefix}"
198198
route_cidrs = "${var.route_cidrs}"
199+
vpc_dns_ip = "${var.vpc_dns_ip}"
199200
}
200201
}
201202

certs/templates/user_data.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## https://github.com/WhistleLabs/terraform-aws-openvpn/pull/2
44
runcmd:
55
- echo "OPENVPN_CERT_SOURCE=s3://${replace(s3_bucket,"/(/)+$/","")}/${replace(s3_bucket_prefix,"/^(/)+|(/)+$/","")}" > /etc/openvpn/get-openvpn-certs.env
6+
- echo 'push \"dhcp-option DNS ${vpc_dns_ip}\"' >> /etc/openvpn/server.conf
67
- echo 'crl-verify /etc/openvpn/keys/crl.pem' >> /etc/openvpn/server.conf
78
- echo "push \"route $(ip route get 8.8.8.8| grep src| sed 's/.*src \(.*\)$/\1/g') 255.255.255.255 net_gateway\"" >> /etc/openvpn/server.conf
89
- echo "push \"route ${cidrhost(element(split(",",route_cidrs),1), 0)} ${cidrnetmask(element(split(",",route_cidrs),1))}\"" >> /etc/openvpn/server.conf

certs/variables.tf

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,20 @@ variable "s3_bucket_prefix" {
7474
default = ""
7575
}
7676

77-
variable "vpn_whitelist" {
77+
variable "ssh_whitelist" {
7878
type = "string"
79-
description = "Limit VPN access to the designated list of CIDRs"
79+
description = "Limit SSH access to the designated list of CIDRs"
8080
default = "0.0.0.0/0"
8181
}
8282

83-
variable "ssh_whitelist" {
83+
variable "vpc_dns_ip" {
8484
type = "string"
85-
description = "Limit SSH access to the designated list of CIDRs"
85+
description = "DNS IP address for the VPC."
86+
}
87+
88+
variable "vpn_whitelist" {
89+
type = "string"
90+
description = "Limit VPN access to the designated list of CIDRs"
8691
default = "0.0.0.0/0"
8792
}
93+

0 commit comments

Comments
 (0)