# 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

```hcl
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    |

## Standard tags emitted

| Key           | Source              |
|---------------|---------------------|
| `Environment` | `var.environment`   |
| `Project`     | `var.project`       |
| `CostCenter`  | `var.cost_center`   |
| `ManagedBy`   | `var.managed_by`    |
| `Region`      | resolved region     |

<!-- BEGIN_TF_DOCS — DO NOT EDIT BELOW THIS LINE -->
## Requirements

| Name | Version |
| ---- | ------- |
| <a name="requirement_terraform"></a> [terraform](#requirement_terraform) | ~> 1.5 |
| <a name="requirement_aws"></a> [aws](#requirement_aws) | ~> 6.50 |

## Providers

| Name | Version |
| ---- | ------- |
| <a name="provider_aws"></a> [aws](#provider_aws) | 6.50.0 |

## Resources

| Name | Type |
| ---- | ---- |

## Inputs

| Name | Description | Type | Default | Required |
| ---- | ----------- | ---- | ------- | :------: |
| <a name="input_cost_center"></a> [cost_center](#input_cost_center) | Cost center identifier applied to all resource tags for billing allocation | `string` | n/a | yes |
| <a name="input_environment"></a> [environment](#input_environment) | Deployment environment name (e.g. prod, staging, dev) | `string` | n/a | yes |
| <a name="input_project"></a> [project](#input_project) | Project or workload name used as the primary naming prefix (e.g. hca-platform) | `string` | n/a | yes |
| <a name="input_additional_tags"></a> [additional_tags](#input_additional_tags) | Extra tags merged into the standard tag set before var.tags (lowest precedence) | `map(string)` | `{}` | no |
| <a name="input_managed_by"></a> [managed_by](#input_managed_by) | Value for the ManagedBy standard tag | `string` | `"terraform"` | no |
| <a name="input_region"></a> [region](#input_region) | AWS region override; defaults to the region returned by data.aws_region.current when left empty | `string` | `""` | no |
| <a name="input_tags"></a> [tags](#input_tags) | Resource tags to apply to all resources | `map(string)` | `{}` | no |

## Outputs

| Name | Description |
| ---- | ----------- |
| <a name="output_account_id"></a> [account_id](#output_account_id) | AWS account ID of the caller |
| <a name="output_name_prefix"></a> [name_prefix](#output_name_prefix) | Standard resource name prefix derived as <project>-<environment> |
| <a name="output_partition"></a> [partition](#output_partition) | AWS partition (e.g. aws, aws-cn, aws-us-gov) |
| <a name="output_region"></a> [region](#output_region) | Resolved AWS region (var.region if set, otherwise the current provider region) |
| <a name="output_tags"></a> [tags](#output_tags) | Merged standard tag map combining environment, project, cost center, region, additional_tags, and tags |
<!-- END_TF_DOCS — DO NOT EDIT ABOVE THIS LINE -->
