File tree 4 files changed +14
-1
lines changed
4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ custom:
44
44
apiCloudFront:
45
45
domain: my-custom-domain.com
46
46
certificate: arn:aws:acm:us-east-1:000000000000:certificate/00000000-1111-2222-3333-444444444444
47
+ waf: 00000000-0000-0000-0000-000000000000
47
48
logging:
48
49
bucket: my-bucket.s3.amazonaws.com
49
50
prefix: my-prefix
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ class ServerlessApiCloudFrontPlugin {
59
59
this . prepareOrigins ( distributionConfig ) ;
60
60
this . prepareComment ( distributionConfig ) ;
61
61
this . prepareCertificate ( distributionConfig ) ;
62
+ this . prepareWaf ( distributionConfig ) ;
62
63
}
63
64
64
65
prepareLogging ( distributionConfig ) {
@@ -107,6 +108,16 @@ class ServerlessApiCloudFrontPlugin {
107
108
}
108
109
}
109
110
111
+ prepareWaf ( distributionConfig ) {
112
+ const waf = this . getConfig ( 'waf' , null ) ;
113
+
114
+ if ( waf !== null ) {
115
+ distributionConfig . WebACLId = waf ;
116
+ } else {
117
+ delete distributionConfig . WebACLId ;
118
+ }
119
+ }
120
+
110
121
getConfig ( field , defaultValue ) {
111
122
return _ . get ( this . serverless , `service.custom.apiCloudFront.${ field } ` , defaultValue )
112
123
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " serverless-api-cloudfront" ,
3
- "version" : " 0.9.1 " ,
3
+ "version" : " 0.9.2 " ,
4
4
"engines" : {
5
5
"node" : " >=4.0"
6
6
},
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ Resources:
54
54
IncludeCookies : ' false'
55
55
Bucket : ' '
56
56
Prefix : ' '
57
+ WebACLId : waf-id
57
58
58
59
Outputs :
59
60
ApiDistribution :
You can’t perform that action at this time.
0 commit comments