@@ -6,11 +6,10 @@ import {
6
6
Stack ,
7
7
StackProps ,
8
8
} from 'aws-cdk-lib'
9
- import { Construct } from 'constructs'
10
9
import {
11
- StepFunctionsIntegration ,
12
- RestApi ,
13
10
Period ,
11
+ RestApi ,
12
+ StepFunctionsIntegration ,
14
13
UsagePlan ,
15
14
} from 'aws-cdk-lib/aws-apigateway'
16
15
import {
@@ -32,9 +31,9 @@ import {
32
31
TaskInput ,
33
32
} from 'aws-cdk-lib/aws-stepfunctions'
34
33
import { HttpInvoke , LambdaInvoke } from 'aws-cdk-lib/aws-stepfunctions-tasks'
35
-
36
- import { join } from 'path'
37
34
import { execSync } from 'child_process'
35
+ import { Construct } from 'constructs'
36
+ import { join } from 'path'
38
37
39
38
export class SmallTalkStack extends Stack {
40
39
constructor ( scope : Construct , id : string , props ?: StackProps ) {
@@ -52,7 +51,7 @@ export class SmallTalkStack extends Stack {
52
51
logGroupName : hackerNewsFunctionName ,
53
52
retention : RetentionDays . ONE_WEEK ,
54
53
removalPolicy : RemovalPolicy . DESTROY ,
55
- }
54
+ } ,
56
55
)
57
56
const hackerNewsFunction = new Function ( this , hackerNewsFunctionName , {
58
57
description :
@@ -83,8 +82,8 @@ export class SmallTalkStack extends Stack {
83
82
execSync (
84
83
`pip install -r ${ join (
85
84
hackerNewsFunctionDir ,
86
- 'requirements.txt'
87
- ) } -t ${ join ( outputDir ) } `
85
+ 'requirements.txt' ,
86
+ ) } -t ${ join ( outputDir ) } `,
88
87
)
89
88
execSync ( `cp -r ${ hackerNewsFunctionDir } /* ${ join ( outputDir ) } ` )
90
89
return true
@@ -116,11 +115,11 @@ export class SmallTalkStack extends Stack {
116
115
connectionName : `${ stack } ` ,
117
116
authorization : Authorization . apiKey (
118
117
'smalltalk-authorization' ,
119
- SecretValue . secretsManager ( 'smalltalk-weather' )
118
+ SecretValue . secretsManager ( 'smalltalk-weather' ) ,
120
119
) ,
121
120
queryStringParameters : {
122
121
appid : HttpParameter . fromSecret (
123
- SecretValue . secretsManager ( 'smalltalk-weather' )
122
+ SecretValue . secretsManager ( 'smalltalk-weather' ) ,
124
123
) ,
125
124
} ,
126
125
} )
@@ -190,7 +189,7 @@ export class SmallTalkStack extends Stack {
190
189
parallel . branch ( getTechNewsBranch )
191
190
192
191
const definition = Chain . start ( parallel ) . next (
193
- new Pass ( this , 'Combine Results' )
192
+ new Pass ( this , 'Combine Results' ) ,
194
193
)
195
194
196
195
// Step Function
@@ -202,7 +201,7 @@ export class SmallTalkStack extends Stack {
202
201
logGroupName : stateMachineName ,
203
202
retention : RetentionDays . ONE_WEEK ,
204
203
removalPolicy : RemovalPolicy . DESTROY ,
205
- }
204
+ } ,
206
205
)
207
206
const stateMachine = new StateMachine ( this , stateMachineName , {
208
207
stateMachineName,
@@ -228,7 +227,7 @@ export class SmallTalkStack extends Stack {
228
227
const endpoint = api . root . addResource ( 'small-talk' )
229
228
endpoint . addMethod (
230
229
'POST' ,
231
- StepFunctionsIntegration . startExecution ( stateMachine )
230
+ StepFunctionsIntegration . startExecution ( stateMachine ) ,
232
231
)
233
232
234
233
const defaultUsagePlan = new UsagePlan ( this , 'DefaultUsagePlan' , {
0 commit comments