Commit 35cd334
authored
Add resource-based permissions support for Lambda aliases (#161)
this commit adds support for managing Lambda resource based permissions directly
on aliases. Now users can declaratively define, update, and remove permissions
for Lambda functions accessed through aliases.
The implementation leverages the AWS::Lambda `AddPermission` and `RemovePermission`
APIs to synchronize the desired permissions state defined in the CRD with the
actual alias permisions in AWS.
Example alias:
```yaml
apiVersion: lambda.services.k8s.aws/v1alpha1
kind: Alias
metadata:
name: alias1
spec:
name: alias1
functionName: test-function-w-ack
functionVersion: $LATEST
description: some alias
permissions:
- statementID: "1"
action: lambda:InvokeFunction
principal: s3.amazonaws.com
sourceARN: arn:aws:s3:::mybucket
- statementID: "2"
action: lambda:InvokeFunction
principal: s3.amazonaws.com
sourceARN: arn:aws:s3:::mybucket2
- statementID: "3"
action: lambda:InvokeFunction
principal: s3.amazonaws.com
sourceARN: arn:aws:s3:::mybucket3
- statementID: "4"
action: lambda:InvokeFunction
principal: s3.amazonaws.com
sourceARN: arn:aws:s3:::mybucket4
```
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.1 parent 731aff1 commit 35cd334
File tree
18 files changed
+684
-32
lines changed- apis/v1alpha1
- config/crd/bases
- helm/crds
- pkg/resource/alias
- templates/hooks/alias
- test/e2e/tests
18 files changed
+684
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
164 | 171 | | |
| 172 | + | |
| 173 | + | |
165 | 174 | | |
166 | 175 | | |
167 | 176 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
135 | 160 | | |
136 | 161 | | |
137 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
164 | 171 | | |
| 172 | + | |
| 173 | + | |
165 | 174 | | |
166 | 175 | | |
167 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
0 commit comments