forked from thestackshack/serverless-contact-us-form
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathstack-output.yml
72 lines (72 loc) · 1.71 KB
/
stack-output.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
AWSTemplateFormatVersion: '2010-09-09'
Description: Serverless Contact Us form for static website
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: Configuration
Parameters:
- Subject
- ToEmailAddress
- ReCaptchaSecret
Outputs:
ApiUrl:
Description: URL of your API endpoint
Value:
Fn::Join:
- ''
- - https://
- Ref: ServerlessRestApi
- .execute-api.
- Ref: AWS::Region
- .amazonaws.com/Prod
Parameters:
ReCaptchaSecret:
Description: Your Google reCAPTCHA secret
Type: String
Subject:
Description: Contact us email subject
Type: String
ToEmailAddress:
Description: Email address you want contact form submittions to go to
Type: String
Resources:
ContactUsFunction:
Properties:
CodeUri: s3://serverless-contact-us-form/bbcd09794e2458768e2fc74983bbf511
Environment:
Variables:
ContactUsSNSTopic:
Ref: ContactUsSNSTopic
ReCaptchaSecret:
Ref: ReCaptchaSecret
Subject:
Ref: Subject
Events:
PostEvent:
Properties:
Method: post
Path: /
Type: Api
Handler: index.handler
Runtime: nodejs6.10
Timeout: 5
Type: AWS::Serverless::Function
ContactUsSNSTopic:
Properties:
DisplayName:
Fn::Join:
- ''
- - Ref: AWS::StackName
- ' Topic'
Subscription:
- Endpoint:
Ref: ToEmailAddress
Protocol: email
TopicName:
Fn::Join:
- ''
- - Ref: AWS::StackName
- -topic
Type: AWS::SNS::Topic
Transform: AWS::Serverless-2016-10-31