Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using deprecated template_file (use templatefile instead) #19

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
3 changes: 1 addition & 2 deletions modules/vpn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Refer [this](https://pritunl.com/) for more information.
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.23 |
| <a name="requirement_template"></a> [template](#requirement\_template) | >= 2.2.0 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1 |

## Providers
Expand Down Expand Up @@ -53,7 +52,7 @@ Refer [this](https://pritunl.com/) for more information.
| [aws_iam_policy.SSMManagedInstanceCore](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy) | data source |
| [aws_iam_policy.SecretsManagerReadWrite](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy) | data source |
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
| [template_file.pritunl](https://registry.terraform.io/providers/hashicorp/template/latest/docs/data-sources/file) | data source |
| [templatefile.pritunl](https://registry.terraform.io/providers/hashicorp/template/latest/docs/data-sources/file) | data source |

## Inputs

Expand Down
6 changes: 1 addition & 5 deletions modules/vpn/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ data "aws_ami" "ubuntu_20_ami" {
}


data "template_file" "pritunl" {
template = file("${path.module}/scripts/pritunl-vpn.sh")
}

data "aws_region" "current" {}

module "vpn_server" {
Expand All @@ -91,7 +87,7 @@ module "vpn_server" {
key_name = var.vpn_key_pair
associate_public_ip_address = true
vpc_security_group_ids = [module.security_group_vpn.security_group_id]
user_data = join("", data.template_file.pritunl[*].rendered)
user_data = templatefile("${path.module}/scripts/pritunl-vpn.sh")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure why template_file or templatefile is actually needed. There is nothing being replaced in this file from what I can see.

iam_instance_profile = join("", aws_iam_instance_profile.vpn_SSM[*].name)


Expand Down
4 changes: 0 additions & 4 deletions modules/vpn/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ terraform {
source = "hashicorp/time"
version = ">= 0.9.1"
}
template = {
source = "hashicorp/template"
version = ">= 2.2.0"
}
aws = {
source = "hashicorp/aws"
version = ">= 4.23"
Expand Down