We were using Serverless Framework Version 2. Now we’re switching it to the version 3. Everything works as is except for the Conditions. They’re just ignored and all the resources are trying to be created on all the environments.
Yaml code sample:
service: service-name
frameworkVersion: '3' # was '2' before
provider:
name: aws
runtime: provided
stage: ${opt:stage, 'dev'}
# some other configs here...
resources:
Conditions:
CreateProdResources: !Equals
- ${self:provider.stage}
- prod
Resources:
SqsQueueName:
Type: AWS::SQS::Queue
Condition: CreateProdResources
Properties:
# Some SQS properties here
When I switch it over to Serverless v3, my IDE starts complaining on the line: Condition: CreateProdResources
, saying “Schema validation: Property ‘Condition’ is not allowed”.
Tried to find anything here: Serverless Framework - Upgrading to v3 - no luck. Google seems also “not aware” of the issue.
Any suggestion please?