gpt4 book ai didi

amazon-web-services - 云信息 : CommaDelimitedList of Cert ARNs for ListenerCertificate Resource

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

我尝试传入 CommaDelimitedList 以填充 AWS::ElasticLoadBalancingV2::ListenerCertificate 资源中的证书列表。

错误:属性证书的值必须是对象列表

我尝试了几种格式,包括以下格式:

Parameters:
pAdditionalAlbListenerCertArns:
Type: CommaDelimitedList
Default: "arn:someCert1, arnsomeCert2"
Description: enter list of the ACM Certificates (Arns)

## Resource Format 1 - I would think this way would work as the result is [thing1, thing2]
Resources:
rCertificatesList:
Type: AWS::ElasticLoadBalancingV2::ListenerCertificate
Properties:
Certificates: ! Ref pAdditionalAlbListenerCertArns

## Resource Format 2 - I know this should not work, because it's a single item trying to be populated by a list.
Resources:
rCertificatesList:
Type: AWS::ElasticLoadBalancingV2::ListenerCertificate
Properties:
Certificates:
CertificateArn: ! Ref pAdditionalAlbListenerCertArns

显然 Cfn 不够聪明,无法在每个项目前面添加 CertificateArn:

我还尝试了 !Split!Sub!Join 的组合,但出现了相同的错误。目前我必须直接输入证书,这是不可行的。虽然我可以为每个证书创建单独的参数,或者使用 !Select 将它们从列表中获取,但我不知道每个环境(DEV/TEST/PROD)中会有多少个证书.

我知道这对于安全组之类的东西来说非常有效;我错过了什么吗?

提前致谢!

最佳答案

AWS::ElasticLoadBalancingV2::ListenerCertificate Certificate的格式是:

  Certificates: 
- CertificateArn: String

您的任何用途都不适用于此。事实上,什么都不起作用,因为这需要循环,而 CloudFormation 不支持。实现您想要的唯一可行的方法是开发您自己的custom CFN macro .

相反,如果您需要在 CFN 代码中进行大量迭代,那么 CFN 可能不是适合您的工具。看看 CDK 或 terraform,它们对循环有丰富的支持。

关于amazon-web-services - 云信息 : CommaDelimitedList of Cert ARNs for ListenerCertificate Resource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68505273/

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