From b576d2a3e756c2d5d4da176748ca1f5ad04c2957 Mon Sep 17 00:00:00 2001 From: jem Date: Tue, 10 Mar 2020 08:31:04 +0100 Subject: [PATCH] add common tf resources --- src/main/resources/terraform/aws_backend_properties_vars.tf | 5 +++++ src/main/resources/terraform/aws_backend_with_properties.tf | 5 +++++ src/main/resources/terraform/aws_provider.tf | 3 +++ src/main/resources/terraform/hetzner_mixin_vars.tf | 2 ++ src/main/resources/terraform/hetzner_provider.tf | 4 ++++ src/main/resources/terraform/terraform_build_vars.tf | 2 ++ src/main/resources/terraform/versions.tf | 4 ++++ 7 files changed, 25 insertions(+) create mode 100644 src/main/resources/terraform/aws_backend_properties_vars.tf create mode 100644 src/main/resources/terraform/aws_backend_with_properties.tf create mode 100644 src/main/resources/terraform/aws_provider.tf create mode 100644 src/main/resources/terraform/hetzner_mixin_vars.tf create mode 100644 src/main/resources/terraform/hetzner_provider.tf create mode 100644 src/main/resources/terraform/terraform_build_vars.tf create mode 100644 src/main/resources/terraform/versions.tf diff --git a/src/main/resources/terraform/aws_backend_properties_vars.tf b/src/main/resources/terraform/aws_backend_properties_vars.tf new file mode 100644 index 0000000..d261cf7 --- /dev/null +++ b/src/main/resources/terraform/aws_backend_properties_vars.tf @@ -0,0 +1,5 @@ +variable "bucket" {} +variable "key" {} +variable "kms_key_id" {} +variable "region" {} +variable "account_name" {} \ No newline at end of file diff --git a/src/main/resources/terraform/aws_backend_with_properties.tf b/src/main/resources/terraform/aws_backend_with_properties.tf new file mode 100644 index 0000000..c9fb24d --- /dev/null +++ b/src/main/resources/terraform/aws_backend_with_properties.tf @@ -0,0 +1,5 @@ +terraform { + backend "s3" { + encrypt = "true" + } +} diff --git a/src/main/resources/terraform/aws_provider.tf b/src/main/resources/terraform/aws_provider.tf new file mode 100644 index 0000000..dc58d9a --- /dev/null +++ b/src/main/resources/terraform/aws_provider.tf @@ -0,0 +1,3 @@ +provider "aws" { + region = var.region +} diff --git a/src/main/resources/terraform/hetzner_mixin_vars.tf b/src/main/resources/terraform/hetzner_mixin_vars.tf new file mode 100644 index 0000000..1b85c64 --- /dev/null +++ b/src/main/resources/terraform/hetzner_mixin_vars.tf @@ -0,0 +1,2 @@ +variable "hetzner_api_key" { +} diff --git a/src/main/resources/terraform/hetzner_provider.tf b/src/main/resources/terraform/hetzner_provider.tf new file mode 100644 index 0000000..4a5d3fe --- /dev/null +++ b/src/main/resources/terraform/hetzner_provider.tf @@ -0,0 +1,4 @@ +# Configure the Hetzner Cloud Provider +provider "hcloud" { + token = var.hetzner_api_key +} diff --git a/src/main/resources/terraform/terraform_build_vars.tf b/src/main/resources/terraform/terraform_build_vars.tf new file mode 100644 index 0000000..be67cbe --- /dev/null +++ b/src/main/resources/terraform/terraform_build_vars.tf @@ -0,0 +1,2 @@ +variable "stage" {} +variable "module" {} \ No newline at end of file diff --git a/src/main/resources/terraform/versions.tf b/src/main/resources/terraform/versions.tf new file mode 100644 index 0000000..ac97c6a --- /dev/null +++ b/src/main/resources/terraform/versions.tf @@ -0,0 +1,4 @@ + +terraform { + required_version = ">= 0.12" +}