generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5496 from ministryofjustice/update-ingestion
⚙️ Update Analytical Platform Ingestion
- Loading branch information
Showing
8 changed files
with
114 additions
and
23 deletions.
There are no files selected for viewing
12 changes: 8 additions & 4 deletions
12
terraform/environments/analytical-platform-ingestion/cloudwatch-log-groups.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# Deactivated for now | ||
# resource "aws_cloudwatch_log_group" "transfer_structured_logs" { | ||
# name = "/aws/transfer-structured-logs" | ||
# } | ||
module "transfer_structured_logs" { | ||
source = "terraform-aws-modules/cloudwatch/aws//modules/log-group" | ||
version = "5.3.1" | ||
|
||
name = "/aws/transfer-structured-logs" | ||
kms_key_id = module.transfer_logs_kms.key_arn | ||
retention_in_days = 400 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
terraform/environments/analytical-platform-ingestion/iam-policies.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
data "aws_iam_policy_document" "transfer_server" { | ||
statement { | ||
sid = "AllowKMS" | ||
effect = "Allow" | ||
actions = [ | ||
"kms:ReEncrypt*", | ||
"kms:GenerateDataKey*", | ||
"kms:Encrypt", | ||
"kms:DescribeKey", | ||
"kms:Decrypt", | ||
] | ||
resources = [module.transfer_logs_kms.key_arn] | ||
} | ||
} | ||
|
||
module "transfer_server_iam_policy" { | ||
#checkov:skip=CKV_TF_1:Module registry does not support commit hashes for versions | ||
|
||
source = "terraform-aws-modules/iam/aws//modules/iam-policy" | ||
version = "5.37.1" | ||
|
||
name_prefix = "transfer-server" | ||
|
||
policy = data.aws_iam_policy_document.transfer_server.json | ||
} |
18 changes: 18 additions & 0 deletions
18
terraform/environments/analytical-platform-ingestion/iam-roles.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module "transfer_server_iam_role" { | ||
#checkov:skip=CKV_TF_1:Module registry does not support commit hashes for versions | ||
|
||
source = "terraform-aws-modules/iam/aws//modules/iam-assumable-role" | ||
version = "5.37.1" | ||
|
||
create_role = true | ||
|
||
role_name_prefix = "transfer-server" | ||
role_requires_mfa = false | ||
|
||
trusted_role_services = ["transfer.amazonaws.com"] | ||
|
||
custom_role_policy_arns = [ | ||
module.transfer_server_iam_policy.arn, | ||
"arn:aws:iam::aws:policy/service-role/AWSTransferLoggingAccess" | ||
] | ||
} |
39 changes: 39 additions & 0 deletions
39
terraform/environments/analytical-platform-ingestion/kms-keys.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 1 addition & 14 deletions
15
terraform/environments/analytical-platform-ingestion/transfer-user.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters