UPD: added comments

This commit is contained in:
xpk 2022-08-18 08:27:31 +08:00
parent af5909e39b
commit e291845a78
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86

View File

@ -1,19 +1,21 @@
# variables.tf
variable "aws-region" {}
variable "customer-name" {}
variable "project" {}
variable "application" {}
variable "environment" {}
# provider.tf
provider "aws" {
region = var.aws-region
default_tags {
tags = {
Environment = var.environment
Project = var.project
Application = var.application
Environment = var.environment
Project = var.project
Application = var.application
TerraformMode = "managed"
TerraformDir = path.cwd
BuildDate = formatdate("YYYYMMDD", timestamp())
TerraformDir = path.cwd
BuildDate = formatdate("YYYYMMDD", timestamp())
}
}
}
@ -28,13 +30,14 @@ terraform {
}
}
# main.tf
locals {
aws-region-short = lookup(module.aws-region-short.region-map, var.aws-region)
resource-prefix = "${var.environment}-${local.aws-region-short}-${var.customer-name}-${var.project}"
resource-prefix = "${var.environment}-${local.aws-region-short}-${var.customer-name}-${var.project}"
}
module aws-region-short {
source = "git::https://xpk.headdesk.me/git/xpk/terraform.aws-baseline-infra//modules/util/aws-region-short"
module "aws-region-short" {
source = "git::https://xpk.headdesk.me/git/xpk/terraform.aws-baseline-infra//modules/util/aws-region-short"
}
module "terraform-state-store" {