Skip to content

Commit

Permalink
Merge pull request #1015 from AlexsLemonade/avrohom/960-add-tags-to-b…
Browse files Browse the repository at this point in the history
…atch-resources

960 - Add Tags to Batch Resources
  • Loading branch information
avrohomgottlieb authored Dec 5, 2024
2 parents 1b3661c + c113277 commit 4e12254
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
5 changes: 4 additions & 1 deletion infrastructure/batch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
# general configuration
user = var.user
stage = var.stage
default_tags = var.default_tags
batch_tags = {
module = "batch",
revision = "initial - 16 vCPU compute environment and 1 queue"
}
}
2 changes: 1 addition & 1 deletion infrastructure/batch/compute_environment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ resource "aws_batch_compute_environment" "scpca_portal_project" {
type = "MANAGED"
depends_on = [aws_iam_role_policy_attachment.batch_service_role]

tags = var.default_tags
tags = var.batch_tags
}
2 changes: 2 additions & 0 deletions infrastructure/batch/job_definition.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,6 @@ resource "aws_batch_job_definition" "scpca_portal_project" {
retry_strategy {
attempts = 3
}

tags = var.batch_tags
}
2 changes: 1 addition & 1 deletion infrastructure/batch/job_queue.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ resource "aws_batch_job_queue" "scpca_portal_project" {
aws_batch_compute_environment.scpca_portal_project.arn,
]

tags = var.default_tags
tags = var.batch_tags
}
6 changes: 3 additions & 3 deletions infrastructure/batch/roles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resource "aws_iam_role" "batch_service_role" {
}
EOF

tags = var.default_tags
tags = var.batch_tags
}

resource "aws_iam_role_policy_attachment" "batch_service_role" {
Expand All @@ -41,7 +41,7 @@ resource "aws_iam_role" "ecs_task_role" {
}
EOF

tags = var.default_tags
tags = var.batch_tags
}

resource "aws_iam_role_policy_attachment" "ecs_task_execution" {
Expand All @@ -66,7 +66,7 @@ resource "aws_iam_role" "batch_job_role" {
}
EOF

tags = var.default_tags
tags = var.batch_tags
}

resource "aws_iam_policy" "batch_job_s3_access" {
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/batch/security.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "aws_security_group" "scpca_portal_batch" {
name = "scpca-portal-batch-security-group-${var.user}-${var.stage}"
vpc_id = var.scpca_portal_vpc.id
tags = var.default_tags
tags = var.batch_tags

egress {
from_port = 0
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/batch/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ variable "scpca_portal_db_security_group" { default = "" }
# general configuration
variable "user" { default = "" }
variable "stage" { default = "" }
variable "default_tags" { default = "" }
variable "batch_tags" { default = "" }

0 comments on commit 4e12254

Please sign in to comment.