Reputation: 1101
Let's say I have a webapp where users can click a button that starts a long running task (eg. 3 days long). The user can also select options, for example the things it wants that task to do.
No matter what, the task will be the same script that runs when the instance starts. However, I would like it to somehow take arguments from the button click to change the function of the startup script.
Is there a way to do this with AWS EC2 instances?
Upvotes: 1
Views: 247
Reputation: 3538
This behaviour isn't directly related to EC2, although EC2 could host an application that does these long-running parameterised tasks. Whether EC2 is a good choice also depends on how your tasks react to underlying failures: if the EC2 instance fails or restarts, what happens to your task?
Depending on your use case, some managed options might be:
Upvotes: 1
Reputation: 270154
So, you're saying that you want to pass certain parameters to some software that will be launched on an EC2 instance.
There are many ways to do this:
http://169.254.169.254/latest/user-data/
. So, either pass the configuration directly or pass it as part of the startup script.Personally, I like the idea of Tags. It's very Cloud.
Upvotes: 2