Issue
I am writing my first AWS Cloudformation template in Yaml. I am trying to figure out if it is possible to specify the number of instances created by an Autoscaling group based on two separate parameter inputs.
Example: User enters the volume of data indexed in GB from 1 to 3072 and it is saved as "data volume" parameter. Then the user enters the number of users of the network up to and it is saved as "usernumber". I then want to used to tell the ASG how many instances to create. So if there are 16 users and 2gb of data volume I want 2 instances and if there are 48 users and 500gb of data volume i want 10 instances and so on up to 21 instances.
Is something like this possible? Or am I stuck with only being able to allow the user to enter the number that they want as a single parameter?
Thanks for any help.
Solution
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.
Answered By - Marcin