I want to add two security group to a lambda function in template. However, it is a conditional statement and i can't find how i can do it. I'm giving an example below:
VpcConfig:
SecurityGroupIds:
- !If
- isProd
- !Ref SecurityIds + securityGroup2
- !Ref SecurityIds
SecurityIds is a security group which is referenced. My aim is that if environment is prod then it should be added two security group to the lambda (SecurityIds + SecurityGroup2) if it is not prod just add one security group (SecurityIds). I don't want to add all lambdas the securityGroup2 because of that i can't add this security group to SecurityIds list.