0
votes

I am trying to create ACL's based on the Environment and have the following condition.

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

I am getting the following error:

Template format error: Conditions can only be boolean operations on parameters and other conditions
1
What is Env actually? Please post a more complete example (see minimal reproducible example).lexicore
Here's what ENV indicates: ``` Global: Env: stage Region: us-west -1 ```rk123
Please edit your question to include definition of Env. Its is still not clear from your comment.lexicore

1 Answers

0
votes

Try this instead:

Conditions:
  IsStage:  
    !Equals [ !Ref Env, 'stage' ]