ฉัน deploying ของฉันยังโสดหน้าแอพต้องเป็น S3 ถังผ่านทางค AWS-CDK.
ปัจจุบันตั้งรหัสคือ:
this.distribution = new CloudFrontWebDistribution(this, `${this.props.applicationName}Distribution`, {
originConfigs: [
{
s3OriginSource: {
s3BucketSource: this.dashboardBucket,
originAccessIdentity: dashboardIdentity
},
behaviors: [{
isDefaultBehavior: true
}],
},
],
aliasConfiguration: {
acmCertRef: awsConfig.acm_arn,
names: [url]
},
errorConfigurations: [
{
errorCode: 403,
responseCode: 200,
responsePagePath: '/'
},
{
errorCode: 404,
responseCode: 200,
responsePagePath: '/index.html'
}
]
});
อย่างไรก็ตามใน AWS-CDK 1.133 ฉันได้ข้อความนั่น aliasConfiguration
คือ deprecated. ดังนั้นฉันกำลังมองอยู่ viewerCertificate: ViewerCertificate.fromAcmCertificate()
แต่ฉันไม่แน่ใจว่ามันใช้ยังไง?
ก่อนที่ผมจะอ้างอิง ARN ของใบรับรองว่าฉันจองแล้วสร้างขึ้นมาในกองใบรับรองที่ผู้จัดการ
สามารถฉันใช้ Certificate
ชั้นเรียนจะได้รับการอ้างอิงของที่มีอยู่ ACM องทรัพยากรและใช้มันกับ ViewerCertificate?
AWS น docs ไม่ใช่สุดยอดชัดเจนในตัวอย่างทั้งหมอ้างอิง