Lambda demo functions for Server Stop/Start/Status
This commit is contained in:
parent
3436132866
commit
8f62d9bf83
5 changed files with 106 additions and 1 deletions
|
|
@ -0,0 +1,13 @@
|
|||
```python
|
||||
#StartServer
|
||||
import boto3
|
||||
region = 'eu-central-1'
|
||||
#instances = ['i-0de7cce6fcdf8c0e6']
|
||||
ec2 = boto3.client('ec2', region_name=region)
|
||||
|
||||
def lambda_handler(event, context):
|
||||
ec2.start_instances(InstanceIds=["i-0de7cce6fcdf8c0e6"])
|
||||
return {
|
||||
'message' : 'server started'
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue