11import * as fs from 'fs'
2- import * as mime from 'mime'
32import * as path from 'path'
3+ import mime from 'mime'
44
55import * as aws from '@pulumi/aws'
66import * as pulumi from '@pulumi/pulumi'
77import { local } from '@pulumi/command'
88
9- import { NameRegister } from '../utils'
9+ import { NameRegister } from '../utils.js '
1010
1111const nameRegister = NameRegister . getInstance ( )
1212let registerName = ( name : string ) : string => {
@@ -25,12 +25,12 @@ export function getLambdaRole(functionArns?: string[]): aws.iam.Role {
2525 {
2626 type : string
2727 identifiers : string [ ]
28- }
28+ } ,
2929 ]
3030 actions : string [ ]
3131 effect : string
3232 resources ?: string [ ]
33- }
33+ } ,
3434 ]
3535 }
3636
@@ -59,7 +59,7 @@ export function getLambdaRole(functionArns?: string[]): aws.iam.Role {
5959 {
6060 role : iamForLambda . name ,
6161 policyArn : aws . iam . ManagedPolicy . AWSLambdaBasicExecutionRole ,
62- }
62+ } ,
6363 )
6464
6565 if ( functionArns ) {
@@ -90,7 +90,7 @@ export function getLambdaRole(functionArns?: string[]): aws.iam.Role {
9090
9191export function buildRouter (
9292 iamForLambda : aws . iam . Role ,
93- routerPath : string
93+ routerPath : string ,
9494) : aws . lambda . Function {
9595 const routerHandler = new aws . lambda . Function (
9696 registerName ( 'LambdaRouterFunctionHandler' ) ,
@@ -102,15 +102,15 @@ export function buildRouter(
102102 memorySize : 128 ,
103103 publish : true ,
104104 } ,
105- { provider : eastRegion }
105+ { provider : eastRegion } ,
106106 )
107107
108108 return routerHandler
109109}
110110
111111export function validateCertificate (
112112 FQDN : string ,
113- domainName : string
113+ domainName : string ,
114114) : pulumi . Output < string > {
115115 if ( ! FQDN . includes ( domainName ) ) {
116116 throw new Error ( 'FQDN must contain domainName' )
@@ -122,7 +122,7 @@ export function validateCertificate(
122122 domainName : FQDN ,
123123 validationMethod : 'DNS' ,
124124 } ,
125- { provider : eastRegion }
125+ { provider : eastRegion } ,
126126 )
127127
128128 const hostedZone = aws . route53 . getZone ( {
@@ -138,7 +138,7 @@ export function validateCertificate(
138138 ttl : 60 ,
139139 type : certificate . domainValidationOptions [ 0 ] . resourceRecordType ,
140140 zoneId : hostedZone . then ( ( x ) => x . zoneId ) ,
141- }
141+ } ,
142142 )
143143
144144 const certificateValidation = new aws . acm . CertificateValidation (
@@ -147,15 +147,15 @@ export function validateCertificate(
147147 certificateArn : certificate . arn ,
148148 validationRecordFqdns : [ validationRecord . fqdn ] ,
149149 } ,
150- { provider : eastRegion }
150+ { provider : eastRegion } ,
151151 )
152152
153153 return certificateValidation . certificateArn
154154}
155155
156156export function buildStatic (
157157 staticPath : string ,
158- prerenderedPath : string
158+ prerenderedPath : string ,
159159) : aws . s3 . Bucket {
160160 const bucket = new aws . s3 . Bucket ( registerName ( 'StaticContentBucket' ) , {
161161 acl : 'private' ,
@@ -200,7 +200,7 @@ export function uploadStatic(dirPath: string, bucket: aws.s3.Bucket) {
200200 } ,
201201 {
202202 parent : bucket ,
203- }
203+ } ,
204204 )
205205 } )
206206}
@@ -210,7 +210,7 @@ export function buildCDN(
210210 bucket : aws . s3 . Bucket ,
211211 serverHeaders : string [ ] ,
212212 FQDN ?: string ,
213- certificateArn ?: pulumi . Input < string >
213+ certificateArn ?: pulumi . Input < string > ,
214214) : aws . cloudfront . Distribution {
215215 const defaultRequestPolicy = new aws . cloudfront . OriginRequestPolicy (
216216 registerName ( 'DefaultRequestPolicy' ) ,
@@ -227,7 +227,7 @@ export function buildCDN(
227227 queryStringsConfig : {
228228 queryStringBehavior : 'all' ,
229229 } ,
230- }
230+ } ,
231231 )
232232
233233 const oac = new aws . cloudfront . OriginAccessControl (
@@ -238,7 +238,7 @@ export function buildCDN(
238238 originAccessControlOriginType : 's3' ,
239239 signingBehavior : 'no-override' ,
240240 signingProtocol : 'sigv4' ,
241- }
241+ } ,
242242 )
243243
244244 const optimizedCachePolicy = aws . cloudfront . getCachePolicyOutput ( {
@@ -300,7 +300,7 @@ export function buildCDN(
300300 restrictionType : 'none' ,
301301 } ,
302302 } ,
303- }
303+ } ,
304304 )
305305
306306 const cloudFrontPolicyDocument = aws . iam . getPolicyDocumentOutput ( {
@@ -348,7 +348,7 @@ export function buildCDN(
348348 {
349349 bucket : bucket . id ,
350350 policy : cloudFrontPolicyDocument . apply ( ( policy ) => policy . json ) ,
351- }
351+ } ,
352352 )
353353
354354 return distribution
@@ -358,7 +358,7 @@ export function buildCDN(
358358// distribution.
359359export function createAliasRecord (
360360 targetDomain : string ,
361- distribution : aws . cloudfront . Distribution
361+ distribution : aws . cloudfront . Distribution ,
362362) : aws . route53 . Record {
363363 const domainParts = exports . getDomainAndSubdomain ( targetDomain )
364364 const hostedZoneId = aws . route53
@@ -404,7 +404,7 @@ export function getDomainAndSubdomain(domain: string): {
404404export function buildInvalidator (
405405 distribution : aws . cloudfront . Distribution ,
406406 staticPath : string ,
407- prerenderedPath : string
407+ prerenderedPath : string ,
408408) {
409409 interface PathHashResourceInputs {
410410 path : pulumi . Input < string >
@@ -427,7 +427,7 @@ export function buildInvalidator(
427427 async diff (
428428 id : string ,
429429 previousOutput : PathHashOutputs ,
430- news : PathHashInputs
430+ news : PathHashInputs ,
431431 ) : Promise < pulumi . dynamic . DiffResult > {
432432 const replaces : string [ ] = [ ]
433433 let changes = true
@@ -458,7 +458,7 @@ export function buildInvalidator(
458458 constructor (
459459 name : string ,
460460 args : PathHashResourceInputs ,
461- opts ?: pulumi . CustomResourceOptions
461+ opts ?: pulumi . CustomResourceOptions ,
462462 ) {
463463 super ( pathHashProvider , name , { hash : undefined , ...args } , opts )
464464 }
@@ -480,6 +480,6 @@ export function buildInvalidator(
480480 } ,
481481 {
482482 dependsOn : [ distribution ] ,
483- }
483+ } ,
484484 )
485485}
0 commit comments