-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathtemplate.yaml
52 lines (47 loc) · 1.36 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
47
48
49
50
51
52
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Parameters:
ResourceSuffix:
Description: A suffix to add to resources to enable multiple developers to deploy to the same account
Default: ""
Type: String
Globals:
Function:
MemorySize: 1024
Architectures:
- x86_64
Runtime: dotnet8
Timeout: 30
Tracing: Active
Environment:
Variables:
ENV: 'dev'
Resources:
CreateCustomerFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName:
!Sub "CreateCustomerFunction-${AWS::StackName}-${AWS::AccountId}${ResourceSuffix}"
CodeUri: ./src/CreateCustomerFunction/
Handler: CreateCustomerFunction::CreateCustomerFunction.Function_FunctionHandler_Generated::FunctionHandler
Environment:
Variables:
EVENT_BUS_NAME: !Ref CentralEventBus
Events:
Api:
Type: Api
Properties:
Path: /customer
Method: POST
Policies:
- EventBridgePutEventsPolicy:
EventBusName: !Ref CentralEventBus
CentralEventBus:
Type: AWS::Events::EventBus
Properties:
Name: central-event-bus
CentralEventBusScehamRegistry:
Type: AWS::EventSchemas::Discoverer
Properties:
SourceArn: !GetAtt CentralEventBus.Arn
Description: 'Discover schemas from custom event bus'