【发布时间】:2021-10-17 17:55:11
【问题描述】:
我有 cloudformation 文件,可以检查是 Apple 添加 IP 还是添加其他 IP。
但是,我想为 Apple 而不是 Apple 添加 IP,而不将 IP 复制到两者。
只要写一次!
尝试执行此操作时,我收到验证错误...
这是我的原始代码 -
SecurityGroupIngress: !If
- IsApple
- - Description: "Its Apple IP"
FromPort: X
ToPort: X
IpProtocol: tcp
CidrIp: X.X.X.X
- - Description: "It's not Apple IP"
FromPort: X
ToPort: X
IpProtocol: tcp
CidrIp: X.X.X.X
这就是我想要的改变-
SecurityGroupIngress:
- Description: "Its *All* fruits IPs"
FromPort: X
ToPort: X
IpProtocol: tcp
CidrIp: X.X.X.X
!If
- IsApple
- - Description: "Its Apple IP"
FromPort: X
ToPort: X
IpProtocol: tcp
CidrIp: X.X.X.X
- - Description: "It's not Apple IP"
FromPort: X
ToPort: X
IpProtocol: tcp
CidrIp: X.X.X.X
【问题讨论】:
标签: amazon-web-services syntax yaml ip amazon-cloudformation