From 132d4fd62a2991a5e17b3619d677b15b25680286 Mon Sep 17 00:00:00 2001 From: Luis Mayta Date: Mon, 3 May 2021 00:44:06 -0500 Subject: [PATCH] test: implement openvpn basic (#27) --- test/openvpn-basic/.terraform.lock.hcl | 34 ++++++++++++++++++++++ test/openvpn-basic/main.tf | 7 +++++ test/openvpn-basic/outputs.tf | 9 ++++++ test/openvpn-basic/provider.tf | 9 ++++++ test/openvpn-basic/variables.tf | 39 ++++++++++++++++++++++++++ test/openvpn-basic/versions.tf | 26 +++++++++++++++++ 6 files changed, 124 insertions(+) create mode 100644 test/openvpn-basic/.terraform.lock.hcl create mode 100644 test/openvpn-basic/main.tf create mode 100644 test/openvpn-basic/outputs.tf create mode 100644 test/openvpn-basic/provider.tf create mode 100644 test/openvpn-basic/variables.tf create mode 100644 test/openvpn-basic/versions.tf diff --git a/test/openvpn-basic/.terraform.lock.hcl b/test/openvpn-basic/.terraform.lock.hcl new file mode 100644 index 0000000..36906d5 --- /dev/null +++ b/test/openvpn-basic/.terraform.lock.hcl @@ -0,0 +1,34 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "3.38.0" + constraints = ">= 3.2.0" + hashes = [ + "h1:qKEjN/EM56XT46vGY33eoq7nD6JuGqRqFp7tkzTrRM0=", + ] +} + +provider "registry.terraform.io/hashicorp/local" { + version = "2.1.0" + constraints = ">= 1.3.0" + hashes = [ + "h1:KfieWtVyGWwplSoLIB5usKAUnrIkDQBkWaR5TI+4WYg=", + ] +} + +provider "registry.terraform.io/hashicorp/null" { + version = "3.1.0" + constraints = ">= 0.1.0" + hashes = [ + "h1:xhbHC6in3nQryvTQBWKxebi3inG5OCgHgc4fRxL0ymc=", + ] +} + +provider "registry.terraform.io/hashicorp/template" { + version = "2.2.0" + constraints = ">= 1.0.0" + hashes = [ + "h1:0wlehNaxBX7GJQnPfQwTNvvAf38Jm0Nv7ssKGMaG6Og=", + ] +} diff --git a/test/openvpn-basic/main.tf b/test/openvpn-basic/main.tf new file mode 100644 index 0000000..aa2675c --- /dev/null +++ b/test/openvpn-basic/main.tf @@ -0,0 +1,7 @@ +module "main" { + source = "../.." + public_key = var.public_key + private_key = var.private_key + admin_user = var.admin_user + storage_path = var.storage_path +} diff --git a/test/openvpn-basic/outputs.tf b/test/openvpn-basic/outputs.tf new file mode 100644 index 0000000..4ace1ab --- /dev/null +++ b/test/openvpn-basic/outputs.tf @@ -0,0 +1,9 @@ +output "instance" { + description = "show instance module" + value = module.main.instance +} + +output "instance_ip" { + description = "show ip of instance" + value = module.main.instance_ip +} diff --git a/test/openvpn-basic/provider.tf b/test/openvpn-basic/provider.tf new file mode 100644 index 0000000..878a157 --- /dev/null +++ b/test/openvpn-basic/provider.tf @@ -0,0 +1,9 @@ +provider "aws" { + region = var.aws_region +} + +provider "template" {} + +provider "null" {} + +provider "local" {} diff --git a/test/openvpn-basic/variables.tf b/test/openvpn-basic/variables.tf new file mode 100644 index 0000000..9749d84 --- /dev/null +++ b/test/openvpn-basic/variables.tf @@ -0,0 +1,39 @@ +# --------------------------------------------------------------------------------------------------------------------- +# ENVIRONMENT VARIABLES +# Define these secrets as environment variables. +# --------------------------------------------------------------------------------------------------------------------- + +# --------------------------------------------------------------------------------------------------------------------- +# REQUIRED VARIABLES +# These variables must be set when using this module. +# --------------------------------------------------------------------------------------------------------------------- + +# --------------------------------------------------------------------------------------------------------------------- +# OPTIONAL VARIABLES +# These variables have defaults, but may be overridden. +# --------------------------------------------------------------------------------------------------------------------- + +variable "aws_region" { + description = "region of aws" + type = string +} + +variable "public_key" { + description = "path of public key" + type = string +} + +variable "private_key" { + description = "path of private key" + type = string +} + +variable "admin_user" { + description = "username of admin" + type = string +} + +variable "storage_path" { + description = "storage path" + type = string +} diff --git a/test/openvpn-basic/versions.tf b/test/openvpn-basic/versions.tf new file mode 100644 index 0000000..6f93f42 --- /dev/null +++ b/test/openvpn-basic/versions.tf @@ -0,0 +1,26 @@ +terraform { + required_version = ">=0.13.0" + required_providers { + + aws = { + source = "hashicorp/aws" + version = ">=3.2.0" + } + + template = { + source = "hashicorp/template" + version = ">=1.0.0" + } + + null = { + source = "hashicorp/null" + version = ">=0.1.0" + } + + local = { + source = "hashicorp/local" + version = ">=1.3.0" + } + + } +}