Skip to content

Commit

Permalink
lambda privs for cognito
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerthome committed Oct 14, 2024
1 parent 27273c1 commit 3dea2a2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions terraform-incubator/home-unite-us/dev/cognito.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,22 @@ resource "aws_iam_role" "cognito_idp" {
})
}

resource "aws_lambda_permission" "allow_message_execution_from_user_pool" {
statement_id = "AllowMessageExecutionFromUserPool"
action = "lambda:InvokeFunction"
function_name = aws_lambda_function.cognito_custom_message.function_name
principal = "cognito-idp.amazonaws.com"
source_arn = aws_cognito_user_pool.homeuniteus.arn
}

resource "aws_lambda_permission" "allow_merge_execution_from_user_pool" {
statement_id = "AllowMergeExecutionFromUserPool"
action = "lambda:InvokeFunction"
function_name = aws_lambda_function.cognito_merge_users.function_name
principal = "cognito-idp.amazonaws.com"
source_arn = aws_cognito_user_pool.homeuniteus.arn
}

resource "aws_iam_role_policy" "cognito_sns" {
name = "homeuniteus-cognito-idp"
role = aws_iam_role.cognito_idp.id
Expand Down

0 comments on commit 3dea2a2

Please sign in to comment.