Skip to content

Commit 2e983ba

Browse files
authored
CCM-9648: sandbox resource naming - use module (#402)
1 parent 1950556 commit 2e983ba

File tree

7 files changed

+14
-6
lines changed

7 files changed

+14
-6
lines changed

infrastructure/terraform/components/app/module_backend_api.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module "backend_api" {
55

66
project = var.project
77
environment = var.environment
8+
component = var.component
89
aws_account_id = var.aws_account_id
910
region = var.region
1011
group = var.group

infrastructure/terraform/components/sandbox/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ No requirements.
1010
| Name | Description | Type | Default | Required |
1111
|------|-------------|------|---------|:--------:|
1212
| <a name="input_aws_account_id"></a> [aws\_account\_id](#input\_aws\_account\_id) | The AWS Account ID (numeric) | `string` | n/a | yes |
13-
| <a name="input_component"></a> [component](#input\_component) | The variable encapsulating the name of this component | `string` | `"sandbox"` | no |
13+
| <a name="input_component"></a> [component](#input\_component) | The variable encapsulating the name of this component | `string` | `"sbx"` | no |
1414
| <a name="input_default_tags"></a> [default\_tags](#input\_default\_tags) | A map of default tags to apply to all taggable resources within the component | `map(string)` | `{}` | no |
1515
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |
1616
| <a name="input_group"></a> [group](#input\_group) | The group variables are being inherited from (often synonymous with account short-name) | `string` | n/a | yes |

infrastructure/terraform/components/sandbox/module_backend_api.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module "backend_api" {
33

44
project = var.project
55
environment = var.environment
6+
component = var.component
67
aws_account_id = var.aws_account_id
78
region = var.region
89
group = var.group

infrastructure/terraform/components/sandbox/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ variable "group" {
3838
variable "component" {
3939
type = string
4040
description = "The variable encapsulating the name of this component"
41-
default = "sandbox"
41+
default = "sbx"
4242
}
4343

4444
variable "default_tags" {

infrastructure/terraform/modules/backend-api/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ No requirements.
1111
|------|-------------|------|---------|:--------:|
1212
| <a name="input_aws_account_id"></a> [aws\_account\_id](#input\_aws\_account\_id) | The AWS Account ID (numeric) | `string` | n/a | yes |
1313
| <a name="input_cognito_config"></a> [cognito\_config](#input\_cognito\_config) | Cognito config | <pre>object({<br/> USER_POOL_ID : string,<br/> USER_POOL_CLIENT_ID : string<br/> })</pre> | n/a | yes |
14-
| <a name="input_component"></a> [component](#input\_component) | The variable encapsulating the name of this component | `string` | `"api"` | no |
14+
| <a name="input_component"></a> [component](#input\_component) | The variable encapsulating the name of this component | `string` | n/a | yes |
1515
| <a name="input_csi"></a> [csi](#input\_csi) | CSI from the parent component | `string` | n/a | yes |
1616
| <a name="input_dynamodb_kms_key_arn"></a> [dynamodb\_kms\_key\_arn](#input\_dynamodb\_kms\_key\_arn) | KMS Key ARN for encrypting DynamoDB data. If not given, a key will be created. | `string` | `""` | no |
1717
| <a name="input_enable_backup"></a> [enable\_backup](#input\_enable\_backup) | Enable Backups for the DynamoDB table? | `bool` | `true` | no |
@@ -20,6 +20,7 @@ No requirements.
2020
| <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 |
2121
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | KMS Key ARN | `string` | n/a | yes |
2222
| <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 |
23+
| <a name="input_module"></a> [module](#input\_module) | The variable encapsulating the name of this module | `string` | `"api"` | no |
2324
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |
2425
| <a name="input_region"></a> [region](#input\_region) | The AWS Region | `string` | n/a | yes |
2526
## Modules

infrastructure/terraform/modules/backend-api/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
csi = "${var.csi}-${var.component}"
2+
csi = "${var.csi}-${var.module}"
33

44
lambdas_source_code_dir = abspath("${path.module}/../../../../lambdas")
55

infrastructure/terraform/modules/backend-api/variables.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ variable "environment" {
1212
description = "The name of the tfscaffold environment"
1313
}
1414

15+
variable "component" {
16+
type = string
17+
description = "The variable encapsulating the name of this component"
18+
}
19+
1520
variable "aws_account_id" {
1621
type = string
1722
description = "The AWS Account ID (numeric)"
@@ -32,9 +37,9 @@ variable "group" {
3237
# tfscaffold variables specific to this component
3338
##
3439

35-
variable "component" {
40+
variable "module" {
3641
type = string
37-
description = "The variable encapsulating the name of this component"
42+
description = "The variable encapsulating the name of this module"
3843
default = "api"
3944
}
4045

0 commit comments

Comments
 (0)