Skip to content

Commit 7b9af3b

Browse files
committed
Revert "Add CloudFront invalidation support and update dependencies"
This reverts commit 0260bc5.
1 parent 0260bc5 commit 7b9af3b

File tree

4 files changed

+0
-83
lines changed

4 files changed

+0
-83
lines changed

backend/package-lock.json

Lines changed: 0 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"author": "Julian Boilen",
2121
"license": "ISC",
2222
"devDependencies": {
23-
"@aws-sdk/client-cloudfront": "^3.741.0",
2423
"@aws-sdk/client-s3": "^3.741.0",
2524
"@hey-api/openapi-ts": "^0.64.1",
2625
"@sparticuz/chromium": "^132.0.0",

backend/serverless.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ provider:
1818
Action:
1919
- s3:*
2020
Resource: "*"
21-
- Effect: Allow
22-
Action:
23-
- cloudfront:CreateInvalidation
24-
Resource: "*"
2521
environment:
2622
STAGE: ${sls:stage}
2723
DB_HOST: ${ssm:/${self:service}-${sls:stage}-db-host}
@@ -41,7 +37,6 @@ provider:
4137
OPENAI_SK: ${ssm:/${self:service}-${sls:stage}-openai-sk}
4238
RAPIDAPI_API_KEY: ${ssm:/${self:service}-${sls:stage}-rapidapi-api-key}
4339
PRINTFUL_SK: ${ssm:/${self:service}-${sls:stage}-printful-sk}
44-
MAPTILES_CLOUDFRONT_DISTRIBUTION_ID: ${ssm:/${self:service}-${sls:stage}-maptiles-cloudfront-distribution-id}
4540
plugins:
4641
- serverless-plugin-conditional-functions
4742
- serverless-webpack

backend/src/cron/syncMapSelfHosted.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { CloudFrontClient, CreateInvalidationCommand } from '@aws-sdk/client-cloudfront';
21
import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';
32
import { createReadStream } from 'fs';
43
import { getRepository } from 'typeorm';
@@ -8,7 +7,6 @@ import EffectiveAddress from '../entities/EffectiveAddress';
87
import EffectiveGeocode from '../entities/EffectiveGeocode';
98

109
const s3 = new S3Client();
11-
const cloudFront = new CloudFrontClient();
1210

1311
export default async function syncMap(): Promise<void> {
1412
console.log('Refreshing effective addresses...');
@@ -48,25 +46,5 @@ export default async function syncMap(): Promise<void> {
4846
})
4947
);
5048

51-
console.log('Creating CloudFront invalidation...');
52-
const distributionId = process.env.MAPTILES_CLOUDFRONT_DISTRIBUTION_ID;
53-
if (distributionId) {
54-
await cloudFront.send(
55-
new CreateInvalidationCommand({
56-
DistributionId: distributionId,
57-
InvalidationBatch: {
58-
Paths: {
59-
Quantity: 1,
60-
Items: ['/photos-1940s.pmtiles'],
61-
},
62-
CallerReference: `sync-map-${Date.now()}`,
63-
},
64-
})
65-
);
66-
console.log('CloudFront invalidation created successfully.');
67-
} else {
68-
console.log('MAPTILES_CLOUDFRONT_DISTRIBUTION_ID not set, skipping invalidation.');
69-
}
70-
7149
console.log('Sync of map data complete.');
7250
}

0 commit comments

Comments
 (0)