Skip to content

modified Name Field and reduced sleep time #11

Merged
merged 1 commit into from
Feb 17, 2022
Merged

Conversation

cho00013
Copy link
Contributor

4 major changes on the code.

  1. Name field logic to handle multiple cases (Name has fqdn, Name only hostname + zone name, Name only hostname + vpc dhcp dns zone name). See the top of the script for more info.
  2. Changed the sleep time to perform some instance lookup and while look until max sleep if instance doesn't return values.
  3. Added is_valid_zone function to re-use.
  4. Added additional "sleep" timer to reduce Route 53 API limit (5 per sec). I also reduced the amount of API's which were duplicate. Also, added random 10 or 20 seconds sleep timer to reduce the probability of API limit.

Route 53 SDK will auto-retry up to 5 times, however, by adding random up to 10 seconds (running) or up to 20 seconds (terminate/stop) will spread out the calls if multiple instances are launched OR terminated/stopped. Testing performed up to 30 instance started/stopped.

@@ -45,6 +52,7 @@ zone with the value that points to the hostname+zonename created above.
Finally, it will clean up the DynamoDB entry if the instance is shutting down.
"""
import json
from lib2to3.pgen2.pgen import DFAState
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this? I don't see DFAState anywhere within the code changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@badra001 - strange I did see that, and I thought I removed. Not sure how it got there, but it can come out.

Copy link
Contributor

@badra001 badra001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@badra001 badra001 merged commit 92cf142 into master Feb 17, 2022
@badra001 badra001 deleted the awspeter_v0.0.11 branch February 17, 2022 19:50
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants