File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed
Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff 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+
7688module "statistical-reports-store" {
7789 source = " ./modules/s3/"
7890 access_logs_enabled = local. is_production
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff 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+
3642variable "zip_store_bucket_name" {
3743 description = " The name of the S3 bucket used as a zip store."
3844 type = string
You can’t perform that action at this time.
0 commit comments