Skip to content

Commit f1ad0ae

Browse files
Infrastructure tweaks
- Unique secret names on re-creation - Unique names for security groups
1 parent 0c8be14 commit f1ad0ae

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

terraform/app/ssm_parameters.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,27 @@ resource "aws_ssm_parameter" "cloud_variables" {
2525
}
2626

2727
resource "aws_secretsmanager_secret" "jwt_sign" {
28-
name = "rep-jwt-signing-secret-${var.environment}"
28+
name = "rep-jwt-signing-secret-${var.environment}-${substr(uuid(), 0, 4)}"
2929
description = "Secret for jwt signing"
3030
recovery_window_in_days = 7
3131
tags = {
3232
Name = "jwt-signing-${var.environment}"
3333
}
34+
lifecycle {
35+
ignore_changes = [name]
36+
}
3437
}
3538

3639
resource "aws_secretsmanager_secret" "reporting_flask" {
37-
name = "reporting-cookie-secret-${var.environment}"
40+
name = "reporting-cookie-secret-${var.environment}-${substr(uuid(), 0, 4)}"
3841
description = "Secret for signing cookies in the reporting service"
3942
recovery_window_in_days = 7
4043
tags = {
4144
Name = "reporting-cookie-secret-${var.environment}"
4245
}
46+
lifecycle {
47+
ignore_changes = [name]
48+
}
4349
}
4450

4551
ephemeral "aws_secretsmanager_random_password" "reporting_flask" {

terraform/app/valkey.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ resource "aws_cloudwatch_log_group" "valkey_engine_log" {
112112
}
113113

114114
resource "aws_security_group" "reporting_valkey" {
115-
name = "mavis-cache-${var.environment}"
115+
name = "mavis-cache-reporting-${var.environment}"
116116
description = "Security group for Valkey ElastiCache for the reporting service"
117117
vpc_id = aws_vpc.application_vpc.id
118118

terraform/app/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ variable "enable_enhanced_db_monitoring" {
121121
locals {
122122
is_production = var.environment == "production"
123123
parameter_store_variables = tomap({ #TODO: Remove once all variables are sourced from application config
124-
MAVIS__ACADEMIC_YEAR_TODAY_OVERRIDE = ""
125-
MAVIS__ACADEMIC_YEAR_NUMBER_OF_PREPARATION_DAYS = ""
126-
MAVIS__PDS__ENQUEUE_BULK_UPDATES = ""
124+
MAVIS__ACADEMIC_YEAR_TODAY_OVERRIDE = "a"
125+
MAVIS__ACADEMIC_YEAR_NUMBER_OF_PREPARATION_DAYS = "a"
126+
MAVIS__PDS__ENQUEUE_BULK_UPDATES = "a"
127127
MAVIS__PDS__RATE_LIMIT_PER_SECOND = 5
128128
GOOD_JOB_MAX_THREADS = 5
129129
SIDEKIQ_CONCURRENCY = 5

0 commit comments

Comments
 (0)