Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
chore: disable cloudfront edge function
Browse files Browse the repository at this point in the history
  • Loading branch information
jspark2000 committed Mar 1, 2024
1 parent 1d7d3de commit 6b4cda5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 26 deletions.
5 changes: 0 additions & 5 deletions aws/cdn/archive_file.tf

This file was deleted.

5 changes: 0 additions & 5 deletions aws/cdn/cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ resource "aws_cloudfront_distribution" "main" {
target_origin_id = aws_s3_bucket.cdn_bucket.id
viewer_protocol_policy = "redirect-to-https"

lambda_function_association {
event_type = "viewer-request"
lambda_arn = aws_lambda_function.cdn.qualified_arn
}

forwarded_values {
query_string = false

Expand Down
15 changes: 0 additions & 15 deletions aws/cdn/lambda_function/index.js

This file was deleted.

5 changes: 4 additions & 1 deletion backend/libs/storage/src/image-storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ export class ImageStorageServiceImpl implements ImageStorageService {
await this.s3.send(
new PutObjectCommand({
Bucket: this.configService.get('AWS_CDN_BUCKET_NAME'),
Key: key,
Key:
this.configService.get('NODE_ENV') === 'production'
? keyWithoutExtenstion
: key,
Body: file.buffer,
ContentType: fileType
})
Expand Down

0 comments on commit 6b4cda5

Please sign in to comment.