@@ -2,36 +2,61 @@ AWSTemplateFormatVersion: 2010-09-09
2
2
Transform : AWS::Serverless-2016-10-31
3
3
Description : Stackery Serverless API Example Stack
4
4
Resources :
5
- function61D00F31 :
5
+ TriggerDeployFrontEndOnDeploy :
6
+ Type : Custom::TriggerDeployFrontEndOnDeploy
7
+ Properties :
8
+ ServiceToken : !GetAtt deployFrontEnd.Arn
9
+ Trigger : !Ref StackeryDeploymentTimestamp
10
+ deployFrontEnd :
6
11
Type : AWS::Serverless::Function
7
12
Properties :
8
- FunctionName : !Sub ${AWS::StackName}-function61D00F31
13
+ FunctionName : !Sub ${AWS::StackName}-deployFrontEnd
9
14
Description : !Sub
10
15
- Stackery Stack ${StackeryStackTagName} Environment ${StackeryEnvironmentTagName} Function ${ResourceName}
11
- - ResourceName : getWelcomePage
12
- CodeUri : src/getWelcomePage
16
+ - ResourceName : deployFrontEnd
17
+ CodeUri : src/deployFrontEnd
13
18
Handler : index.handler
14
19
Runtime : nodejs8.10
15
20
MemorySize : 3008
16
- Timeout : 30
21
+ Timeout : 300
17
22
Tracing : Active
18
23
Policies :
19
24
- 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
27
38
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 :
30
55
Type : AWS::Serverless::Api
31
56
Properties :
32
57
Name : !Sub
33
58
- ${ResourceName} From Stackery Stack ${StackeryStackTagName} Environment ${StackeryEnvironmentTagName}
34
- - ResourceName : apiFE76C470
59
+ - ResourceName : api
35
60
StageName : !Ref StackeryEnvironmentAPIGatewayStageName
36
61
DefinitionBody :
37
62
swagger : ' 2.0'
@@ -42,71 +67,33 @@ Resources:
42
67
x-amazon-apigateway-integration :
43
68
httpMethod : POST
44
69
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
46
71
responses : {}
47
72
EndpointConfiguration : REGIONAL
48
- function8E6C5467 :
73
+ getWelcomePage :
49
74
Type : AWS::Serverless::Function
50
75
Properties :
51
- FunctionName : !Sub ${AWS::StackName}-function8E6C5467
76
+ FunctionName : !Sub ${AWS::StackName}-getWelcomePage
52
77
Description : !Sub
53
78
- Stackery Stack ${StackeryStackTagName} Environment ${StackeryEnvironmentTagName} Function ${ResourceName}
54
- - ResourceName : logErrors
55
- CodeUri : src/logErrors
79
+ - ResourceName : getWelcomePage
80
+ CodeUri : src/getWelcomePage
56
81
Handler : index.handler
57
82
Runtime : nodejs8.10
58
83
MemorySize : 3008
59
84
Timeout : 30
60
85
Tracing : Active
61
86
Policies :
62
87
- AWSXrayWriteOnlyAccess
88
+ Events :
89
+ apiFE76C470 :
90
+ Type : Api
91
+ Properties :
92
+ Path : /
93
+ Method : GET
94
+ RestApiId : !Ref api
63
95
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
110
97
Parameters :
111
98
StackeryStackTagName :
112
99
Type : String
@@ -119,7 +106,7 @@ Parameters:
119
106
Description : Environment name used for API Gateway Stage names (injected by Stackery at deployment time)
120
107
StackeryDeploymentTimestamp :
121
108
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)
123
110
Metadata :
124
111
StackeryErrorsTargets :
125
112
function8E6C5467 : {}
0 commit comments