Skip to content

Commit

Permalink
PRMP-935 change resource name
Browse files Browse the repository at this point in the history
  • Loading branch information
NogaNHS committed Oct 3, 2024
1 parent 5266f2b commit 862c17c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@
| [aws_iam_policy.cloudwatch_log_query_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.copy_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.dynamodb_policy_scan_bulk_report](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.dynamodb_stream_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.dynamodb_stream_manifest_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.dynamodb_stream_stitch_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.lambda_audit_splunk_sqs_queue_send_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.s3_document_data_policy_for_manifest_lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.s3_document_data_policy_for_stitch_lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
Expand Down Expand Up @@ -216,7 +217,8 @@
| [aws_iam_role_policy_attachment.s3_cross_account_restore_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_iam_role_policy_attachment.s3_restore_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_lambda_event_source_mapping.bulk_upload_lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_event_source_mapping) | resource |
| [aws_lambda_event_source_mapping.dynamodb_stream_event_mapping](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_event_source_mapping) | resource |
| [aws_lambda_event_source_mapping.dynamodb_stream_manifest](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_event_source_mapping) | resource |
| [aws_lambda_event_source_mapping.dynamodb_stream_stitch](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_event_source_mapping) | resource |
| [aws_lambda_event_source_mapping.nems_message_lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_event_source_mapping) | resource |
| [aws_lambda_permission.bulk_upload_metadata_schedule_permission](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource |
| [aws_lambda_permission.bulk_upload_report_schedule_permission](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource |
Expand Down
6 changes: 3 additions & 3 deletions infrastructure/lambda-generate-document-manifest.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module "generate-document-manifest-lambda" {
"arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
"arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy",
module.ndr-app-config.app_config_policy_arn,
aws_iam_policy.dynamodb_stream_policy.arn
aws_iam_policy.dynamodb_stream_manifest_policy.arn
]
rest_api_id = null
api_execution_arn = null
Expand All @@ -82,7 +82,7 @@ module "generate-document-manifest-lambda" {
]
}

resource "aws_iam_policy" "dynamodb_stream_policy" {
resource "aws_iam_policy" "dynamodb_stream_manifest_policy" {
name = "${terraform.workspace}_dynamodb_stream_to_manifest_policy"

policy = jsonencode({
Expand All @@ -103,7 +103,7 @@ resource "aws_iam_role_policy_attachment" "policy_generate_manifest_lambda" {
policy_arn = try(aws_iam_policy.lambda_audit_splunk_sqs_queue_send_policy[0].arn, null)
}

resource "aws_lambda_event_source_mapping" "dynamodb_stream_event_mapping" {
resource "aws_lambda_event_source_mapping" "dynamodb_stream_manifest" {
event_source_arn = module.zip_store_reference_dynamodb_table.dynamodb_stream_arn
function_name = module.generate-document-manifest-lambda.lambda_arn
batch_size = 1
Expand Down
6 changes: 3 additions & 3 deletions infrastructure/lambda-generate-stitch-record.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module "generate-stitch-record-lambda" {
"arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",
"arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy",
module.ndr-app-config.app_config_policy_arn,
aws_iam_policy.dynamodb_stream_policy.arn
aws_iam_policy.dynamodb_stream_stitch_policy.arn
]
rest_api_id = null
api_execution_arn = null
Expand All @@ -77,7 +77,7 @@ module "generate-stitch-record-lambda" {
]
}

resource "aws_iam_policy" "dynamodb_stream_policy" {
resource "aws_iam_policy" "dynamodb_stream_stitch_policy" {
name = "${terraform.workspace}_dynamodb_stream_to_stitch_policy"

policy = jsonencode({
Expand All @@ -98,7 +98,7 @@ resource "aws_iam_role_policy_attachment" "policy_generate_stitch_lambda" {
policy_arn = try(aws_iam_policy.lambda_audit_splunk_sqs_queue_send_policy[0].arn, null)
}

resource "aws_lambda_event_source_mapping" "dynamodb_stream_event_mapping" {
resource "aws_lambda_event_source_mapping" "dynamodb_stream_stitch" {
event_source_arn = module.stitch_store_reference_dynamodb_table.dynamodb_stream_arn
function_name = module.generate-stitch-record-lambda.lambda_arn
batch_size = 1
Expand Down

0 comments on commit 862c17c

Please sign in to comment.