File tree 2 files changed +5
-3
lines changed
cdk-cloudfront-authorization/src
cdk-contentful-webhook/src
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ export class BaseDistribution extends Construct implements aws_cloudfront.IDistr
174
174
const removalPolicy = props . removalPolicy ?? RemovalPolicy . DESTROY ;
175
175
const origin = props . origin ?? this . defaultOrigin ( removalPolicy ) ;
176
176
177
- const distribution = this . distribution = new aws_cloudfront . Distribution ( this , 'Distribution' , {
177
+ const distribution = new aws_cloudfront . Distribution ( this , 'Distribution' , {
178
178
enabled : props . enabled ?? true ,
179
179
enableIpv6 : props . enableIpv6 ?? true ,
180
180
comment : props . comment ,
@@ -195,6 +195,8 @@ export class BaseDistribution extends Construct implements aws_cloudfront.IDistr
195
195
defaultRootObject : props . defaultRootObject ?? 'index.html' ,
196
196
} ) ;
197
197
198
+ this . distribution = distribution ;
199
+
198
200
const callbackUrls = props . domainNames ?. map ( ( name ) => `https://${ name } ${ props . authorization . redirectPaths . signIn } ` ) ?? [ ] ;
199
201
const logoutUrls = props . domainNames ?. map ( ( name ) => `https://${ name } ${ props . authorization . redirectPaths . signOut } ` ) ?? [ ] ;
200
202
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ export class ContentfulWebhook extends Construct {
27
27
timeout : Duration . minutes ( 15 ) ,
28
28
} ) ;
29
29
30
- if ( accessToken . grantRead ) {
31
- accessToken . grantRead ( handler . role ! ) ;
30
+ if ( accessToken . grantRead && handler . role ) {
31
+ accessToken . grantRead ( handler . role ) ;
32
32
}
33
33
34
34
new CustomResource ( this , 'CustomResource' , {
You can’t perform that action at this time.
0 commit comments