Skip to content

Commit

Permalink
Remove other ips after attach static ip to instance
Browse files Browse the repository at this point in the history
  • Loading branch information
coolbeevip committed Nov 7, 2023
1 parent 0cd9007 commit 5861f00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def job_wrapper():


if __name__ == '__main__':
schedule.every(1).minutes.do(job_wrapper)
schedule.every(5).minutes.do(job_wrapper)

while True:
schedule.run_pending()
Expand Down
3 changes: 2 additions & 1 deletion src/aws_lightsail_guard/guard.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
from datetime import datetime

from aws_lightsail_guard.lightsail import lightsail, lightsail_domain
Expand Down Expand Up @@ -46,7 +47,7 @@ def lightsail_instance_public_ip_keepalive(self, name):
get_domains_response = lightsail_domain.get_domains()
for domain in get_domains_response['domains']:
for domainEntry in domain['domainEntries']:
if domainEntry['target'] == 't5.coolbeevip.com':
if domainEntry['name'] == os.environ['DOMAIN_ENTRY_NAME']:
lightsail_domain.update_domain_entry(
domainName=domain['name'],
domainEntry={
Expand Down

0 comments on commit 5861f00

Please sign in to comment.