Skip to content

Commit 2b44031

Browse files
authored
Merge branch 'main' into PRMP-583
2 parents d632296 + d8500b1 commit 2b44031

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

infrastructure/buckets.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ module "ndr-lloyd-george-store" {
7373
]
7474
}
7575

76+
module "migration-dynamodb-segment-store" {
77+
source = "./modules/s3/"
78+
access_logs_enabled = local.is_production
79+
access_logs_bucket_id = local.access_logs_bucket_id
80+
bucket_name = var.migration_dynamodb_segment_store_bucket_name
81+
enable_cors_configuration = false
82+
enable_bucket_versioning = true
83+
environment = var.environment
84+
owner = var.owner
85+
force_destroy = local.is_force_destroy
86+
}
87+
7688
module "statistical-reports-store" {
7789
source = "./modules/s3/"
7890
access_logs_enabled = local.is_production
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module "migration-dynamodb-segment-lambda" {
2+
source = "./modules/lambda"
3+
name = "MigrationDynamodbSegment"
4+
handler = "handlers.migration_dynamodb_segment_handler.lambda_handler"
5+
lambda_timeout = 900
6+
memory_size = 1792
7+
iam_role_policy_documents = [
8+
module.migration-dynamodb-segment-store.s3_read_policy_document,
9+
module.migration-dynamodb-segment-store.s3_write_policy_document,
10+
data.aws_iam_policy_document.migration_dynamodb_access.json
11+
]
12+
kms_deletion_window = var.kms_deletion_window
13+
14+
lambda_environment_variables = {
15+
WORKSPACE = terraform.workspace
16+
MIGRATION_SEGMENT_BUCKET_NAME = "${terraform.workspace}-${var.migration_dynamodb_segment_store_bucket_name}"
17+
}
18+
is_gateway_integration_needed = false
19+
is_invoked_from_gateway = false
20+
}
21+
22+
data "aws_iam_policy_document" "migration_dynamodb_access" {
23+
statement {
24+
effect = "Allow"
25+
actions = [
26+
"dynamodb:DescribeTable"
27+
]
28+
resources = [
29+
"arn:aws:dynamodb:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/${terraform.workspace}_*"
30+
]
31+
}
32+
}

infrastructure/variable.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ variable "docstore_bucket_name" {
3333
default = "ndr-document-store"
3434
}
3535

36+
variable "migration_dynamodb_segment_store_bucket_name" {
37+
description = "The name of the S3 bucket to store the segments for DynamoDB migration."
38+
type = string
39+
default = "migration-dynamodb-segment-store"
40+
}
41+
3642
variable "zip_store_bucket_name" {
3743
description = "The name of the S3 bucket used as a zip store."
3844
type = string

0 commit comments

Comments
 (0)