本文整理汇总了TypeScript中aws-sdk.ACM类的典型用法代码示例。如果您正苦于以下问题:TypeScript ACM类的具体用法?TypeScript ACM怎么用?TypeScript ACM使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ACM类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: _createCertificate
_createCertificate(domain, forceRegion) {
let config = JSON.parse(JSON.stringify(this.resources));
// CloudFront only use certificate in us-east-1 region...
if (forceRegion) {
config.region = forceRegion;
}
this._acm = new (this._getAWS(config)).ACM();
return this._acm
.listCertificates({})
.promise()
.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");
})
.then(cert => {
return this._acm
.describeCertificate({
CertificateArn: cert.CertificateArn
})
.promise();
})
.then((res: any) => {
let cert = res.Certificate;
if (cert.Status === "FAILED") {
return Promise.reject("Certificate validation has failed");
}
if (cert.Status === "PENDING_VALIDATION") {
// On create need to wait
let record = cert.DomainValidationOptions[0].ResourceRecord;
console.log("Need to validate certificate", cert.CertificateArn);
return this._createDNSEntry(record.Name, "CNAME", record.Value).then(
() => {
// Waiting for certificate validation
return this._waitFor(
"Waiting for certificate validation",
(resolve, reject) => {
return this._acm
.describeCertificate({
CertificateArn: cert.CertificateArn
})
.promise()
.then(res => {
if (res.Certificate.Status === "ISSUED") {
resolve(res.Certificate);
return Promise.resolve(true);
}
if (res.Certificate.Status !== "PENDING_VALIDATION") {
reject(res.Certificate);
return Promise.resolve(true);
}
//.........这里部分代码省略.........
开发者ID:loopingz,项目名称:webda-shell,代码行数:101,代码来源:aws.ts
示例2:
.then(cert => {
return this._acm
.describeCertificate({
CertificateArn: cert.CertificateArn
})
.promise();
})
开发者ID:loopingz,项目名称:webda-shell,代码行数:7,代码来源:aws.ts
示例3: 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");
})
开发者ID:loopingz,项目名称:webda-shell,代码行数:54,代码来源:aws.ts
示例4: resolve
(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);
});
},
开发者ID:loopingz,项目名称:webda-shell,代码行数:17,代码来源:aws.ts
注:本文中的aws-sdk.ACM类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论