increase wait time for DNS cert - #49
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR increases the DNS propagation wait window in the EC2 user-data bootstrap script so production deploys have more time for the domain’s A record to point at the instance before requesting a Let’s Encrypt certificate.
Changes:
- Increase DNS resolution polling loop iterations from 20 to 2880 (with 30s sleeps, up to 24 hours total).
Comments suppressed due to low confidence (1)
infra/user_data.tftpl:109
- The DNS wait loop now allows up to 24h (2880 * 30s) but still proceeds to
certboteven if DNS never resolves to the instance IP. That can cause long/hung deployments and confusing certificate failures. Consider making the timeout explicit, using a resolver available by default (avoiddigdependency), and aborting with a non-zero exit code if the expected IP is not observed within the timeout.
for i in $(seq 1 2880); do
RESOLVED_IP=$(dig +short ${domain_name} | tail -1)
if [ "$RESOLVED_IP" = "$EXPECTED_IP" ]; then
echo "DNS resolved correctly to $EXPECTED_IP"
break
fi
echo "Waiting for DNS... (got $RESOLVED_IP, want $EXPECTED_IP)"
sleep 30
done
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
increasing wait time for prod deploy