NEW: Skeleton files with provider default tags

This commit is contained in:
xpk 2023-11-23 17:15:34 +08:00
parent c3b62a163b
commit 22a0f0980d
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86
3 changed files with 37 additions and 0 deletions

27
examples/skel/provider.tf Normal file
View File

@ -0,0 +1,27 @@
provider "aws" {
region = var.aws-region
default_tags {
tags = {
Environment = var.environment
Project = var.project
Application = var.application
TerraformMode = "managed"
BuildDate = time_static.current_time.rfc3339
TerraformDir = "${reverse(split("/", path.cwd))[1]}/${reverse(split("/", path.cwd))[0]}"
}
}
}
resource "time_static" "current_time" {}
terraform {
required_version = ">= 1.3"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}

View File

@ -0,0 +1,5 @@
aws-region = "ap-east-1"
customer-name = "CX"
environment = "prod"
project = "SupportTools"
application = "Undefined"

View File

@ -0,0 +1,5 @@
variable "aws-region" {}
variable "customer-name" {}
variable "environment" {}
variable "project" {}
variable "application" {}