Skip to content

Commit

Permalink
Remove redundant count condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ha7315 committed Oct 10, 2024
1 parent 8c14231 commit d2914e2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 11 deletions.
5 changes: 0 additions & 5 deletions modules/postgres-etl/load/load_sfn.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
resource "aws_sfn_state_machine" "s3_to_rds" {
count = var.environment_name == "production" ? 0 : 1 # This state machine is skipped in production

name = "postgres-etl-s3-to-rds"
role_arn = aws_iam_role.s3_to_rds_sfn.arn
Expand Down Expand Up @@ -53,7 +52,6 @@ EOF
}

resource "aws_iam_role" "s3_to_rds_sfn" {
count = var.environment_name == "production" ? 0 : 1 # This role is skipped in production

name = "${var.migrator_name}_s3_to_rds_sfn"

Expand All @@ -77,7 +75,6 @@ resource "aws_iam_role" "s3_to_rds_sfn" {
}

data "aws_iam_policy_document" "s3_to_rds_sfn" {
count = var.environment_name == "production" ? 0 : 1 # This policy is skipped in production

version = "2012-10-17"

Expand Down Expand Up @@ -143,8 +140,6 @@ data "aws_iam_policy_document" "s3_to_rds_sfn" {
}

resource "aws_iam_role_policy" "s3_to_rds_sfn" {
count = var.environment_name == "production" ? 0 : 1 # This policy is skipped in production

role = aws_iam_role.s3_to_rds_sfn.name
policy = data.aws_iam_policy_document.s3_to_rds_sfn.json
}
4 changes: 0 additions & 4 deletions modules/postgres-etl/load/load_sg.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
resource "aws_security_group" "etl_load_task" {
count = var.environment_name == "production" ? 0 : 1 # Don't create for production

name = "${var.resource_name_prefixes.normal}:${upper(var.migrator_name)}:ECSTASK:LOAD"
description = "PG ETL Load task"
vpc_id = var.vpc_id
Expand All @@ -11,8 +9,6 @@ resource "aws_security_group" "etl_load_task" {
}

resource "aws_security_group_rule" "etl_load_task_https_out_anywhere" {
count = var.environment_name == "production" ? 0 : 1 # Don't create for production

cidr_blocks = ["0.0.0.0/0"]
description = "Allow https out from load task to anywhere"
from_port = 443
Expand Down
2 changes: 0 additions & 2 deletions modules/postgres-etl/load/load_task.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module "load_task" {
source = "../../../resource-groups/ecs-fargate-task-definition"

count = var.environment_name == "production" ? 0 : 1 # Don't create the load task in production

aws_account_id = var.aws_account_id
aws_region = var.aws_region
container_definitions = {
Expand Down

0 comments on commit d2914e2

Please sign in to comment.