# Account Contacts

Sets the primary and alternate contacts on an AWS account. All contact types are optional and independently configured.

AWS uses these contacts to route account notifications to the right teams instead of the root account email:

- **Primary** — legal, tax, and account ownership communications
- **Billing** — billing alerts, invoices, and payment notifications
- **Security** — security findings, abuse notifications, and vulnerability reports
- **Operations** — service notifications, maintenance windows, and operational issues

## Usage

```hcl
module "account_contacts" {
  source  = "hcassc.jfrog.io/iac-tf-modules-virtual/governance/account-contacts/aws"
  version = "0.1.0"

  account_id = "123456789012"

  primary_contact = {
    full_name       = "Platform Team"
    company_name    = "Example Corp"
    phone           = "+12065551234"
    address_line_1  = "123 Any Street"
    city            = "Seattle"
    state_or_region = "WA"
    postal_code     = "98101"
    country_code    = "US"
  }

  alternate_contacts = {
    billing = {
      name  = "Finance Team"
      title = "Finance Manager"
      email = "aws-billing@example.com"
      phone = "+12065551234"
    }
    security = {
      name  = "Security Team"
      title = "Security Engineer"
      email = "aws-security@example.com"
      phone = "+12065551234"
    }
    operations = {
      name  = "Platform Team"
      title = "Platform Engineer"
      email = "aws-operations@example.com"
      phone = "+12065551234"
    }
  }
}
```

## Notes

- `account_id` is optional. When omitted, contacts are set on the current account.
- `alternate_contacts` keys are case-insensitive. `BILLING`, `Billing`, and `billing` are all valid.
- `phone` must include the country code (e.g. `+12065551234`).
- `country_code` must be a valid ISO 3166-1 alpha-2 code (e.g. `US`, `GB`).

<!-- BEGIN_TF_DOCS — DO NOT EDIT BELOW THIS LINE -->
## Requirements

| Name | Version |
| ---- | ------- |
| <a name="requirement_terraform"></a> [terraform](#requirement_terraform) | >= 1.15.0, < 2.0.0 |
| <a name="requirement_aws"></a> [aws](#requirement_aws) | >= 6.0, < 7.0 |

## Providers

| Name | Version |
| ---- | ------- |
| <a name="provider_aws"></a> [aws](#provider_aws) | >= 6.0, < 7.0 |

## Resources

| Name | Type |
| ---- | ---- |
| [aws_account_alternate_contact.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/account_alternate_contact) | resource |
| [aws_account_primary_contact.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/account_primary_contact) | resource |

## Inputs

| Name | Description | Type | Default | Required |
| ---- | ----------- | ---- | ------- | :------: |
| <a name="input_account_id"></a> [account_id](#input_account_id) | ID of the target member account to set contacts on. Uses current account if omitted. | `string` | `null` | no |
| <a name="input_alternate_contacts"></a> [alternate_contacts](#input_alternate_contacts) | Alternate contacts for billing, security, and operations notifications. | <pre>map(object({<br/>    name  = string<br/>    title = string<br/>    email = string<br/>    phone = string<br/>  }))</pre> | `{}` | no |
| <a name="input_primary_contact"></a> [primary_contact](#input_primary_contact) | Primary account contact used by AWS for legal, tax, and account ownership purposes. | <pre>object({<br/>    full_name          = string<br/>    company_name       = optional(string)<br/>    phone              = string<br/>    website_url        = optional(string)<br/>    address_line_1     = string<br/>    address_line_2     = optional(string)<br/>    city               = string<br/>    state_or_region    = optional(string)<br/>    district_or_county = optional(string)<br/>    postal_code        = string<br/>    country_code       = string<br/>  })</pre> | `null` | no |

## Outputs

| Name | Description |
| ---- | ----------- |
| <a name="output_alternate_contacts"></a> [alternate_contacts](#output_alternate_contacts) | Alternate contacts as configured |
| <a name="output_primary_contact"></a> [primary_contact](#output_primary_contact) | Primary contact as configured |
<!-- END_TF_DOCS — DO NOT EDIT ABOVE THIS LINE -->
