Skip to content

Commit 57e7ed3

Browse files
committed
refactor: streamline variable declarations in mpc-party and mpc-network-consumer modules
Signed-off-by: Ghislain Cheng <ghislain.cheng@zama.ai>
1 parent 6b9af99 commit 57e7ed3

File tree

6 files changed

+21
-121
lines changed

6 files changed

+21
-121
lines changed

examples/mpc-network-consumer/main.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
module "vpc_endpoint_consumer" {
55
source = "git::https://github.com/zama-ai/terraform-mpc-modules.git//modules/vpc-endpoint-consumer?ref=v0.1.7"
66

7-
# Network environment configuration
8-
network_environment = var.network_environment
9-
enable_region_validation = var.enable_region_validation
10-
117
# Partner services configuration
128
party_services = var.party_services
139

@@ -18,7 +14,6 @@ module "vpc_endpoint_consumer" {
1814
security_group_ids = var.security_group_ids
1915

2016
# VPC Interface Endpoint configuration
21-
endpoint_policy = null
2217
private_dns_enabled = var.private_dns_enabled
2318
route_table_ids = []
2419

examples/mpc-network-consumer/terraform.tfvars.example

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# AWS Configuration
2-
aws_region = "eu-west-1"
3-
enable_region_validation = false
4-
5-
# Network Environment Configuration
6-
network_environment = "testnet"
2+
aws_region = "eu-west-1"
73

84
# Cluster Configuration
95
cluster_name = "zws-dev"

examples/mpc-network-consumer/variables.tf

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
# Network Environment Configuration
2-
variable "network_environment" {
3-
description = "MPC network environment that determines region constraints"
4-
type = string
5-
default = "testnet"
6-
7-
validation {
8-
condition = contains(["testnet", "mainnet"], var.network_environment)
9-
error_message = "Network environment must be either 'testnet' or 'mainnet'."
10-
}
11-
}
12-
131
variable "aws_region" {
142
description = "AWS region where resources will be created"
153
type = string
@@ -22,12 +10,6 @@ variable "aws_profile" {
2210
default = "token-zws-dev"
2311
}
2412

25-
variable "enable_region_validation" {
26-
type = bool
27-
description = "Whether to enable region validation"
28-
default = true
29-
}
30-
3113
# MPC Cluster Configuration
3214
variable "cluster_name" {
3315
description = "Name of the MPC cluster"

examples/mpc-party/main.tf

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ module "mpc_party" {
77
source = "git::https://github.com/zama-ai/terraform-mpc-modules.git//modules/mpc-party?ref=v0.1.7"
88

99
# Network environment configuration
10-
network_environment = var.network_environment
11-
enable_region_validation = var.enable_region_validation
10+
network_environment = var.network_environment
1211

1312
# Party configuration
1413
party_id = var.party_id
@@ -77,33 +76,24 @@ module "mpc_party" {
7776
nitro_enclaves_override_memory_mib = var.nitro_enclaves_override_memory_mib
7877

7978
# RDS Configuration
80-
enable_rds = var.enable_rds
81-
rds_db_name = var.rds_db_name
82-
rds_create_monitoring_role = var.rds_create_monitoring_role
83-
rds_manage_master_user_password = var.rds_manage_master_user_password
84-
rds_username = var.rds_username
85-
rds_engine = var.rds_engine
86-
rds_engine_version = var.rds_engine_version
87-
rds_instance_class = var.rds_instance_class
88-
rds_allocated_storage = var.rds_allocated_storage
89-
rds_max_allocated_storage = var.rds_max_allocated_storage
90-
rds_multi_az = var.rds_multi_az
91-
rds_backup_retention_period = var.rds_backup_retention_period
92-
rds_maintenance_window = var.rds_maintenance_window
93-
rds_monitoring_interval = var.rds_monitoring_interval
94-
rds_monitoring_role_arn = var.rds_monitoring_role_arn
95-
rds_performance_insights_enabled = var.rds_performance_insights_enabled
96-
rds_performance_insights_kms_key_id = var.rds_performance_insights_kms_key_id
97-
rds_performance_insights_retention_period = var.rds_performance_insights_retention_period
98-
rds_blue_green_update_enabled = var.rds_blue_green_update_enabled
99-
rds_parameters = var.rds_parameters
100-
rds_snapshot_identifier = var.rds_snapshot_identifier
101-
rds_final_snapshot_enabled = var.rds_final_snapshot_enabled
102-
rds_k8s_secret_name = var.rds_k8s_secret_name
103-
rds_k8s_secret_namespace = var.rds_k8s_secret_namespace
104-
rds_allowed_cidr_blocks = var.rds_allowed_cidr_blocks
105-
rds_vpc_id = var.rds_vpc_id
106-
rds_deletion_protection = var.rds_deletion_protection
79+
enable_rds = var.enable_rds
80+
rds_db_name = var.rds_db_name
81+
rds_create_monitoring_role = var.rds_create_monitoring_role
82+
rds_username = var.rds_username
83+
rds_engine = var.rds_engine
84+
rds_engine_version = var.rds_engine_version
85+
rds_instance_class = var.rds_instance_class
86+
rds_allocated_storage = var.rds_allocated_storage
87+
rds_max_allocated_storage = var.rds_max_allocated_storage
88+
rds_multi_az = var.rds_multi_az
89+
rds_backup_retention_period = var.rds_backup_retention_period
90+
rds_maintenance_window = var.rds_maintenance_window
91+
rds_monitoring_interval = var.rds_monitoring_interval
92+
rds_monitoring_role_arn = var.rds_monitoring_role_arn
93+
rds_parameters = var.rds_parameters
94+
rds_allowed_cidr_blocks = var.rds_allowed_cidr_blocks
95+
rds_vpc_id = var.rds_vpc_id
96+
rds_deletion_protection = var.rds_deletion_protection
10797

10898
# Tagging
10999
common_tags = merge(var.additional_tags, {

examples/mpc-party/terraform.tfvars.example

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
network_environment = "testnet"
33

44
# AWS Configuration
5-
aws_region = "eu-west-1"
6-
enable_region_validation = false
5+
aws_region = "eu-west-1"
76

87
# MPC Party Configuration
98
party_id = 1
@@ -37,10 +36,8 @@ additional_tags = {
3736

3837
# RDS Configuration
3938
enable_rds = true
40-
rds_prefix = "zama" # Use your organization prefix here
4139
rds_db_name = "kmsconnector"
4240
rds_username = "kmsconnector"
43-
rds_enable_master_password_rotation = true # To change to 'false' on second apply only (there is a bug when initializing the value to 'false')
4441
rds_deletion_protection = false # Allow deletion of RDS instance
4542

4643
# Node Group Configuration

examples/mpc-party/variables.tf

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ variable "aws_profile" {
2222
default = "token-zws-dev"
2323
}
2424

25-
variable "enable_region_validation" {
26-
type = bool
27-
description = "Whether to enable region validation"
28-
default = true
29-
}
30-
3125
# MPC Party Configuration
3226
variable "party_id" {
3327
description = "Party ID for the MPC service"
@@ -286,12 +280,6 @@ variable "rds_username" {
286280
default = "kmsconnector"
287281
}
288282

289-
variable "rds_manage_master_user_password" {
290-
description = "Whether to manage the master user password"
291-
type = bool
292-
default = false
293-
}
294-
295283
variable "rds_engine" {
296284
description = "Engine for the RDS database"
297285
type = string
@@ -358,30 +346,6 @@ variable "rds_monitoring_role_arn" {
358346
default = null
359347
}
360348

361-
variable "rds_performance_insights_enabled" {
362-
description = "Whether to enable performance insights for the RDS database"
363-
type = bool
364-
default = false
365-
}
366-
367-
variable "rds_performance_insights_kms_key_id" {
368-
description = "KMS key ID for performance insights"
369-
type = string
370-
default = null
371-
}
372-
373-
variable "rds_performance_insights_retention_period" {
374-
description = "Retention period for performance insights"
375-
type = number
376-
default = 7
377-
}
378-
379-
variable "rds_blue_green_update_enabled" {
380-
description = "Whether to enable blue-green update for the RDS database"
381-
type = bool
382-
default = false
383-
}
384-
385349
variable "use_eks_cluster_authentication" {
386350
description = "Whether to use EKS cluster authentication"
387351
type = bool
@@ -394,30 +358,6 @@ variable "rds_parameters" {
394358
default = []
395359
}
396360

397-
variable "rds_snapshot_identifier" {
398-
description = "Snapshot identifier for the RDS database"
399-
type = string
400-
default = null
401-
}
402-
403-
variable "rds_final_snapshot_enabled" {
404-
description = "Whether to enable final snapshot for the RDS database"
405-
type = bool
406-
default = false
407-
}
408-
409-
variable "rds_k8s_secret_name" {
410-
description = "Name of the Kubernetes secret for the RDS database"
411-
type = string
412-
default = "rds-credentials"
413-
}
414-
415-
variable "rds_k8s_secret_namespace" {
416-
description = "Namespace of the Kubernetes secret for the RDS database"
417-
type = string
418-
default = "mpc-party"
419-
}
420-
421361
variable "rds_allowed_cidr_blocks" {
422362
description = "Allowed CIDR blocks for the RDS database"
423363
type = list(string)

0 commit comments

Comments
 (0)