File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
terraform/modules/lambdas Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,13 @@ resource "aws_iam_role" "api_role" {
3232 Effect = " Allow"
3333 Principal = {
3434 Service = " lambda.amazonaws.com"
35+ },
36+ Condition = {
37+ ArnLike = {
38+ " AWS:SourceArn" = [
39+ " arn:aws:lambda:${ data . aws_region . current . name } :${ data . aws_caller_identity . current . account_id } :function:${ local . core_api_lambda_name } "
40+ ]
41+ }
3542 }
3643 },
3744 ]
@@ -48,6 +55,13 @@ resource "aws_iam_role" "sqs_consumer_role" {
4855 Effect = " Allow"
4956 Principal = {
5057 Service = " lambda.amazonaws.com"
58+ },
59+ Condition = {
60+ ArnLike = {
61+ " AWS:SourceArn" = [
62+ " arn:aws:lambda:${ data . aws_region . current . name } :${ data . aws_caller_identity . current . account_id } :function:${ local . core_sqs_consumer_lambda_name } "
63+ ]
64+ }
5165 }
5266 },
5367 ]
You can’t perform that action at this time.
0 commit comments