本文整理汇总了TypeScript中aws-sdk.ACM.requestCertificate方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ACM.requestCertificate方法的具体用法?TypeScript ACM.requestCertificate怎么用?TypeScript ACM.requestCertificate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aws-sdk.ACM
的用法示例。
在下文中一共展示了ACM.requestCertificate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Error
.then(res => {
for (let i in res.CertificateSummaryList) {
if (
res.CertificateSummaryList[i].DomainName === domain &&
res.CertificateSummaryList[i] !== "FAILED"
) {
this._certificate = res.CertificateSummaryList[i];
return Promise.resolve(this._certificate);
}
}
if (!this._certificate) {
// Create certificate
let params = {
DomainName: domain,
DomainValidationOptions: [
{
DomainName: domain,
ValidationDomain: domain
}
],
ValidationMethod: "DNS",
IdempotencyToken: "Webda_" + this.md5(domain).substr(0, 26)
};
return this._acm
.requestCertificate(params)
.promise()
.then(res => {
this._certificate = res;
return this._waitFor(
"Waiting for certificate challenge",
(resolve, reject) => {
return this._acm
.describeCertificate({
CertificateArn: this._certificate.CertificateArn
})
.promise()
.then((res: any) => {
if (
res.Certificate.DomainValidationOptions[0]
.ResourceRecord
) {
resolve(res.Certificate);
return Promise.resolve(true);
}
return Promise.resolve(false);
});
},
10000,
5
);
});
}
throw Error("Delay expired for certificate");
})