Skip to content

Commit

Permalink
fix: ignore staging property changes (#4413)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j authored Nov 26, 2024
1 parent f9da84b commit 7236a5d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/pulumi-aws/src/apps/api/ApiCloudfront.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,21 @@ export const ApiCloudfront = createAppModule({
viewerCertificate: {
cloudfrontDefaultCertificate: true
}
},
opts: {
// We are ignoring changes to the "staging" property. This is because of the following.
// With the 5.41.0 release of Webiny, we also upgraded Pulumi to v6. This introduced a change
// with how Cloudfront distributions are deployed, where Pulumi now also controls the new
// `staging` property.
// If not set, Pulumi will default it to `false`. Which is fine, but, the problem is
// that, because this property did not exist before, it will always be considered as a change
// upon deployment.
// We might think this is fine, but, the problem is that a change in this property causes
// a full replacement of the Cloudfront distribution, which is not acceptable. Especially
// if a custom domain has already been associated with the distribution. This then would
// require the user to disassociate the domain, wait for the distribution to be replaced,
// and then re-associate the domain. This is not a good experience.
ignoreChanges: ["staging"]
}
});
}
Expand Down
15 changes: 15 additions & 0 deletions packages/pulumi-aws/src/apps/react/createReactPulumiApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ export const createReactPulumiApp = (projectAppParams: CreateReactPulumiAppParam
viewerCertificate: {
cloudfrontDefaultCertificate: true
}
},
opts: {
// We are ignoring changes to the "staging" property. This is because of the following.
// With the 5.41.0 release of Webiny, we also upgraded Pulumi to v6. This introduced a change
// with how Cloudfront distributions are deployed, where Pulumi now also controls the new
// `staging` property.
// If not set, Pulumi will default it to `false`. Which is fine, but, the problem is
// that, because this property did not exist before, it will always be considered as a change
// upon deployment.
// We might think this is fine, but, the problem is that a change in this property causes
// a full replacement of the Cloudfront distribution, which is not acceptable. Especially
// if a custom domain has already been associated with the distribution. This then would
// require the user to disassociate the domain, wait for the distribution to be replaced,
// and then re-associate the domain. This is not a good experience.
ignoreChanges: ["staging"]
}
});

Expand Down
19 changes: 19 additions & 0 deletions packages/pulumi-aws/src/apps/website/createWebsitePulumiApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,21 @@ export const createWebsitePulumiApp = (projectAppParams: CreateWebsitePulumiAppP
viewerCertificate: {
cloudfrontDefaultCertificate: true
}
},
opts: {
// We are ignoring changes to the "staging" property. This is because of the following.
// With the 5.41.0 release of Webiny, we also upgraded Pulumi to v6. This introduced a change
// with how Cloudfront distributions are deployed, where Pulumi now also controls the new
// `staging` property.
// If not set, Pulumi will default it to `false`. Which is fine, but, the problem is
// that, because this property did not exist before, it will always be considered as a change
// upon deployment.
// We might think this is fine, but, the problem is that a change in this property causes
// a full replacement of the Cloudfront distribution, which is not acceptable. Especially
// if a custom domain has already been associated with the distribution. This then would
// require the user to disassociate the domain, wait for the distribution to be replaced,
// and then re-associate the domain. This is not a good experience.
ignoreChanges: ["staging"]
}
});

Expand Down Expand Up @@ -204,6 +219,10 @@ export const createWebsitePulumiApp = (projectAppParams: CreateWebsitePulumiAppP
viewerCertificate: {
cloudfrontDefaultCertificate: true
}
},
opts: {
// Check the comment in the `appCloudfront` resource above for more info.
ignoreChanges: ["staging"]
}
});

Expand Down

0 comments on commit 7236a5d

Please sign in to comment.