Skip to content

Commit 1da97a6

Browse files
committed
Fix FSx Lustre module configuration and storage capacity
1 parent fe630da commit 1da97a6

File tree

4 files changed

+29
-24
lines changed

4 files changed

+29
-24
lines changed

infrastructure/dev/us-east-2/storage/fsx-lustre-persistent/terragrunt.hcl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ inputs = {
2121
name = "hpc-dev-persistent"
2222

2323
# Storage Configuration - Hardcoded for dev environment
24-
storage_capacity = 10 # 10TB for dev
24+
storage_capacity = 10240 # 10TB = 10240 GiB for dev
2525
storage_type = "SSD"
2626
deployment_type = "PERSISTENT_1"
2727
per_unit_storage_throughput = 1000 # MB/s per TiB
@@ -44,13 +44,17 @@ inputs = {
4444
# S3 Data Repository
4545
data_repository_path = "s3://hpc-dev-us-east-2-data-repository/persistent" # Will be replaced when S3 is applied
4646

47-
# Tags - Hardcoded for dev environment
48-
tags = {
47+
# Common tags
48+
common_tags = {
4949
Environment = "dev"
5050
Region = "us-east-2"
5151
Project = "HPC-Networking"
5252
ManagedBy = "Terragrunt"
5353
Owner = "DevOps-Team"
54+
}
55+
56+
# Tags - Hardcoded for dev environment
57+
tags = {
5458
Purpose = "Persistent-Storage"
5559
DataLifecycle = "Long-term"
5660
Name = "hpc-dev-persistent"

infrastructure/dev/us-east-2/storage/fsx-lustre-scratch/terragrunt.hcl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ inputs = {
2121
name = "hpc-dev-scratch"
2222

2323
# Storage Configuration - Hardcoded for dev environment
24-
storage_capacity = 50 # 50TB for dev
24+
storage_capacity = 51200 # 50TB = 51200 GiB for dev
2525
storage_type = "SSD"
2626
deployment_type = "PERSISTENT_1"
2727
per_unit_storage_throughput = 200 # MB/s per TiB
@@ -44,13 +44,17 @@ inputs = {
4444
# S3 Data Repository
4545
data_repository_path = "s3://hpc-dev-us-east-2-data-repository/scratch" # Will be replaced when S3 is applied
4646

47-
# Tags - Hardcoded for dev environment
48-
tags = {
47+
# Common tags
48+
common_tags = {
4949
Environment = "dev"
5050
Region = "us-east-2"
5151
Project = "HPC-Networking"
5252
ManagedBy = "Terragrunt"
5353
Owner = "DevOps-Team"
54+
}
55+
56+
# Tags - Hardcoded for dev environment
57+
tags = {
5458
Purpose = "Scratch-Storage"
5559
DataLifecycle = "Temporary"
5660
Name = "hpc-dev-scratch"

infrastructure/modules/fsx-lustre/main.tf

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,20 @@ resource "aws_fsx_lustre_file_system" "main" {
2929
subnet_ids = var.subnet_ids
3030
security_group_ids = var.security_group_ids
3131

32-
# Data repository association
33-
dynamic "data_repository_association" {
34-
for_each = var.data_repository_path != null ? [1] : []
35-
content {
36-
data_repository_path = var.data_repository_path
37-
file_system_path = var.file_system_path
38-
}
39-
}
40-
41-
tags = merge(var.tags, {
32+
tags = merge(var.common_tags, var.tags, {
4233
Name = var.name
4334
})
4435
}
4536

46-
# Mount target for the file system
47-
resource "aws_fsx_lustre_file_system" "mount_target" {
48-
count = var.create_mount_target ? 1 : 0
37+
# Data repository association
38+
resource "aws_fsx_data_repository_association" "main" {
39+
count = var.data_repository_path != null ? 1 : 0
4940

50-
file_system_id = aws_fsx_lustre_file_system.main.id
51-
subnet_id = var.subnet_ids[0]
52-
security_groups = var.security_group_ids
41+
file_system_id = aws_fsx_lustre_file_system.main.id
42+
data_repository_path = var.data_repository_path
43+
file_system_path = var.file_system_path
5344

54-
tags = merge(var.tags, {
55-
Name = "${var.name}-mount-target"
45+
tags = merge(var.common_tags, var.tags, {
46+
Name = "${var.name}-data-repo"
5647
})
5748
}

infrastructure/modules/fsx-lustre/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ variable "create_mount_target" {
103103
default = false
104104
}
105105

106+
variable "common_tags" {
107+
description = "A map of common tags to assign to the file system"
108+
type = map(string)
109+
default = {}
110+
}
111+
106112
variable "tags" {
107113
description = "A map of tags to assign to the file system"
108114
type = map(string)

0 commit comments

Comments
 (0)