Skip to content

Commit 769fb3a

Browse files
committed
make vpc_dns_ip optional
1 parent 9b6d0cb commit 769fb3a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

certs/templates/user_data.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
runcmd:
33
- export INSTANCE_ID=`curl http://169.254.169.254/latest/meta-data/instance-id`
44
- echo "OPENVPN_CERT_SOURCE=s3://${replace(s3_bucket,"/(/)+$/","")}/${replace(s3_bucket_prefix,"/^(/)+|(/)+$/","")}" > /etc/openvpn/get-openvpn-certs.env
5-
- echo "push \"dhcp-option DNS ${vpc_dns_ip}\"" >> /etc/openvpn/server.conf
5+
- if [ -n "${vpc_dns_ip}" ]; then echo "push \"dhcp-option DNS ${vpc_dns_ip}\"" >> /etc/openvpn/server.conf;fi
66
- echo 'crl-verify /etc/openvpn/keys/crl.pem' >> /etc/openvpn/server.conf
77
- 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
88
- 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ variable "ssh_whitelist" {
107107
variable "vpc_dns_ip" {
108108
type = "string"
109109
description = "DNS IP address for the VPC."
110+
default = ""
110111
}
111112

112113
variable "vpn_whitelist" {

0 commit comments

Comments
 (0)