Skip to content

Commit

Permalink
gdpr api and merge api snapshots ids from ssm (#6435)
Browse files Browse the repository at this point in the history
* gdpr api and merge api snapshots ids from ssm
  • Loading branch information
sobostion authored Jun 20, 2024
1 parent 71a2a01 commit 9bf5566
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
2 changes: 1 addition & 1 deletion terraform/environments/delius-core/locals_development.tf
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ locals {
rds_engine_version = "15"
rds_instance_class = "db.t3.small"
rds_allocated_storage = 30
rds_username = "postgres"
rds_username = "dbadmin"
rds_port = 5432
rds_license_model = "postgresql-license"
rds_deletion_protection = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module "gdpr_api_service" {
rds_backup_retention_period = var.delius_microservice_configs.gdpr_api.rds_backup_retention_period
rds_backup_window = var.delius_microservice_configs.gdpr_api.rds_backup_window
rds_deletion_protection = var.delius_microservice_configs.gdpr_api.rds_deletion_protection
snapshot_identifier = var.delius_microservice_configs.gdpr_api.snapshot_identifier
snapshot_identifier = data.aws_ssm_parameter.gdpr_api_snapshot_identifier.value
rds_skip_final_snapshot = var.delius_microservice_configs.gdpr_api.rds_skip_final_snapshot

container_vars_default = {
Expand Down Expand Up @@ -80,3 +80,20 @@ module "gdpr_api_service" {
frontend_lb_arn_suffix = aws_lb.delius_core_frontend.arn_suffix
enable_platform_backups = var.enable_platform_backups
}

#######################
# GDPR API Params #
#######################

resource "aws_ssm_parameter" "gpdr_api_snapshot_identifier" {
name = "/delius-core-${var.env_name}/gdpr-api/snapshot_id"
type = "String"
value = "DEFAULT"
lifecycle {
ignore_changes = [value]
}
}

data "aws_ssm_parameter" "gdpr_api_snapshot_identifier" {
name = aws_ssm_parameter.gpdr_api_snapshot_identifier.name
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module "merge_api_service" {
rds_username = var.delius_microservice_configs.merge_api.rds_username
rds_license_model = var.delius_microservice_configs.merge_api.rds_license_model
rds_deletion_protection = var.delius_microservice_configs.merge_api.rds_deletion_protection
snapshot_identifier = var.delius_microservice_configs.merge_api.snapshot_identifier
snapshot_identifier = data.aws_ssm_parameter.merge_api_snapshot_identifier.value
rds_skip_final_snapshot = var.delius_microservice_configs.merge_api.rds_skip_final_snapshot
maintenance_window = var.delius_microservice_configs.merge_api.maintenance_window
rds_backup_retention_period = var.delius_microservice_configs.merge_api.rds_backup_retention_period
Expand Down Expand Up @@ -79,3 +79,20 @@ module "merge_api_service" {
frontend_lb_arn_suffix = aws_lb.delius_core_frontend.arn_suffix
enable_platform_backups = var.enable_platform_backups
}

#######################
# Merge API Params #
#######################

resource "aws_ssm_parameter" "merge_api_snapshot_identifier" {
name = "/delius-core-${var.env_name}/merge-api/snapshot_id"
type = "String"
value = "DEFAULT"
lifecycle {
ignore_changes = [value]
}
}

data "aws_ssm_parameter" "merge_api_snapshot_identifier" {
name = aws_ssm_parameter.merge_api_snapshot_identifier.name
}

0 comments on commit 9bf5566

Please sign in to comment.