Skip to content

Commit 10ef42b

Browse files
Modified 1 resource:
Deleted function resource logErrors
1 parent b52e38d commit 10ef42b

File tree

4 files changed

+54
-91
lines changed

4 files changed

+54
-91
lines changed

src/logErrors/README.md

-13
This file was deleted.

src/logErrors/index.js

-5
This file was deleted.

src/logErrors/package.json

-6
This file was deleted.

template.yaml

+54-67
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,61 @@ AWSTemplateFormatVersion: 2010-09-09
22
Transform: AWS::Serverless-2016-10-31
33
Description: Stackery Serverless API Example Stack
44
Resources:
5-
function61D00F31:
5+
TriggerDeployFrontEndOnDeploy:
6+
Type: Custom::TriggerDeployFrontEndOnDeploy
7+
Properties:
8+
ServiceToken: !GetAtt deployFrontEnd.Arn
9+
Trigger: !Ref StackeryDeploymentTimestamp
10+
deployFrontEnd:
611
Type: AWS::Serverless::Function
712
Properties:
8-
FunctionName: !Sub ${AWS::StackName}-function61D00F31
13+
FunctionName: !Sub ${AWS::StackName}-deployFrontEnd
914
Description: !Sub
1015
- Stackery Stack ${StackeryStackTagName} Environment ${StackeryEnvironmentTagName} Function ${ResourceName}
11-
- ResourceName: getWelcomePage
12-
CodeUri: src/getWelcomePage
16+
- ResourceName: deployFrontEnd
17+
CodeUri: src/deployFrontEnd
1318
Handler: index.handler
1419
Runtime: nodejs8.10
1520
MemorySize: 3008
16-
Timeout: 30
21+
Timeout: 300
1722
Tracing: Active
1823
Policies:
1924
- AWSXrayWriteOnlyAccess
20-
Events:
21-
apiFE76C470:
22-
Type: Api
23-
Properties:
24-
Path: /
25-
Method: GET
26-
RestApiId: !Ref apiFE76C470
25+
- S3CrudPolicy:
26+
BucketName: !Ref websiteHosting
27+
- Statement:
28+
- Effect: Allow
29+
Action:
30+
- s3:PutObjectAcl
31+
Resource:
32+
- !Sub ${websiteHosting.Arn}/*
33+
Environment:
34+
Variables:
35+
XDG_CONFIG_HOME: /tmp/.config
36+
BUCKET_NAME: !Ref websiteHosting
37+
BUCKET_ARN: !GetAtt websiteHosting.Arn
2738
Metadata:
28-
StackeryName: getWelcomePage
29-
apiFE76C470:
39+
StackeryName: deployFrontEnd
40+
deployFrontEndDeployTrigger:
41+
Type: Custom::FunctionDeployTrigger
42+
Properties:
43+
ServiceToken: !GetAtt deployFrontEnd.Arn
44+
websiteHosting:
45+
Type: AWS::S3::Bucket
46+
Properties:
47+
BucketName: !Sub ${AWS::StackName}-websitehosting
48+
AccessControl: PublicRead
49+
WebsiteConfiguration:
50+
IndexDocument: index.html
51+
ErrorDocument: index.html
52+
Metadata:
53+
StackeryName: S3 Website Hosting
54+
api:
3055
Type: AWS::Serverless::Api
3156
Properties:
3257
Name: !Sub
3358
- ${ResourceName} From Stackery Stack ${StackeryStackTagName} Environment ${StackeryEnvironmentTagName}
34-
- ResourceName: apiFE76C470
59+
- ResourceName: api
3560
StageName: !Ref StackeryEnvironmentAPIGatewayStageName
3661
DefinitionBody:
3762
swagger: '2.0'
@@ -42,71 +67,33 @@ Resources:
4267
x-amazon-apigateway-integration:
4368
httpMethod: POST
4469
type: aws_proxy
45-
uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${function61D00F31.Arn}/invocations
70+
uri: !Sub arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${getWelcomePage.Arn}/invocations
4671
responses: {}
4772
EndpointConfiguration: REGIONAL
48-
function8E6C5467:
73+
getWelcomePage:
4974
Type: AWS::Serverless::Function
5075
Properties:
51-
FunctionName: !Sub ${AWS::StackName}-function8E6C5467
76+
FunctionName: !Sub ${AWS::StackName}-getWelcomePage
5277
Description: !Sub
5378
- Stackery Stack ${StackeryStackTagName} Environment ${StackeryEnvironmentTagName} Function ${ResourceName}
54-
- ResourceName: logErrors
55-
CodeUri: src/logErrors
79+
- ResourceName: getWelcomePage
80+
CodeUri: src/getWelcomePage
5681
Handler: index.handler
5782
Runtime: nodejs8.10
5883
MemorySize: 3008
5984
Timeout: 30
6085
Tracing: Active
6186
Policies:
6287
- AWSXrayWriteOnlyAccess
88+
Events:
89+
apiFE76C470:
90+
Type: Api
91+
Properties:
92+
Path: /
93+
Method: GET
94+
RestApiId: !Ref api
6395
Metadata:
64-
StackeryName: logErrors
65-
function9D4ED975:
66-
Type: AWS::Serverless::Function
67-
Properties:
68-
FunctionName: !Sub ${AWS::StackName}-function9D4ED975
69-
Description: !Sub
70-
- Stackery Stack ${StackeryStackTagName} Environment ${StackeryEnvironmentTagName} Function ${ResourceName}
71-
- ResourceName: deployFrontEnd
72-
CodeUri: src/deployFrontEnd
73-
Handler: index.handler
74-
Runtime: nodejs8.10
75-
MemorySize: 3008
76-
Timeout: 300
77-
Tracing: Active
78-
Policies:
79-
- AWSXrayWriteOnlyAccess
80-
- S3CrudPolicy:
81-
BucketName: !Ref objectStore24B2BE91
82-
- Statement:
83-
- Effect: Allow
84-
Action:
85-
- s3:PutObjectAcl
86-
Resource:
87-
- !Sub ${objectStore24B2BE91.Arn}/*
88-
Environment:
89-
Variables:
90-
XDG_CONFIG_HOME: /tmp/.config
91-
BUCKET_NAME: !Ref objectStore24B2BE91
92-
BUCKET_ARN: !GetAtt objectStore24B2BE91.Arn
93-
Metadata:
94-
StackeryName: deployFrontEnd
95-
objectStore24B2BE91:
96-
Type: AWS::S3::Bucket
97-
Properties:
98-
BucketName: !Sub ${AWS::StackName}-objectstore24b2be91
99-
AccessControl: PublicRead
100-
WebsiteConfiguration:
101-
IndexDocument: index.html
102-
ErrorDocument: index.html
103-
Metadata:
104-
StackeryName: S3 Website Hosting
105-
TriggerDeployFrontEndOnDeploy:
106-
Type: Custom::TriggerDeployFrontEndOnDeploy
107-
Properties:
108-
ServiceToken: !GetAtt function9D4ED975.Arn
109-
Trigger: !Ref StackeryDeploymentTimestamp
96+
StackeryName: getWelcomePage
11097
Parameters:
11198
StackeryStackTagName:
11299
Type: String
@@ -119,7 +106,7 @@ Parameters:
119106
Description: Environment name used for API Gateway Stage names (injected by Stackery at deployment time)
120107
StackeryDeploymentTimestamp:
121108
Type: Number
122-
Description: Timestamp (injected by Stackery at deployment time)
109+
Description: Deployment preparation timestamp in milliseconds Since Epoch (injected by Stackery at deployment time)
123110
Metadata:
124111
StackeryErrorsTargets:
125112
function8E6C5467: {}

0 commit comments

Comments
 (0)