Skip to content

Commit

Permalink
Call centre migration connector secret (#8921)
Browse files Browse the repository at this point in the history
* create secret to store creds for transfer connector

* small tweaks, formatting
  • Loading branch information
dms1981 authored Dec 2, 2024
1 parent 89e91a2 commit 1bb7df5
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions terraform/environments/long-term-storage/call-centre-migration.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
resource "aws_cloudwatch_log_group" "call_centre" {
name_prefix = "call-centre-migration"
retention_in_days = 365
tags = local.tags
}

resource "aws_kms_key" "call_centre" {
enable_key_rotation = true
rotation_period_in_days = 90
Expand Down Expand Up @@ -29,6 +35,14 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "call_centre" {
}
}

resource "aws_secretsmanager_secret" "call_centre" {
description = "Secret containing key-value pairs for AWS Transfer connector."
force_overwrite_replica_secret = true
name = "aws/transfer/${aws_transfer_server.call_centre.id}/call-centre"
recovery_window_in_days = 0
tags = local.tags
}

resource "aws_transfer_server" "call_centre" {
logging_role = aws_iam_role.call_centre_transfer_logging.arn
structured_log_destinations = ["${aws_cloudwatch_log_group.call_centre.arn}:*"]
Expand All @@ -38,12 +52,6 @@ resource "aws_transfer_server" "call_centre" {
)
}

resource "aws_cloudwatch_log_group" "call_centre" {
name_prefix = "call-centre-migration"
retention_in_days = 365
tags = local.tags
}

resource "aws_iam_role" "call_centre_transfer_logging" {
name_prefix = "call-centre-migration-logging"
assume_role_policy = data.aws_iam_policy_document.aws_transfer_assume_role_policy.json
Expand Down

0 comments on commit 1bb7df5

Please sign in to comment.