Skip to content

Commit 6e7cc15

Browse files
committed
fix: vars
1 parent 6ce50b7 commit 6e7cc15

File tree

3 files changed

+6
-50
lines changed

3 files changed

+6
-50
lines changed

infrastructure/api/ecs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ resource "aws_ecs_task_definition" "node_api_task" {
3535
environment = [
3636
{
3737
name = "DYNAMODB_TABLE_NAME"
38-
value = data.terraform_remote_state.database.outputs.dynamodb_table_name
38+
value = "${var.dynamodb_table_name}"
3939
},
4040
{
4141
name = "DYNAMODB_ENDPOINT"

infrastructure/api/vars.tf

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ variable "aws_license_plate" {
1717
type = string
1818
}
1919

20-
# DynamoDB configuration (replacing PostgreSQL variables)
21-
variable "dynamodb_table_name" {
22-
description = "Name of the DynamoDB table"
23-
type = string
24-
default = ""
25-
}
26-
2720
variable "subnet_app_a" {
2821
description = "Value of the name tag for a subnet in the APP security group"
2922
type = string
@@ -110,45 +103,8 @@ variable "is_public_api" {
110103
variable "dynamodb_table_name" {
111104
description = "The name of the DynamoDB table"
112105
type = string
106+
validation {
107+
condition = length(var.dynamodb_table_name) > 0
108+
error_message = "The DynamoDB table name must not be empty."
109+
}
113110
}
114-
115-
variable "dynamodb_read_capacity" {
116-
description = "The read capacity units for the DynamoDB table"
117-
type = number
118-
default = 5
119-
}
120-
121-
variable "dynamodb_write_capacity" {
122-
description = "The write capacity units for the DynamoDB table"
123-
type = number
124-
default = 5
125-
}
126-
127-
variable "dynamodb_partition_key" {
128-
description = "The partition key for the DynamoDB table"
129-
type = string
130-
}
131-
132-
variable "dynamodb_sort_key" {
133-
description = "The sort key for the DynamoDB table (optional)"
134-
type = string
135-
default = ""
136-
}
137-
138-
variable "dynamodb_billing_mode" {
139-
description = "The billing mode for the DynamoDB table. Can be PROVISIONED or PAY_PER_REQUEST."
140-
type = string
141-
default = "PROVISIONED"
142-
}
143-
144-
variable "dynamodb_stream_enabled" {
145-
description = "Flag to enable DynamoDB Streams"
146-
type = bool
147-
default = false
148-
}
149-
150-
variable "dynamodb_stream_view_type" {
151-
description = "The view type for the DynamoDB stream. Can be NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES, or KEYS_ONLY."
152-
type = string
153-
default = "NEW_IMAGE"
154-
}

terraform/api/terragrunt.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ locals {
1717
statefile_key = "${local.stack_prefix}/${local.app_env}/api/terraform.tfstate"
1818
statelock_table_name = "${local.tf_remote_state_prefix}-lock-${local.aws_license_plate}"
1919
api_image = get_env("api_image")
20-
rds_app_env = (contains(["dev", "test", "prod"], "${local.app_env}") ? "${local.app_env}" : "dev") # if app_env is not dev, test, or prod, default to dev
2120

2221
}
2322

@@ -45,6 +44,7 @@ generate "tfvars" {
4544
disable_signature = true
4645
contents = <<-EOF
4746
app_name="${local.stack_prefix}-node-api-${local.app_env}"
47+
dynamodb_table_name="${local.stack_prefix}-users-${local.app_env}"
4848
EOF
4949
}
5050

0 commit comments

Comments
 (0)