【发布时间】:2022-01-09 16:49:19
【问题描述】:
我刚刚从 AWS 解决方案部署了 CloudFormation 解决方案。这些解决方案包括一个新的 CloudFront 发行版。我的挑战是我想将自定义域 mysite.example.com 添加到 dxxxxxx.cloudfront.net 分发中。我已经使用证书管理器创建了别名和证书。我的问题是如何将新域添加到现有 CloudFront。
我知道我们可以使用 Distribution.fromDistributionAttributes 导入现有发行版。
例如
const distribution = cloudfront.Distribution.fromDistributionAttributes(this, 'ImportedDist', {
domainName: 'd111111abcdef8.cloudfront.net',
distributionId: '012345ABCDEF',
});
假设我已经准备好使用别名域名和证书 ARN。
const domainName = 'mysite.example.com';
const certificateArn = 'arn:aws:acm:us-east-1: 123456789012:certificate/abcdefgh-1234-5678-9012-abcdefghujkl';
我从这里去哪里?
【问题讨论】:
标签: amazon-web-services ssl-certificate amazon-cloudformation amazon-cloudfront aws-cdk