-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda-execution-role.yaml
More file actions
53 lines (50 loc) · 2.02 KB
/
Copy pathlambda-execution-role.yaml
File metadata and controls
53 lines (50 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Lambda Execution Role
# Shared IAM role for all Lambda functions created by the RGD
# Provides permissions for DynamoDB, CloudWatch Logs, and X-Ray
#
# IMPORTANT: Replace placeholders before applying:
# - ${AWS_ACCOUNT_ID}: Your AWS account ID
# - ${AWS_REGION}: Your AWS region
#
apiVersion: iam.services.k8s.aws/v1alpha1
kind: Role
metadata:
name: hkc-lambda-execution-role
namespace: kro-serverless-stack
labels:
app.kubernetes.io/name: hkc-sample
app.kubernetes.io/component: iam
app.kubernetes.io/part-of: shared-platform
spec:
name: hkc-lambda-execution-role
description: "Shared Lambda execution role for Hybrid Kro Compositions"
# Trust policy - allows Lambda service to assume this role
assumeRolePolicyDocument: |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
# Inline policies (map format: policyName -> policyDocument)
inlinePolicies:
DynamoDBAccess: |
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["dynamodb:GetItem","dynamodb:PutItem","dynamodb:UpdateItem","dynamodb:DeleteItem","dynamodb:Query","dynamodb:Scan","dynamodb:BatchGetItem","dynamodb:BatchWriteItem"],"Resource":["arn:aws:dynamodb:${AWS_REGION}:${AWS_ACCOUNT_ID}:table/*-inventory","arn:aws:dynamodb:${AWS_REGION}:${AWS_ACCOUNT_ID}:table/*-inventory/index/*"]}]}
CloudWatchLogs: |
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents"],"Resource":"arn:aws:logs:${AWS_REGION}:${AWS_ACCOUNT_ID}:log-group:/aws/lambda/*:*"}]}
XRayTracing: |
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["xray:PutTraceSegments","xray:PutTelemetryRecords"],"Resource":"*"}]}
# Tags
tags:
- key: Application
value: hkc-sample
- key: Component
value: lambda-execution
- key: ManagedBy
value: ACK