forked from aws-samples/aws-lambda-layer-kubectl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsam.yaml
48 lines (44 loc) · 1.22 KB
/
sam.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
ClusterName:
Type: String
Default: default
FunctionName:
Type: String
Default: defaultFunc
Transform: AWS::Serverless-2016-10-31
Description: Example API
Resources:
Func:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Ref FunctionName
Handler: main
CodeUri: ./func.d
Runtime: provided
Layers:
- !Sub "arn:aws:lambda:ap-northeast-1:${AWS::AccountId}:layer:layer-eks-kubectl-layer-stack:2"
MemorySize: 512
Environment:
Variables:
cluster_name: !Ref ClusterName
# Policies:
# - AWSLambdaBasicExecutionRole
Role: !Sub "arn:aws:iam::${AWS::AccountId}:role/LambdaEKSAdminRole"
Timeout: 10
Outputs:
LambdaFuncArn:
Description: Lambda Func ARN
Value: !GetAtt Func.Arn
Export:
Name: !Sub 'LambdaFuncArn-${AWS::StackName}'
LambdaFuncName:
Description: Lambda Func Name
Value: !Ref Func
Export:
Name: !Sub 'LambdaFuncName-${AWS::StackName}'
LambdaRoleArn:
Description: Lambda Role ARN
Value: !Sub "arn:aws:iam::${AWS::AccountId}:role/LambdaEKSAdminRole"
Export:
Name: !Sub 'LambdaRoleArn-${AWS::StackName}'