Skip to content

Commit

Permalink
Handle CDN invalidations only if CDN explicitly enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
DocLM committed Jun 6, 2024
1 parent 202f840 commit d3116f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Architect Deploy changelog

## [5.0.8] 2024-06-06

### Fixed

- Handle CDN invalidations only if CDN explicitly enabled

---

## [5.0.7] 2024-04-30
Expand Down
4 changes: 2 additions & 2 deletions src/sam/02-after/00-get-app-apex/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module.exports = function getAppApex (params, callback) {
else callback()
},
function invalidateS3 (callback) {
if (s3 && !creatingS3 && !enablingS3 && !destroyingS3) {
if (cdnEnabled && s3 && !creatingS3 && !enablingS3 && !destroyingS3) {
update.status('Invalidating static asset (S3) CDN distribution cache')
aws.cloudfront.CreateInvalidation({
Id: s3.id,
Expand Down Expand Up @@ -132,7 +132,7 @@ module.exports = function getAppApex (params, callback) {
else callback()
},
function invalidateApiGateway (callback) {
if (apigateway && !creatingApiGateway && !enablingApiGateway && !destroyingApiGateway) {
if (cdnEnabled && apigateway && !creatingApiGateway && !enablingApiGateway && !destroyingApiGateway) {
update.status('Invalidating API Gateway CDN distribution cache')
aws.cloudfront.CreateInvalidation({
Id: apigateway.id,
Expand Down

0 comments on commit d3116f4

Please sign in to comment.