conditional-statements - Aws - Cloudformation - Fn::Equals Error , 条件只能是对参数和其他条件的布尔运算
问题描述
我正在尝试基于环境创建 ACL 并具有以下条件。
Global:
Env: stage
Region: us-west -1
Conditions:
IsStage: Fn::Equals [!Ref "Env", "stage"]
Resources:
publicIngressVpc:
Type: AWS::EC2::NetworkAclEntry
Condition: IsStage
Properties:
NetworkAclId:
Fn::ImportValue:
!Sub ${VpcStack}-publicNetworkAclId
RuleNumber: 150
Protocol: -1 # tcp
RuleAction: allow
CidrBlock: Some VPC
PortRange:
From: 1024
To: 65535
我收到以下错误:
Template format error: Conditions can only be boolean operations on parameters and other conditions
解决方案
试试这个:
Conditions:
IsStage:
!Equals [ !Ref Env, 'stage' ]
推荐阅读
- java - 使用骆驼和 readLock=none 流式传输文件
- python - Flask:如何覆盖蓝图路线?
- java - 在这种情况下如何查找入职日期最新的员工
- http-status-code-404 - 如果后端服务器之一关闭,haproxy 将在大约 2-3 秒内出现 404 错误
- html - 我的导航栏链接之一无法正常工作
- mysql - 添加外键约束失败。引用表中缺少约束 * 的索引 *
- python-3.x - 我怎样才能一次播放多首歌曲[歌曲列表],并有权在 python 中停止它们
- singularity-container - 奇点秘方:如何访问容器内的可执行文件?
- javascript - js 使用 Access-Control-Allow-Origin 获取 cors 错误
- python - 我的函数使用递归返回嵌套列表中目标的出现次数不起作用