【发布时间】:2021-09-30 22:35:00
【问题描述】:
我正在尝试传入 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)中会有多少。
我知道这对安全组之类的东西很有效;我错过了什么吗?
提前致谢!
【问题讨论】:
标签: amazon-web-services amazon-cloudformation