I'm combining the use of this plugin with serverless-dotenv-plugin.
ifelse is declared AFTER dotenv:
plugins:
- serverless-webpack
- serverless-dotenv-plugin
- serverless-plugin-ifelse
Then I have the following:
chainId: ${env:CHAIN_ID, "42"}
serverlessIfElse:
- If: '"${self:custom.chainId}" == "1"'
Set:
provider.stage: mainnet
ElseSet:
provider.stage: kovan
Even though the following line is logged when I run serverless deploy,
> Serverless: serverless-plugin-ifelse - Value Changed for : provider.stage to: mainnet
the stack created use kovan as the value set, as the CloudFormation template contains things like:
"HelloLogGroup": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
"LogGroupName": "/aws/lambda/linguo-bot-kovan-hello"
}
},
So basically even though the plugin says it changed the stage value, it has no effect.
I'm combining the use of this plugin with
serverless-dotenv-plugin.ifelseis declared AFTERdotenv:Then I have the following:
Even though the following line is logged when I run
serverless deploy,the stack created use
kovanas the value set, as the CloudFormation template contains things like:So basically even though the plugin says it changed the
stagevalue, it has no effect.