Skip to content

Commit 1e138ab

Browse files
committed
The above two examples when used together will the use the value of LambdaRoleParameter as the role during deployment.
Example shows using CloudFormation template Parameter named `LambdaRoleParameter` for the role of the Lambda function. ## Using References To Other Resources and Parameters in the template Document Undocmented Feature
1 parent 1f8c19e commit 1e138ab

File tree

1 file changed

+29
-0
lines changed
  • Libraries/src/Amazon.Lambda.Annotations

1 file changed

+29
-0
lines changed

Libraries/src/Amazon.Lambda.Annotations/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,35 @@ public class Functions
5353
}
5454
```
5555

56+
## Using References To Other Resources and Parameters in the template
57+
58+
To use a reference to a Resource or Parameter in the template, prefix the value with `@`. Example shows using CloudFormation template Parameter named `LambdaRoleParameter` for the role of the Lambda function.
59+
```csharp
60+
public class Functions
61+
{
62+
[LambdaFunction( Role="@LambdaRoleParameter")]
63+
[RestApi("/plus/{x}/{y}")]
64+
public int Plus(int x, int y)
65+
{
66+
return x + y;
67+
}
68+
}
69+
```
70+
71+
and place in your template:
72+
73+
```
74+
75+
"Parameters": {
76+
"LambdaExecutionRole": {
77+
"Type": "String"
78+
}
79+
},
80+
81+
```
82+
83+
The above two examples when used together will the use the value of LambdaRoleParameter as the role during deployment.
84+
5685
## Source Generator
5786

5887
To bridge the gap from Lambda Annotations programming model to the normal programming model a .NET source generator is included in this package.

0 commit comments

Comments
 (0)