ripe-russia-4239
07/22/2020, 2:41 PMTXT
record to my DNS with a specific GUID. If this step is not completed, the Pulumi CustomHostnameBinding
fails to create, and the Pulumi update as a whole fails:
Error creating/updating Custom Hostname Binding "<http://www.mywebsite.com|www.mywebsite.com>" (App Service "exampleappservice7422ec00" / Resource Group "exampleresourcegroupa1b4af45"): web.AppsClient#CreateOrUpdateHostNameBinding: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="A TXT record pointing from <http://asuid.www.mywebsite.com|asuid.www.mywebsite.com> to 2f77eba357071f06b1ae4cb900105eeb8236f2697466a15641af4fdd75f2fb49 was not found." Details=[{"Message":"A TXT record pointing from <http://asuid.www.mywebsite.com|asuid.www.mywebsite.com> to 2f77eba357071f06b1ae4cb900105eeb8236f2697466a15641af4fdd75f2fb49 was not found."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","ExtendedCode":"04006","Message":"A TXT record pointing from <http://asuid.www.mywebsite.com|asuid.www.mywebsite.com> to 2f77eba357071f06b1ae4cb900105eeb8236f2697466a15641af4fdd75f2fb49 was not found.","MessageTemplate":"A TXT record pointing from asuid.{0} to {1} was not found.","Parameters":["<http://www.mywebsite.com|www.mywebsite.com>","2f77eba357071f06b1ae4cb900105eeb8236f2697466a15641af4fdd75f2fb49"]}}]
I haven't been able to catch this error, nor identify a way (from the docs, poking around the Pulumi libraries with code completion, etc. etc.) to capture the resource(s) in error and inspect the returned error. What I'd like to be able to do is intercept this error, provision the TXT
record in CloudFlare DNS, retry the operation, then delete the TXT
record again.
I'm using the #typescript SDK.tall-librarian-49374
07/22/2020, 2:59 PMripe-russia-4239
07/22/2020, 3:03 PMCustomHostnameBinding
had an argument/option/whatever that accepted a DNS provider resource, so we could do something like:
new CustomHostnameBinding("example-binding", {
hostname: "<http://www.mywebsite.com|www.mywebsite.com>",
appServiceName: exampleAppService.name,
resourceGroupName: exampleResourceGroup.name
}, {
dnsVerificationRecord: new cloudflare.Record("azure-appservice-domain-verification", {
name: "azure-appservice-domain-verification",
zoneId: "whatever",
type: "TXT",
value: "value-from-the-error-message"
ttl: 3600
})
})
CustomHostnameBinding
can ever succeed at first…