# context

Computes standardized, governed tags for consumption across all HCA IaC modules and stacks.

Provides a single source of truth for resource tagging, including required stack-identifying tags and the AWS Migration Acceleration Program (MAP) tag. Every module or stack that needs to tag an AWS resource consumes `context` rather than reimplementing tagging logic independently, keeping tagging policy centralized and consistent platform-wide. This module has no `provider` block and creates no AWS resources or data sources — it is pure computation and can be safely consumed by any stack regardless of account or region.

## Usage

```hcl
module "context" {
  source  = "hcassc.jfrog.io/iac-tf-modules-virtual__shared/context/aws"
  version = "~> 1.0"

  stack_name           = "bitbucket-dev-runners"
  application_name     = "Bitbucket"
  project              = "DC-Migration-Project"
  environment          = "dev"
  cost_center_opex     = "271"
  cost_center_capex    = "000"
  data_classification  = "Internal"
  availability_tier    = "Tier 1"
  app_owner            = "Director IT Infrastructure and Platform Engineering"
  team                 = "devops"
  assignment_group     = "hca-aws-support"
  owner                = "hca-itinfradevopsengineering@hcs.com"
  business_unit        = "Infrastructure and Planning"

  additional_tags = {
    Purpose = "shared-services-hub"
  }
}

resource "aws_vpc" "this" {
  cidr_block = "10.0.0.0/16"
  tags       = module.context.tags
}
```

<!-- BEGIN_TF_DOCS — DO NOT EDIT BELOW THIS LINE -->

## Inputs

| Name                                                                                       | Description                                                                                                                                                                                                              | Type          | Default | Required |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- | ------- | :------: |
| <a name="input_app_owner"></a> [app_owner](#input_app_owner)                               | Application owner role/title (tag: app-owner)                                                                                                                                                                            | `string`      | n/a     |   yes    |
| <a name="input_application_name"></a> [application_name](#input_application_name)          | Application name (tag: application-name)                                                                                                                                                                                 | `string`      | n/a     |   yes    |
| <a name="input_assignment_group"></a> [assignment_group](#input_assignment_group)          | Support assignment group (tag: assignment-group)                                                                                                                                                                         | `string`      | n/a     |   yes    |
| <a name="input_availability_tier"></a> [availability_tier](#input_availability_tier)       | Availability tier (tag: availability-tier)                                                                                                                                                                               | `string`      | n/a     |   yes    |
| <a name="input_business_unit"></a> [business_unit](#input_business_unit)                   | Business unit (tag: business-unit)                                                                                                                                                                                       | `string`      | n/a     |   yes    |
| <a name="input_cost_center_capex"></a> [cost_center_capex](#input_cost_center_capex)       | CAPEX cost center code (tag: cost-center-capex)                                                                                                                                                                          | `string`      | n/a     |   yes    |
| <a name="input_cost_center_opex"></a> [cost_center_opex](#input_cost_center_opex)          | OPEX cost center code (tag: cost-center-opex)                                                                                                                                                                            | `string`      | n/a     |   yes    |
| <a name="input_data_classification"></a> [data_classification](#input_data_classification) | Data classification level (tag: data-classification)                                                                                                                                                                     | `string`      | n/a     |   yes    |
| <a name="input_environment"></a> [environment](#input_environment)                         | Deployment environment (tag: environment)                                                                                                                                                                                | `string`      | n/a     |   yes    |
| <a name="input_owner"></a> [owner](#input_owner)                                           | Owner contact email (tag: owner)                                                                                                                                                                                         | `string`      | n/a     |   yes    |
| <a name="input_project"></a> [project](#input_project)                                     | Project name (tag: project)                                                                                                                                                                                              | `string`      | n/a     |   yes    |
| <a name="input_stack_name"></a> [stack_name](#input_stack_name)                            | Name of the stack (tag: stack-name)                                                                                                                                                                                      | `string`      | n/a     |   yes    |
| <a name="input_team"></a> [team](#input_team)                                              | Owning team (tag: team)                                                                                                                                                                                                  | `string`      | n/a     |   yes    |
| <a name="input_additional_tags"></a> [additional_tags](#input_additional_tags)             | Additional tags to merge with the module's baseline tags.<br/><br/>Baseline tags always take precedence. If a key here collides<br/>with a baseline tag, the baseline value wins and this value<br/>is silently dropped. | `map(string)` | `{}`    |    no    |
| <a name="input_enable_map_tag"></a> [enable_map_tag](#input_enable_map_tag)                | Enable the AWS Migration Accelerated Program (MAP) tag                                                                                                                                                                   | `bool`        | `false` |    no    |

## Outputs

| Name                                                                                | Description                                                              |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| <a name="output_application_name"></a> [application_name](#output_application_name) | Application name                                                         |
| <a name="output_environment"></a> [environment](#output_environment)                | Deployment environment                                                   |
| <a name="output_stack_name"></a> [stack_name](#output_stack_name)                   | Stack name                                                               |
| <a name="output_tags"></a> [tags](#output_tags)                                     | Tags map derived from baselines, AWS MAP configuration & additional tags |

<!-- END_TF_DOCS — DO NOT EDIT ABOVE THIS LINE -->
