Skip to content

Commit

Permalink
Remove healthchecks.io references
Browse files Browse the repository at this point in the history
  • Loading branch information
lcollet committed Aug 22, 2019
1 parent 42eff4c commit 8dc4272
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 32 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ This module setups a VPN server for a VPC to connect to instances.

*Before you start to use the module you have to make sure you've created resources below*

* healthchecks.io account and cron entry for monitoring the backup script

After provisioning, don't forget to run commands below:

* **Pritunl setup**
Expand All @@ -22,7 +20,6 @@ After provisioning, don't forget to run commands below:
* **internal_cidrs:** List of CIDRs that will be whitelisted to access the VPN server internally.
* **tags:** Map of AWS Tag key and values
* **resource_name_prefix:** All the resources will be prefixed with the value of this variable
* **healthchecks_io_key:** Health check key for healthchecks.io
* **s3_bucket_name:** Optional bucket name for Pritunl backups

# Outputs
Expand All @@ -47,7 +44,6 @@ module "app_pritunl" {
ami_id = "ami-403e2524"
instance_type = "t2.nano"
resource_name_prefix = "opsgang-pritunl"
healthchecks_io_key = "NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNN"
s3_bucket_name = "i-want-to-override-generated-bucket-name"
whitelist = [
Expand Down
16 changes: 0 additions & 16 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ data "template_file" "user_data" {
vars {
aws_region = "${data.aws_region.current.name}"
s3_backup_bucket = "${local.backup_bucket_name}"
healthchecks_io_key = "/pritunl/${var.resource_name_prefix}/healthchecks-io-key"
}
}

Expand Down Expand Up @@ -71,21 +70,6 @@ resource "aws_kms_alias" "parameter_store" {
target_key_id = "${aws_kms_key.parameter_store.key_id}"
}

resource "aws_ssm_parameter" "healthchecks_io_key" {
name = "/pritunl/${var.resource_name_prefix}/healthchecks-io-key"
type = "SecureString"
value = "${var.healthchecks_io_key}"
key_id = "${aws_kms_key.parameter_store.arn}"
overwrite = true

tags = "${
merge(
map("Name", format("%s/%s/%s", "pritunl", var.resource_name_prefix, "healthchecks-io-key")),
var.tags,
)
}"
}

resource "aws_s3_bucket" "backup" {
depends_on = ["aws_kms_key.parameter_store"]

Expand Down
8 changes: 1 addition & 7 deletions templates/user_data.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,7 @@ chmod 700 /usr/sbin/mongobackup.sh
cat <<EOF > /etc/cron.daily/pritunl-backup
#!/bin/bash -e
export PATH="/usr/local/sbin:/usr/local/bin:\$PATH"
mongobackup.sh && \
curl -fsS --retry 3 \
"https://hchk.io/\$( aws --region=${aws_region} --output=text \
ssm get-parameters \
--names ${healthchecks_io_key} \
--with-decryption \
--query 'Parameters[*].Value')"
mongobackup.sh
EOF
chmod 755 /etc/cron.daily/pritunl-backup

Expand Down
5 changes: 0 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ variable "resource_name_prefix" {
default = "pritunl"
}

variable "healthchecks_io_key" {
description = "Health check key for healthchecks.io"
default = "invalid"
}

variable "internal_cidrs" {
description = "[List] IP CIDRs to whitelist in the pritunl's security group"
type = "list"
Expand Down

0 comments on commit 8dc4272

Please sign in to comment.