-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
46 lines (45 loc) · 1.43 KB
/
template.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
Parameters:
PPubPubSubCodeKey:
Type: String
PGoogleCloudProjectNumber:
Type: String
PGoogleCloudWebIdentityPool:
Type: String
PGoogleCloudWebIdentityPoolAWSProvider:
Type: String
PGoogleCloudServiceAccountEmail:
Type: String
PGoogleCloudDefaultProjectId:
Type: String
Default: ""
Resources:
RoleLambdaPubPubSub:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: sts:AssumeRole
Principal:
Service: lambda.amazonaws.com
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
LambdaPubPubSub:
Type: AWS::Lambda::Function
Properties:
Runtime: nodejs14.x
Role: !Sub ${RoleLambdaPubPubSub.Arn}
Timeout: 60
MemorySize: 192
Handler: index.handler
Code:
S3Bucket: !Sub github-com-hf-pubpubsub-${AWS::Region}
S3Key: !Sub ${PPubPubSubCodeKey}
Environment:
Variables:
GOOGLE_CLOUD_PROJECT_NUMBER: !Ref PGoogleCloudProjectNumber
GOOGLE_CLOUD_WEB_IDENTITY_POOL: !Ref PGoogleCloudWebIdentityPool
GOOGLE_CLOUD_WEB_IDENTITY_POOL_AWS_PROVIDER: !Ref PGoogleCloudWebIdentityPoolAWSProvider
GOOGLE_CLOUD_SERVICE_ACCOUNT_EMAIL: !Ref PGoogleCloudServiceAccountEmail
GOOGLE_CLOUD_DEFAULT_PROJECT_ID: !Ref PGoogleCloudDefaultProjectId