@@ -7,7 +7,7 @@ open Pulumi.Aws.Lambda
7
7
8
8
module ManagedPolicies =
9
9
let AWSLambdaBasicExecutionRole = " arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
10
- let AWSLambdaFullAccess = " arn:aws:iam::aws:policy/AWSLambdaFullAccess "
10
+ let AWSLambdaExecute = " arn:aws:iam::aws:policy/AWSLambdaExecute "
11
11
12
12
let openApiSpec ( name , arn ) =
13
13
let quotedTitle = " \" " + name + " api\" "
@@ -57,7 +57,6 @@ let addInvokePermission name accountId functionArn executionArn =
57
57
Action = input " lambda:InvokeFunction" ,
58
58
Function = functionArn,
59
59
Principal = input " apigateway.amazonaws.com" ,
60
- SourceAccount = accountId,
61
60
SourceArn = executionArn,
62
61
StatementIdPrefix = input " lambdaPermission"
63
62
)
@@ -88,14 +87,14 @@ let infra () =
88
87
)
89
88
)
90
89
91
- RolePolicyAttachment( " lambdaS3ReadOnlyAccess" , RolePolicyAttachmentArgs( Role = io lambdaRole.Id, PolicyArn = input ManagedPolicies.AWSLambdaFullAccess )) |> ignore
90
+ RolePolicyAttachment( " lambdaS3ReadOnlyAccess" , RolePolicyAttachmentArgs( Role = io lambdaRole.Id, PolicyArn = input ManagedPolicies.AWSLambdaExecute )) |> ignore
92
91
RolePolicyAttachment( " lambdaBasicExecution" , RolePolicyAttachmentArgs( Role = io lambdaRole.Id, PolicyArn = input ManagedPolicies.AWSLambdaBasicExecutionRole)) |> ignore
93
92
94
93
let lambda =
95
94
Function(
96
95
" basicLambda" ,
97
96
FunctionArgs(
98
- Runtime = input " dotnetcore3.1 " ,
97
+ Runtime = inputUnion2Of2 Pulumi.Aws.Lambda.Runtime.DotnetCore3d1 ,
99
98
Code = input ( FileArchive " ../LambdaWebServer/bin/Debug/netcoreapp3.1/publish" :> Archive),
100
99
Handler = input " LambdaWebServer::Setup+LambdaEntryPoint::FunctionHandlerAsync" ,
101
100
Role = io lambdaRole.Arn,
@@ -143,4 +142,3 @@ let infra () =
143
142
[<EntryPoint>]
144
143
let main _argv =
145
144
Deployment.run infra
146
-
0 commit comments