File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
infrastructure/terraform/components/api Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -31,3 +31,24 @@ resource "aws_iam_policy" "lambda_logging_policy" {
3131 ]
3232 })
3333}
34+
35+ resource "aws_iam_role" "lambda_role" {
36+ name = " lambda_role"
37+ assume_role_policy = << EOF
38+ {
39+ "Version": "2012-10-17",
40+ "Statement": [{
41+ "Effect": "Allow",
42+ "Principal": {
43+ "Service": "lambda.amazonaws.com"
44+ },
45+ "Action": "sts:AssumeRole"
46+ }]
47+ }
48+ EOF
49+ }
50+
51+ resource "aws_iam_role_policy_attachment" "authorizer_lambda_logging_policy_attachment" {
52+ role = aws_iam_role. lambda_role . id
53+ policy_arn = aws_iam_policy. lambda_logging_policy
54+ }
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ module "authorizer_lambda" {
1313
1414 function_name = " authorizer"
1515 description = " Authorizer for Suppliers API"
16+ role = aws_iam_role. lambda_role . arn
1617
1718 memory = 512
1819 timeout = 20
@@ -53,8 +54,3 @@ data "aws_iam_policy_document" "authorizer_lambda_iam" {
5354 ]
5455 }
5556}
56-
57- resource "aws_iam_role_policy_attachment" "authorizer_lambda_logging_policy_attachment" {
58- role = aws_iam_role. authorizer_lambda_iam . id
59- policy_arn = aws_iam_policy. lambda_logging_policy
60- }
You can’t perform that action at this time.
0 commit comments