From 6523b75af4f936318ed5852be5be4adbc8db7176 Mon Sep 17 00:00:00 2001 From: x p k Date: Thu, 23 Apr 2020 12:10:57 +0800 Subject: [PATCH] UPD: moved around variables --- terraform/aws-vpc/README.md | 15 +++++++++++++-- terraform/aws-vpc/vpc-subnets.tf | 28 ++++++---------------------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/terraform/aws-vpc/README.md b/terraform/aws-vpc/README.md index e05f44c..984d316 100644 --- a/terraform/aws-vpc/README.md +++ b/terraform/aws-vpc/README.md @@ -12,10 +12,21 @@ These config will create the following resources on AWS. The VPC CIDR is hard-co These are required variables, which can be set in terraform.tfvars ``` +# general variables +resource_prefix = "unspecified" +globalTags { + "Environment" = "KFLAB" + "TerraformiCliVersion" = "0.12.24" + "TerraformMode" = "InitialDeploymentOnly" + "Ticket" = "NotApplicable" +} + +# aws provider variables aws_access_key = "redacted" aws_secret_key = "redacted" -aws_region = "ap-southeast-1" -resource_prefix = "project1-dev" +aws_region = "ap-east-1" +resource_prefix = "kflab-dev" + ``` ## Revision notes diff --git a/terraform/aws-vpc/vpc-subnets.tf b/terraform/aws-vpc/vpc-subnets.tf index 067cb86..2daf66b 100644 --- a/terraform/aws-vpc/vpc-subnets.tf +++ b/terraform/aws-vpc/vpc-subnets.tf @@ -1,30 +1,14 @@ -/* Hard coded values -DPTicket tag -Terraform version -VPC name tag -VPC CIDR -Subnet octets -*/ +variable "globalTags" { + type = "map" + default {} +} + +variable "resource_prefix" {} terraform { required_version = ">= 0.9.9" } -variable "globalTags" { - type = "map" - - default { - "Environment" = "KFLAB" - "TerraformiCliVersion" = "0.12.24" - "TerraformMode" = "InitialDeploymentOnly" - "Ticket" = "NotApplicable" - } -} - -variable "resource_prefix" { - default = "unspecified" -} - # VPC resource "aws_vpc" "tf-vpc1" { cidr_block = "10.10.0.0/16"