...
This commit is contained in:
parent
d056ecfbea
commit
c33ad9eaf7
9 changed files with 89 additions and 36 deletions
|
|
@ -28,4 +28,24 @@ wget https://www.zauberturm.de/downloads/
|
|||
sudo chown -R awa-admin:awa-admin /opt/awa
|
||||
|
||||
sudo yum install p7zip
|
||||
```
|
||||
|
||||
|
||||
GetAwaServerIp
|
||||
```
|
||||
GET https://7l7x7zpr7ybfjrugwg5hybrd7i0ptqmc.lambda-url.eu-central-1.on.aws/
|
||||
```
|
||||
|
||||
GetAwaUptime
|
||||
```
|
||||
GET https://5f7rkcljorwmzo4mnsjpl5bdde0frkcb.lambda-url.eu-central-1.on.aws/
|
||||
```
|
||||
StartAwaServer
|
||||
```
|
||||
GET https://xqip7wowsd6shind4q3t6hqafa0axudp.lambda-url.eu-central-1.on.aws/
|
||||
```
|
||||
|
||||
StopAWAServer
|
||||
```
|
||||
GET https://5ps72qu3uclwnawce5cziv7a6a0niulv.lambda-url.eu-central-1.on.aws/
|
||||
```
|
||||
43
MyObsidianVault/AWA/01_AWS Access/Lambda functions.md
Normal file
43
MyObsidianVault/AWA/01_AWS Access/Lambda functions.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import boto3
|
||||
import time
|
||||
import datetime
|
||||
|
||||
#ec2 = boto3.resource('ec2')
|
||||
ec2 = boto3.client('ec2')
|
||||
|
||||
awa_server_instance_id = "i-0de7cce6fcdf8c0e6"
|
||||
|
||||
def lambda_handler(event, context):
|
||||
#return "1.2.3.4"
|
||||
|
||||
#filters = [
|
||||
# {
|
||||
# 'Name': 'instance-state-name',
|
||||
# 'Values': ['running']
|
||||
# }
|
||||
#]
|
||||
#
|
||||
#instances = ec2.instances.filter(Filters=filters)
|
||||
#
|
||||
#for instance in instances:
|
||||
# print(instance)
|
||||
|
||||
|
||||
response = ec2.describe_instances()
|
||||
|
||||
for reservation in response['Reservations']:
|
||||
for instance in reservation['Instances']:
|
||||
instance_id = instance.get('InstanceId', 'NONE')
|
||||
ip = instance.get('PublicIpAddress', '127.0.0.1')
|
||||
|
||||
if instance_id == awa_server_instance_id:
|
||||
#return {
|
||||
# 'statusCode': 200,
|
||||
# 'ip': ip
|
||||
#}
|
||||
return ip
|
||||
#return {
|
||||
# 'statusCode': 200,
|
||||
# 'ip': "127.0.0.1"
|
||||
#}
|
||||
return "127.0.0.1"
|
||||
|
|
@ -0,0 +1 @@
|
|||
https://youtu.be/PDISK_JPPQE?si=3bIk5oyDBX9YDw6q
|
||||
|
|
@ -0,0 +1 @@
|
|||
https://youtu.be/R4xN4DTNDU4?si=EzYM1MMawKnQVq6B
|
||||
Loading…
Add table
Add a link
Reference in a new issue