-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
62 lines (55 loc) · 1.6 KB
/
Copy pathtemplate.yaml
File metadata and controls
62 lines (55 loc) · 1.6 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
54
55
56
57
58
59
60
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
paciente-app
Sample SAM Template for paciente-app
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 20
Runtime: java11
MemorySize: 512
Resources:
CreateProductSNS:
Type: AWS::SNS::Topic
Properties:
TopicName: CreateProductTopic
ProductPostFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ProductFunction
Handler: br.com.adissongomes.product.ProductPostFunction::handleRequest
Events:
Api:
Type: Api
Properties:
Path: /
Method: post
Policies:
Statement:
Effect: Allow
Action:
- sns:Publish
Resource:
!Sub
- arn:${AWS::Partition}:sns:${AWS::Region}:${AWS::AccountId}:${topicName}
- topicName: !GetAtt CreateProductSNS.TopicName
ProductPersistFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ProductFunction
Handler: br.com.adissongomes.product.ProductPersistFunction::handleRequest
Events:
SNSEvent:
Type: SNS
Properties:
Topic: !Ref CreateProductSNS
Policies:
Statement:
Effect: Allow
Action:
- sns:Publish
Resource:
Fn::Sub:
- arn:${AWS::Partition}:sns:${AWS::Region}:${AWS::AccountId}:${topicName}
- topicName: !GetAtt CreateProductSNS.TopicName