Is something like this possible?
You could probably create a number of conditions in CFN, to account for all possible combinations. If you have only few allowed combinations, its should be doable.
For anything more complex, you need custom resource. The resource would be in the form of a lambda function which could do any calculatons on your parameters and and launch your instance using AWS SDK.
CLICK HERE to find out more related problems solutions.