dns - 使用无服务器框架将 Route 53 中的 DNS 记录添加和更新到 Cloudfront
问题描述
我目前正在扩展这个 repo。它包含使用无服务器框架将 sapper/svelte webapp 部署到 AWS 的源代码。我正在考虑如何将serverless.yml
Route53 DNS 路由扩展到 Cloudfront,但我似乎无法理解它。serverless -domain-manager插件似乎是为 Route53 到 API Gateway 路由而设计的,但我仅使用 Cloudfront、S3 存储桶和 Lambda@Edge 处理程序服务器端渲染应用程序来部署我的应用程序。
解决方案
我在这里做过类似的事情。
我已经修剪serverless.yml
了相关部分:
WebAppCloudFrontDistribution:
Type: AWS::CloudFront::Distribution
DependsOn:
- WebAppS3Bucket
Properties:
DistributionConfig:
### content trimmed
Aliases:
- 'www.example.com'
### content trimmed
ViewerCertificate:
AcmCertificateArn: 'CertificateArn' # in the linked repo I'm using a plugin to auto generate the certificate
SslSupportMethod: sni-only
WebsiteDNSName:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneId: 'HostedZoneId' # Taken from the AWS Console
RecordSets:
- Name: 'www.example.com'
Type: A
AliasTarget:
HostedZoneId: Z2FDTNDATAQYW2
DNSName: !GetAtt [WebAppCloudFrontDistribution, DomainName]
EvaluateTargetHealth: false
推荐阅读
- javascript - 使用对象而不是布尔更改应用程序流
- python-3.x - 使用 Visual Studio 代码 Python 3.8.5 打印时出现语法错误
- python - 从用户获取日期输入并使用python作为参数传递
- xamarin - System.NotSupportedException:'无法从本机句柄激活 SkiaSharp.Views.Forms.SKCanvasViewRenderer 类型的实例'
- scala - 一个动作返回 Future[Result] 而其他返回 Accumultor[]
- typescript - 当我们在vs代码工作区中保存文件时如何获取新修改行的行号?
- c# - 在 .Net Standard 2.0 中替换 string.Contains(string, StringComparison)
- augmented-reality - Reality Converter Beta 3 – GLTF 到 USDZ 转换中的错误
- spring-boot - Spring Boot app从jar包启动失败,但在IDE中运行正常
- windows - Wireshark Windows 构建失败:找不到 POD(缺少:POD2MAN_EXECUTABLE POD2HTML_EXECUTABLE)