definitions
Computes and outputs organizational standards — tag maps, naming prefixes, and account context — consumed by all other modules in the platform.
Instantiate this module once per root module and pass its outputs downstream. This eliminates scattered tag definitions and ensures every resource in the platform shares a consistent, centrally-managed identity.
Usage
module "definitions" {
source = "hcassc.jfrog.io/iac-terraform-modules-virtual/governance/definitions/aws"
version = "0.1.0"
environment = "prod"
project = "hca-platform"
cost_center = "CC-1234"
additional_tags = {
Owner = "platform-team"
}
}
module "vpc" {
source = "hcassc.jfrog.io/iac-terraform-modules-virtual/networking/vpc/aws"
version = "0.1.0"
name_prefix = module.definitions.name_prefix
tags = module.definitions.tags
# ...
}
module "kms" {
source = "hcassc.jfrog.io/iac-terraform-modules-virtual/security/kms/aws"
version = "0.1.0"
tags = module.definitions.tags
# ...
}
Tag merge order
Standard tags are applied first, then additional_tags, then tags. Later values win on key collisions, so var.tags always takes final precedence.
| Layer |
Variable |
Precedence |
| Standard tags |
(computed) |
lowest |
| Additional tags |
var.additional_tags |
middle |
| Caller tags |
var.tags |
highest |
| Key |
Source |
Environment |
var.environment |
Project |
var.project |
CostCenter |
var.cost_center |
ManagedBy |
var.managed_by |
Region |
resolved region |
Requirements
Providers
Resources
| Name |
Description |
Type |
Default |
Required |
| cost_center |
Cost center identifier applied to all resource tags for billing allocation |
string |
n/a |
yes |
| environment |
Deployment environment name (e.g. prod, staging, dev) |
string |
n/a |
yes |
| project |
Project or workload name used as the primary naming prefix (e.g. hca-platform) |
string |
n/a |
yes |
| additional_tags |
Extra tags merged into the standard tag set before var.tags (lowest precedence) |
map(string) |
{} |
no |
| managed_by |
Value for the ManagedBy standard tag |
string |
"terraform" |
no |
| region |
AWS region override; defaults to the region returned by data.aws_region.current when left empty |
string |
"" |
no |
| tags |
Resource tags to apply to all resources |
map(string) |
{} |
no |
Outputs
| Name |
Description |
| account_id |
AWS account ID of the caller |
| name_prefix |
Standard resource name prefix derived as - |
| partition |
AWS partition (e.g. aws, aws-cn, aws-us-gov) |
| region |
Resolved AWS region (var.region if set, otherwise the current provider region) |
| tags |
Merged standard tag map combining environment, project, cost center, region, additional_tags, and tags |