gpt4 book ai didi

aws-cloudformation - 云信息 : Reference created ACM Certificate in other region

转载 作者:行者123 更新时间:2023-12-05 03:45:05 24 4
gpt4 key购买 nike

由于 Cloudfront 的 https 证书只能在 us-east-1 中创建,而我的整个堆栈是在 eu-west-1 中创建的,所以我想创建一个堆栈位于包含 ACM 证书的 us-east-1 中,然后在 eu-west-1 中的堆栈中使用该证书。

唯一的问题是,如何在不对其进行硬编码的情况下引用此证书,因为我无法 ImportValue 另一个区域的输出。

例如

  Distribution:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
Origins:
- DomainName: !GetAtt S3Bucket.RegionalDomainName
Id: ****
CustomOriginConfig:
HTTPPort: '80'
HTTPSPort: '443'
OriginProtocolPolicy: https-only
DefaultRootObject: 'index.html'
Enabled: true
Aliases:
- 'bla.bla.com'
DefaultCacheBehavior:
TargetOriginId: '*-origin'
AllowedMethods:
- GET
- HEAD
ViewerProtocolPolicy: redirect-to-https
CachePolicyId: '658327ea-f89d-4fab-a63d-7e88639e58f6'
ViewerCertificate:
AcmCertificateArn: !ImportValue ****
SslSupportMethod: sni-only

当我在 eu-west-1 中部署此内容时,我需要在 AcmCertificateArn 行中添加什么内容?

最佳答案

正如您所指出的,您无法在不同区域的堆栈之间进行跨区域导出/导入引用。在这种情况下,通常您会将证书 ARN 作为输入参数提供给 eu-west-1 中的堆栈。 .

其他选项将涉及使用 SSM parameters用于传递证书 ARN 值的动态引用。对于全自动解决方案,您需要开发一个custom resourceeu-west-1以 lambda 函数的形式。该函数将查询us-east-1中的堆栈。获取其输出中的 arn 并将 arn 返回到 eu-west-1 中的堆栈.

关于aws-cloudformation - 云信息 : Reference created ACM Certificate in other region,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66121226/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com