You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, let me say that the zone is found/available and in the same block of code I am imperatively calling the cloudflare api directly with the same zone, token, and email with a check on the result and it is successful.
Therefore, I think there is a problem with either the pulumi provider or execution of PageRule.
Sample code:
/** * Cloudflare page rules to control edge caches */constcloudflareConfig=newConfig('cloudflare')const[email,token,zone,domain]=['email','token','zone','domain'].map(key=>cloudflareConfig.require(key),)constcloudflareProvider=newcloudflare.Provider('cloudflare',{
email,
token,})consttargets=[`https://${domain}`]targets.forEach(target=>{newcloudflare.PageRule(target,{actions: {cacheLevel: 'cache_everything',edgeCacheTtl: 3600,// 1 hour},priority: 1,status: 'active',
target,
zone,},{provider: cloudflareProvider},)})/** * Wait for rollout status to be good on web, then clear the cloudflare cache */rolloutStatus(web.deployment).apply(rStatus=>{log.info('Rollout status of web:',rStatus)if(!rStatus.finished){log.error('deployment not yet finished!!!')}elseif(rStatus.availableReplicas<rStatus.updatedReplicas){log.error('availableReplicas are less than updatedReplicas!!!')}constcloudflareClient=newCloudflareClient(email,token)cloudflareClient.purgeCache(zone,{files: [`https://${domain}/index.html`,`https://www.${domain}/index.html`,`https://${domain}/webpack/a/manifest.json`,],})})
Error:
Updating (alienfast/production):
Type Name Status Info
pulumi:pulumi:Stack acme-app-production **failed** 1 error; 4 messages
+ ├─ pulumi:providers:cloudflare cloudflare created
+ └─ cloudflare:index:PageRule https://acme.com **creating failed** 1 error
Diagnostics:
error: update failed
cloudflare:index:PageRule (https://acme.com):
error: Plan apply failed: Error finding zone "xyz123": Zone could not be found
The text was updated successfully, but these errors were encountered:
First, let me say that the zone is found/available and in the same block of code I am imperatively calling the cloudflare api directly with the same zone, token, and email with a check on the result and it is successful.
Therefore, I think there is a problem with either the pulumi provider or execution of PageRule.
Sample code:
Error:
The text was updated successfully, but these errors were encountered: