Skip to content

Commit

Permalink
enable cf permissions again
Browse files Browse the repository at this point in the history
  • Loading branch information
its-felix committed May 4, 2024
1 parent f3c24db commit f1a0d70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cdk/lib/constructs/ui-resources-construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class UIResourcesConstruct extends Construct {

private grantReadInternal(distributionArn: string): void {
this.bucket.addToResourcePolicy(new PolicyStatement({
sid: 'AllowCloudFrontServicePrincipalGet',
effect: Effect.ALLOW,
actions: ['s3:GetObject'],
principals: [new ServicePrincipal('cloudfront')],
Expand All @@ -43,6 +44,7 @@ export class UIResourcesConstruct extends Construct {
}));

this.bucket.addToResourcePolicy(new PolicyStatement({
sid: 'AllowCloudFrontServicePrincipalList',
effect: Effect.ALLOW,
actions: ['s3:ListBucket'],
principals: [new ServicePrincipal('cloudfront')],
Expand Down
2 changes: 1 addition & 1 deletion cdk/lib/stacks/website-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class WebsiteStack extends cdk.Stack {
apiLambdaFunctionURL: api.functionURL,
});

// uiResources.grantRead(cf.distribution);
uiResources.grantRead(cf.distribution);
uiResources.deployResourcesZip(props.uiResourcesZipPath, cf.distribution);

this.distribution = cf.distribution;
Expand Down

0 comments on commit f1a0d70

Please sign in to comment.