Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle CDN invalidations only if CDN explicitly enabled #389

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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