Skip to content

Commit

Permalink
parameterise
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Woffenden <jacob.woffenden@justice.gov.uk>
  • Loading branch information
jacobwoffenden committed Nov 13, 2024
1 parent c568602 commit 85408a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ locals {
target_buckets = ["mojap-land-dev"]
datasync_target_buckets = ["mojap-land-dev"]

/* Target KMS */
mojap_land_kms_key = "arn:aws:kms:eu-west-1:${local.environment_management.account_ids["analytical-plaform-data-production"]}:key/8c53fbac-3106-422a-8f3d-409bb3b0c94d"

/* Transfer Server */
transfer_server_hostname = "sftp.development.ingestion.analytical-platform.service.justice.gov.uk"
transfer_server_sftp_users = {}
Expand Down Expand Up @@ -76,6 +79,9 @@ locals {
target_buckets = ["mojap-land"]
datasync_target_buckets = ["mojap-land"]

/* Target KMS */
mojap_land_kms_key = "arn:aws:kms:eu-west-1:${local.environment_management.account_ids["analytical-plaform-data-production"]}:key/2855ac30-4e14-482e-85ca-53258e01f64c"

/* Transfer Server */
transfer_server_hostname = "sftp.ingestion.analytical-platform.service.justice.gov.uk"
transfer_server_sftp_users = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ data "aws_iam_policy_document" "datasync_replication" {
"kms:Encrypt",
"kms:GenerateDataKey"
]
resources = ["arn:aws:kms:eu-west-1:593291632749:key/2855ac30-4e14-482e-85ca-53258e01f64c"]
resources = [local.environment_configuration.mojap_land_kms_key]
}
statement {
sid = "SourceBucketKMSKey"
Expand Down
4 changes: 2 additions & 2 deletions terraform/environments/analytical-platform-ingestion/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ module "datasync_bucket" {
}

destination = {
account_id = "593291632749" // TODO: replace with local.environment_management account ID
account_id = local.environment_management.account_ids["analytical-plaform-data-production"]
bucket = "arn:aws:s3:::${local.environment_configuration.datasync_target_buckets[0]}"
storage_class = "STANDARD"
access_control_translation = {
owner = "Destination"
}
encryption_configuration = {
replica_kms_key_id = "arn:aws:kms:eu-west-1:593291632749:key/2855ac30-4e14-482e-85ca-53258e01f64c"
replica_kms_key_id = local.environment_configuration.mojap_land_kms_key
}
metrics = {
status = "Enabled"
Expand Down

0 comments on commit 85408a1

Please sign in to comment.