Closed HayDegha0917 closed 4 years ago
Added the following to my Serevrless template.
If: '${self:custom.account.es_num_az} > 1' Set: - resources.Resources.OCSElasticsearchCluster.Properties.ElasticsearchClusterConfig.ZoneAwarenessEnabled: true - resources.Resources.OCSElasticsearchCluster.Properties.ElasticsearchClusterConfig.ZoneAwarenessConfig.AvailabilityZoneCount: ${self:custom.account.es_num_az} ElseExclude: - resources.Resources.OCSElasticsearchCluster.Properties.ElasticsearchClusterConfig.ZoneAwarenessConfig.AvailabilityZoneCount - resources.Resources.OCSElasticsearchCluster.Properties.ElasticsearchClusterConfig.ZoneAwarenessConfig ElseSet: - resources.Resources.OCSElasticsearchCluster.Properties.ElasticsearchClusterConfig.ZoneAwarenessEnabled: false
But the output is:
Serverless: serverless-plugin-ifelse - (1 > 1) Condition not true. Serverless: serverless-plugin-ifelse - Excluding: resources.Resources.OCSElasticsearchCluster.Properties.ElasticsearchClusterConfig.ZoneAwarenessConfig.AvailabilityZoneCount Serverless: serverless-plugin-ifelse - Excluding: resources.Resources.OCSElasticsearchCluster.Properties.ElasticsearchClusterConfig.ZoneAwarenessConfig
and if I look at the generated template, I see the ElseSet never gets executed.
ElseSet
After looking at it some more, it appears that the sub-nodes of Set and ElseSet are keys but the sub-nodes of Exlude and ElseExclude are arrays. This is freaking confusing!
Set
Exlude
ElseExclude
Added the following to my Serevrless template.
But the output is:
and if I look at the generated template, I see the
ElseSet
never gets executed.