Skip to content

Commit b1e1195

Browse files
Letter variant map to vars
1 parent 6040c12 commit b1e1195

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

infrastructure/terraform/components/api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ No requirements.
2222
| <a name="input_group"></a> [group](#input\_group) | The group variables are being inherited from (often synonmous with account short-name) | `string` | n/a | yes |
2323
| <a name="input_kms_deletion_window"></a> [kms\_deletion\_window](#input\_kms\_deletion\_window) | When a kms key is deleted, how long should it wait in the pending deletion state? | `string` | `"30"` | no |
2424
| <a name="input_letter_table_ttl_hours"></a> [letter\_table\_ttl\_hours](#input\_letter\_table\_ttl\_hours) | Number of hours to set as TTL on letters table | `number` | `24` | no |
25+
| <a name="input_letter_variant_map"></a> [letter\_variant\_map](#input\_letter\_variant\_map) | n/a | `map(object({ supplierId = string, specId = string }))` | <pre>{<br/> "lv1": {<br/> "specId": "spec1",<br/> "supplierId": "supplier1"<br/> },<br/> "lv2": {<br/> "specId": "spec2",<br/> "supplierId": "supplier1"<br/> },<br/> "lv3": {<br/> "specId": "spec3",<br/> "supplierId": "supplier2"<br/> }<br/>}</pre> | no |
2526
| <a name="input_log_level"></a> [log\_level](#input\_log\_level) | The log level to be used in lambda functions within the component. Any log with a lower severity than the configured value will not be logged: https://docs.python.org/3/library/logging.html#levels | `string` | `"INFO"` | no |
2627
| <a name="input_log_retention_in_days"></a> [log\_retention\_in\_days](#input\_log\_retention\_in\_days) | The retention period in days for the Cloudwatch Logs events to be retained, default of 0 is indefinite | `number` | `0` | no |
2728
| <a name="input_manually_configure_mtls_truststore"></a> [manually\_configure\_mtls\_truststore](#input\_manually\_configure\_mtls\_truststore) | Manually manage the truststore used for API Gateway mTLS (e.g. for prod environment) | `bool` | `false` | no |
@@ -30,7 +31,6 @@ No requirements.
3031
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |
3132
| <a name="input_region"></a> [region](#input\_region) | The AWS Region | `string` | n/a | yes |
3233
| <a name="input_shared_infra_account_id"></a> [shared\_infra\_account\_id](#input\_shared\_infra\_account\_id) | The AWS Account ID of the shared infrastructure account | `string` | `"000000000000"` | no |
33-
| <a name="input_variant_map"></a> [variant\_map](#input\_variant\_map) | n/a | `map(object({ supplierId = string, specId = string }))` | <pre>{<br/> "lv1": {<br/> "specId": "spec1",<br/> "supplierId": "supplier1"<br/> },<br/> "lv2": {<br/> "specId": "spec2",<br/> "supplierId": "supplier1"<br/> },<br/> "lv3": {<br/> "specId": "spec3",<br/> "supplierId": "supplier2"<br/> }<br/>}</pre> | no |
3434
## Modules
3535

3636
| Name | Source | Version |

infrastructure/terraform/components/api/module_lambda_upsert_letter.tf

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,10 @@ module "upsert_letter" {
3636
log_subscription_role_arn = local.acct.log_subscription_role_arn
3737

3838
lambda_env_vars = merge(local.common_lambda_env_vars, {
39-
VARIANT_MAP = jsonencode(var.variant_map)
39+
VARIANT_MAP = jsonencode(var.letter_variant_map)
4040
})
4141
}
4242

43-
variable "variant_map" {
44-
type = map(object({ supplierId = string, specId = string }))
45-
default = {
46-
"lv1" = { supplierId = "supplier1", specId = "spec1" },
47-
"lv2" = { supplierId = "supplier1", specId = "spec2" },
48-
"lv3" = { supplierId = "supplier2", specId = "spec3" }
49-
}
50-
}
51-
5243
data "aws_iam_policy_document" "upsert_letter_lambda" {
5344
statement {
5445
sid = "KMSPermissions"

infrastructure/terraform/components/api/variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,12 @@ variable "eventpub_control_plane_bus_arn" {
134134
description = "ARN of the EventBridge control plane bus for eventpub"
135135
default = ""
136136
}
137+
138+
variable "letter_variant_map" {
139+
type = map(object({ supplierId = string, specId = string }))
140+
default = {
141+
"lv1" = { supplierId = "supplier1", specId = "spec1" },
142+
"lv2" = { supplierId = "supplier1", specId = "spec2" },
143+
"lv3" = { supplierId = "supplier2", specId = "spec3" }
144+
}
145+
}

0 commit comments

Comments
 (0)