Skip to content

Commit f56fdc4

Browse files
authored
chore: linter (#144)
1 parent f870a0d commit f56fdc4

File tree

24 files changed

+244
-244
lines changed

24 files changed

+244
-244
lines changed

infrastructure/api/api-gateway.tf

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
# Import common configurations
22
module "common" {
33
source = "git::https://github.com/bcgov/quickstart-aws-helpers.git//terraform/modules/common?ref=v0.0.5"
4-
5-
target_env = var.target_env
6-
app_env = var.app_env
7-
app_name = var.app_name
8-
repo_name = var.repo_name
9-
common_tags = var.common_tags
4+
5+
target_env = var.target_env
6+
app_env = var.app_env
7+
app_name = var.app_name
8+
repo_name = var.repo_name
9+
common_tags = var.common_tags
1010
}
1111

1212
# Import networking configurations
1313
module "networking" {
1414
source = "git::https://github.com/bcgov/quickstart-aws-helpers.git//terraform/modules/networking?ref=v0.0.5"
15-
15+
1616
target_env = var.target_env
1717
}
1818

1919
# API Gateway with VPC Link using the API Gateway module
2020
module "api_gateway" {
2121
source = "git::https://github.com/bcgov/quickstart-aws-helpers.git//terraform/modules/api-gateway?ref=v0.0.5"
22-
22+
2323
api_name = var.app_name
2424
protocol_type = "HTTP"
2525
subnet_ids = module.networking.subnets.web.ids
2626
security_group_ids = [module.networking.security_groups.web.id]
2727
integration_uri = aws_alb_listener.internal.arn
28-
route_key = "ANY /{proxy+}"
29-
stage_name = "$default"
30-
auto_deploy = true
31-
tags = module.common.common_tags
28+
route_key = "ANY /{proxy+}"
29+
stage_name = "$default"
30+
auto_deploy = true
31+
tags = module.common.common_tags
3232
}
3333

3434
# Compatibility data sources for existing resource references

infrastructure/api/autoscaling.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resource "aws_appautoscaling_target" "api_target" {
88

99
# Automatically scale capacity up by one
1010
resource "aws_appautoscaling_policy" "api_up" {
11-
name = "${var.app_name}-scale-up"
11+
name = "${var.app_name}-scale-up"
1212
service_namespace = "ecs"
1313
resource_id = "service/${aws_ecs_cluster.ecs_cluster.name}/${aws_ecs_service.node_api_service.name}"
1414
scalable_dimension = "ecs:service:DesiredCount"
@@ -28,7 +28,7 @@ resource "aws_appautoscaling_policy" "api_up" {
2828
}
2929
# Automatically scale capacity down by one
3030
resource "aws_appautoscaling_policy" "api_down" {
31-
name = "${var.app_name}-scale-down"
31+
name = "${var.app_name}-scale-down"
3232
service_namespace = "ecs"
3333
resource_id = "service/${aws_ecs_cluster.ecs_cluster.name}/${aws_ecs_service.node_api_service.name}"
3434
scalable_dimension = "ecs:service:DesiredCount"

infrastructure/api/ecs.tf

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
container_name = "${var.app_name}"
2+
container_name = var.app_name
33
}
44

55
# Try to fetch secrets manager secret, but don't fail if it doesn't exist
@@ -29,25 +29,25 @@ locals {
2929
password = "changeme"
3030
}
3131
)
32-
32+
3333
# Provide default database endpoints with try() for safe access
3434
db_endpoint = try(
3535
data.aws_rds_cluster.rds_cluster[0].endpoint,
3636
"localhost"
3737
)
38-
38+
3939
db_reader_endpoint = try(
4040
data.aws_rds_cluster.rds_cluster[0].reader_endpoint,
4141
"localhost"
4242
)
43-
43+
4444
# Flag to indicate if database resources are available
4545
db_resources_available = var.db_cluster_name != "" && length(data.aws_rds_cluster.rds_cluster) > 0
4646
}
4747

4848

4949
resource "aws_ecs_cluster" "ecs_cluster" {
50-
name = "${var.app_name}"
50+
name = var.app_name
5151
tags = module.common.common_tags
5252
}
5353

@@ -65,7 +65,7 @@ resource "aws_ecs_cluster_capacity_providers" "ecs_cluster_capacity_providers" {
6565

6666
resource "terraform_data" "trigger_flyway" {
6767
count = var.db_cluster_name != "" ? 1 : 0
68-
input = "${timestamp()}"
68+
input = timestamp()
6969
}
7070

7171
resource "aws_ecs_task_definition" "flyway_task" {
@@ -78,7 +78,7 @@ resource "aws_ecs_task_definition" "flyway_task" {
7878
execution_role_arn = aws_iam_role.ecs_task_execution_role.arn
7979
task_role_arn = aws_iam_role.app_container_role.arn
8080
container_definitions = jsonencode([
81-
{
81+
{
8282
name = "${var.app_name}-flyway"
8383
image = "${var.flyway_image}"
8484
essential = true
@@ -108,7 +108,7 @@ resource "aws_ecs_task_definition" "flyway_task" {
108108
value = "true"
109109
}
110110
]
111-
111+
112112
logConfiguration = {
113113
logDriver = "awslogs"
114114
options = {
@@ -120,15 +120,15 @@ resource "aws_ecs_task_definition" "flyway_task" {
120120
}
121121
mountPoints = []
122122
volumesFrom = []
123-
123+
124124
}
125125
])
126126
lifecycle {
127127
replace_triggered_by = [terraform_data.trigger_flyway[0]]
128128
}
129129
provisioner "local-exec" {
130130
interpreter = ["bash", "-c"]
131-
command = <<-EOF
131+
command = <<-EOF
132132
set -euo pipefail
133133
134134
max_attempts=5
@@ -194,15 +194,15 @@ resource "aws_ecs_task_definition" "flyway_task" {
194194
}
195195

196196
resource "aws_ecs_task_definition" "node_api_task" {
197-
family = "${var.app_name}"
197+
family = var.app_name
198198
network_mode = "awsvpc"
199199
requires_compatibilities = ["FARGATE"]
200200
cpu = var.api_cpu
201201
memory = var.api_memory
202202
execution_role_arn = aws_iam_role.ecs_task_execution_role.arn
203203
task_role_arn = aws_iam_role.app_container_role.arn
204204
container_definitions = jsonencode([
205-
{
205+
{
206206
name = "${local.container_name}"
207207
image = "${var.api_image}"
208208
essential = true
@@ -232,7 +232,7 @@ resource "aws_ecs_task_definition" "node_api_task" {
232232
value = "${var.db_schema}"
233233
},
234234
{
235-
name = "POSTGRES_POOL_SIZE"
235+
name = "POSTGRES_POOL_SIZE"
236236
value = "${var.postgres_pool_size}"
237237
},
238238
{
@@ -268,10 +268,10 @@ resource "aws_ecs_task_definition" "node_api_task" {
268268

269269

270270
resource "aws_ecs_service" "node_api_service" {
271-
name = "${var.app_name}"
272-
cluster = aws_ecs_cluster.ecs_cluster.id
273-
task_definition = aws_ecs_task_definition.node_api_task.arn
274-
desired_count = 1
271+
name = var.app_name
272+
cluster = aws_ecs_cluster.ecs_cluster.id
273+
task_definition = aws_ecs_task_definition.node_api_task.arn
274+
desired_count = 1
275275
health_check_grace_period_seconds = 60
276276

277277
capacity_provider_strategy {
@@ -292,10 +292,10 @@ resource "aws_ecs_service" "node_api_service" {
292292

293293
load_balancer {
294294
target_group_arn = aws_alb_target_group.app.id
295-
container_name = "${local.container_name}"
295+
container_name = local.container_name
296296
container_port = var.app_port
297297
}
298298
wait_for_steady_state = true
299-
depends_on = [aws_iam_role_policy_attachment.ecs_task_execution_role]
300-
tags = module.common.common_tags
299+
depends_on = [aws_iam_role_policy_attachment.ecs_task_execution_role]
300+
tags = module.common.common_tags
301301
}

infrastructure/api/iam.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ data "aws_iam_policy" "appRDS" {
2121
resource "aws_iam_role" "ecs_task_execution_role" {
2222
name = "${var.app_name}_ecs_role"
2323
assume_role_policy = data.aws_iam_policy_document.ecs_task_execution_role.json
24-
tags = module.common.common_tags
24+
tags = module.common.common_tags
2525
}
2626

2727
# ECS task execution role policy attachment

infrastructure/api/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ output "database_status" {
1818
value = {
1919
cluster_name_provided = var.db_cluster_name != ""
2020
using_fallback_creds = !local.db_resources_available
21-
db_endpoint = local.db_endpoint
22-
warning = !local.db_resources_available ? "Using fallback database credentials. Ensure database cluster exists before deploying." : null
21+
db_endpoint = local.db_endpoint
22+
warning = !local.db_resources_available ? "Using fallback database credentials. Ensure database cluster exists before deploying." : null
2323
}
2424
}

infrastructure/api/vars.tf

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,39 @@ variable "db_schema" {
2121

2222
variable "subnet_app_a" {
2323
description = "Value of the name tag for a subnet in the APP security group"
24-
type = string
25-
default = "App_Dev_aza_net"
24+
type = string
25+
default = "App_Dev_aza_net"
2626
}
2727

2828
variable "subnet_app_b" {
2929
description = "Value of the name tag for a subnet in the APP security group"
30-
type = string
31-
default = "App_Dev_azb_net"
30+
type = string
31+
default = "App_Dev_azb_net"
3232
}
3333
variable "subnet_web_a" {
3434
description = "Value of the name tag for a subnet in the APP security group"
35-
type = string
36-
default = "Web_Dev_aza_net"
35+
type = string
36+
default = "Web_Dev_aza_net"
3737
}
3838

3939
variable "subnet_web_b" {
4040
description = "Value of the name tag for a subnet in the APP security group"
41-
type = string
42-
default = "Web_Dev_azb_net"
41+
type = string
42+
default = "Web_Dev_azb_net"
4343
}
4444

4545

4646
# Networking Variables
4747
variable "subnet_data_a" {
4848
description = "Value of the name tag for a subnet in the DATA security group"
49-
type = string
50-
default = "Data_Dev_aza_net"
49+
type = string
50+
default = "Data_Dev_aza_net"
5151
}
5252

5353
variable "subnet_data_b" {
5454
description = "Value of the name tag for a subnet in the DATA security group"
55-
type = string
56-
default = "Data_Dev_azb_net"
55+
type = string
56+
default = "Data_Dev_azb_net"
5757
}
5858

5959
variable "app_port" {
@@ -62,7 +62,7 @@ variable "app_port" {
6262
default = 3000
6363
}
6464
variable "app_name" {
65-
description = " The APP name with environment (app_env)"
65+
description = " The APP name with environment (app_env)"
6666
type = string
6767
}
6868
variable "common_tags" {
@@ -82,28 +82,28 @@ variable "health_check_path" {
8282
description = "The path for the health check"
8383
type = string
8484
default = "/api/health"
85-
85+
8686
}
8787

8888
variable "api_cpu" {
89-
type = number
90-
default = "256"
89+
type = number
90+
default = "256"
9191
}
9292
variable "api_memory" {
93-
type = number
94-
default = "512"
93+
type = number
94+
default = "512"
9595
}
9696
variable "aws_region" {
97-
type = string
97+
type = string
9898
default = "ca-central-1"
9999
}
100100
variable "min_capacity" {
101-
type = number
101+
type = number
102102
default = 1
103103
}
104104
variable "max_capacity" {
105-
type = number
106-
default = 5
105+
type = number
106+
default = 5
107107
description = <<EOT
108108
The maximum number of tasks to run, please consider,
109109
connection pooling and other factors when setting this value,
@@ -123,9 +123,9 @@ variable "max_capacity" {
123123
## ECR Variables
124124

125125
variable "repository_names" {
126-
type = list(string)
127-
default = [ "bcgov/quickstart-aws-containers" ]
128-
126+
type = list(string)
127+
default = ["bcgov/quickstart-aws-containers"]
128+
129129
}
130130
variable "image_tag_mutability" {
131131
description = "Tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE."
@@ -160,7 +160,7 @@ variable "tags" {
160160
type = map(string)
161161
default = {}
162162
}
163-
variable "db_cluster_name"{
163+
variable "db_cluster_name" {
164164
description = "Name of the database cluster"
165165
type = string
166166
default = ""

0 commit comments

Comments
 (0)