# Script to automate listing available instances and starting an instance?

**URL:** https://deeptalk.lambda.ai/t/script-to-automate-listing-available-instances-and-starting-an-instance/3984
**Category:** Technical Help
**Created:** [October 10, 2023, 5:58am UTC](https://deeptalk.lambda.ai/t/script-to-automate-listing-available-instances-and-starting-an-instance/3984 "2023-10-10T05:58:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![govarthenan](https://sea1.discourse-cdn.com/flex019/user_avatar/deeptalk.lambda.ai/govarthenan/32/639_2.png) [@govarthenan](https://deeptalk.lambda.ai/u/govarthenan)
#### Post date: [October 10, 2023, 5:58am UTC](https://deeptalk.lambda.ai/t/script-to-automate-listing-available-instances-and-starting-an-instance/3984/1 "2023-10-10T05:58:50Z")

</div>

I’m a new user to the platform and find it amazing, except when it’s overloaded, which isn’t rare. So I want to automate the process of seeing which instances are available and want to create one, with the API. However, the API prompts to enter the password, which makes it hard to automate the process. If someone has a bash or Python script, would you be kind enough to share it with me?

---

<div class="post-metadata">

### Author: ![mpapili](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@mpapili](https://deeptalk.lambda.ai/u/mpapili)
#### Post date: [October 14, 2023, 11:44pm UTC](https://deeptalk.lambda.ai/t/script-to-automate-listing-available-instances-and-starting-an-instance/3984/2 "2023-10-14T23:44:47Z")

</div>

It might be overkill but if you enjoy using Terraform to automate your infrastructure I’m using my own custom Lambda GPU Cloud Terraform Provider for these sorts of things. You can specify “any” as an instance type, create/destroy ssh keys, set up default packages and setup tools/scripts.

It’s still messy though. If you want to collaborate or if you just want to try it out, feel free to shoot me a message!

If not, their [API docs](https://cloud.lambdalabs.com/api/v1/docs) are really solid and I’m sure writing a Python wrapper to chime a bell if an instance you might be interested in becomes available would be easy.

---

<div class="post-metadata">

### Author: ![bryangwin](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@bryangwin](https://deeptalk.lambda.ai/u/bryangwin)
#### Post date: [October 16, 2023, 10:00pm UTC](https://deeptalk.lambda.ai/t/script-to-automate-listing-available-instances-and-starting-an-instance/3984/3 "2023-10-16T22:00:40Z")

</div>

Yes typically customers who would like this write a script with our API to snag an open instance when its available. Just remember charges will start once you grab the instance.

Cheers,  
Bryan  
Linux Support Engineer  
Lambda λ
