-
Notifications
You must be signed in to change notification settings - Fork 5.7k
vpc.securityGroupIds should support CF intrinsic function #10058
Copy link
Copy link
Closed
Labels
Description
Are you certain it's a bug?
- Yes, it looks like a bug
Is the issue caused by a plugin?
- It is not a plugin issue
Are you using the latest version?
- Yes, I'm using the latest version
Is there an existing issue for this?
- I have searched existing issues, it hasn't been reported yet
Issue description
We're currently using If function in vpc.securityGroupIds to conditionally add/remove a security group. Serverless is currently throwing warning as below:
Configuration warning at 'provider.vpc.securityGroupIds[3]': unsupported object format
Service configuration (serverless.yml) content
service: fmi-stack-api
provider:
name: aws
runtime: python3.8
stage: ${opt:stage,'dev'}
vpc:
securityGroupIds:
- ${cf:stack-redis-${self:provider.stage}.SecurityGroup}
- ${cf:stack-postgres-${self:provider.stage}.SecurityGroup}
- ${cf:stack-elasticsearch-${self:provider.stage}.SecurityGroup}
- !If [MailhogUsed, "${cf:stack-mailhog-${self:provider.stage}.SecurityGroup, ''}", !Ref 'AWS::NoValue']
subnetIds:
- ${cf:stack-network-${self:provider.stage}.PrivateSubnet1}
- ${cf:stack-network-${self:provider.stage}.PrivateSubnet2}
functions:
task:
handler: task_handler.handler
resources:
Conditions:
MailhogUsed:
Fn::Not:
- Fn::Equals:
- ${cf:stack-mailhog-${self:provider.stage}.SecurityGroup, ''}
- ''Command name and used flags
sls deploy
Command output
N/AEnvironment information
Framework Core: 2.61.0 (local)
Plugin: 5.4.5
SDK: 4.3.0
Components: 3.17.1Reactions are currently unavailable