Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon cloudformation Cloudformation:参考在其他地区创建的ACM证书_Amazon Cloudformation - Fatal编程技术网

Amazon cloudformation Cloudformation:参考在其他地区创建的ACM证书

Amazon cloudformation Cloudformation:参考在其他地区创建的ACM证书,amazon-cloudformation,Amazon Cloudformation,由于Cloudfront的https证书只能在us-east-1中创建,而我的整个堆栈是在eu-west-1中创建的,因此我想在us-east-1中创建一个包含ACM证书的堆栈,然后在eu-west-1中的堆栈中使用该证书 唯一的问题是,我如何引用此证书而不对其进行硬编码,因为我无法ImportValue另一个区域中的输出 e、 g 当我在eu-west-1中部署它时,我需要在AcmCertificateArn行上放置什么?正如您所指出的,您不能在不同区域的堆栈之间进行跨区域导出/导入引用。在这

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

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

e、 g


当我在
eu-west-1
中部署它时,我需要在
AcmCertificateArn
行上放置什么?

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


其他选项包括使用动态引用传递证书的ARN值。对于全自动解决方案,您需要以lambda函数的形式开发in
eu-west-1
。该函数将查询
us-east-1
中的堆栈以获取其输出中的arn,并将arn返回到
eu-west-1
中的堆栈中。我在某个地方看到了SSM参数技巧,但对于这样愚蠢的事情,确实需要做很多工作。我决定使用一个输入参数。遗憾的是,AWS还没有想出一个简单的解决方案。
  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