Skip to content

Commit 7236a5d

Browse files
authored
fix: ignore staging property changes (#4413)
1 parent f9da84b commit 7236a5d

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

packages/pulumi-aws/src/apps/api/ApiCloudfront.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,21 @@ export const ApiCloudfront = createAppModule({
123123
viewerCertificate: {
124124
cloudfrontDefaultCertificate: true
125125
}
126+
},
127+
opts: {
128+
// We are ignoring changes to the "staging" property. This is because of the following.
129+
// With the 5.41.0 release of Webiny, we also upgraded Pulumi to v6. This introduced a change
130+
// with how Cloudfront distributions are deployed, where Pulumi now also controls the new
131+
// `staging` property.
132+
// If not set, Pulumi will default it to `false`. Which is fine, but, the problem is
133+
// that, because this property did not exist before, it will always be considered as a change
134+
// upon deployment.
135+
// We might think this is fine, but, the problem is that a change in this property causes
136+
// a full replacement of the Cloudfront distribution, which is not acceptable. Especially
137+
// if a custom domain has already been associated with the distribution. This then would
138+
// require the user to disassociate the domain, wait for the distribution to be replaced,
139+
// and then re-associate the domain. This is not a good experience.
140+
ignoreChanges: ["staging"]
126141
}
127142
});
128143
}

packages/pulumi-aws/src/apps/react/createReactPulumiApp.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,21 @@ export const createReactPulumiApp = (projectAppParams: CreateReactPulumiAppParam
109109
viewerCertificate: {
110110
cloudfrontDefaultCertificate: true
111111
}
112+
},
113+
opts: {
114+
// We are ignoring changes to the "staging" property. This is because of the following.
115+
// With the 5.41.0 release of Webiny, we also upgraded Pulumi to v6. This introduced a change
116+
// with how Cloudfront distributions are deployed, where Pulumi now also controls the new
117+
// `staging` property.
118+
// If not set, Pulumi will default it to `false`. Which is fine, but, the problem is
119+
// that, because this property did not exist before, it will always be considered as a change
120+
// upon deployment.
121+
// We might think this is fine, but, the problem is that a change in this property causes
122+
// a full replacement of the Cloudfront distribution, which is not acceptable. Especially
123+
// if a custom domain has already been associated with the distribution. This then would
124+
// require the user to disassociate the domain, wait for the distribution to be replaced,
125+
// and then re-associate the domain. This is not a good experience.
126+
ignoreChanges: ["staging"]
112127
}
113128
});
114129

packages/pulumi-aws/src/apps/website/createWebsitePulumiApp.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,21 @@ export const createWebsitePulumiApp = (projectAppParams: CreateWebsitePulumiAppP
122122
viewerCertificate: {
123123
cloudfrontDefaultCertificate: true
124124
}
125+
},
126+
opts: {
127+
// We are ignoring changes to the "staging" property. This is because of the following.
128+
// With the 5.41.0 release of Webiny, we also upgraded Pulumi to v6. This introduced a change
129+
// with how Cloudfront distributions are deployed, where Pulumi now also controls the new
130+
// `staging` property.
131+
// If not set, Pulumi will default it to `false`. Which is fine, but, the problem is
132+
// that, because this property did not exist before, it will always be considered as a change
133+
// upon deployment.
134+
// We might think this is fine, but, the problem is that a change in this property causes
135+
// a full replacement of the Cloudfront distribution, which is not acceptable. Especially
136+
// if a custom domain has already been associated with the distribution. This then would
137+
// require the user to disassociate the domain, wait for the distribution to be replaced,
138+
// and then re-associate the domain. This is not a good experience.
139+
ignoreChanges: ["staging"]
125140
}
126141
});
127142

@@ -204,6 +219,10 @@ export const createWebsitePulumiApp = (projectAppParams: CreateWebsitePulumiAppP
204219
viewerCertificate: {
205220
cloudfrontDefaultCertificate: true
206221
}
222+
},
223+
opts: {
224+
// Check the comment in the `appCloudfront` resource above for more info.
225+
ignoreChanges: ["staging"]
207226
}
208227
});
209228

0 commit comments

Comments
 (0)