๐ RUN : Network challenge
info
The provided scripts are incomplete. Replace all <CODE_BLOCK>
with the correct code to complete the lab.
1. Add 'My current IP' temporary into the atlas projectโ
from datetime import datetime, timedelta
# Calculate the date and time 24 hours from now
delete_after = (datetime.utcnow() + timedelta(hours=24)).isoformat() + 'Z'
!atlas accessLists <CODE_BLOCK_5>
tip
Docs : atlas accessList
Answer
from datetime import datetime, timedelta
# Calculate the date and time 24 hours from now
delete_after = (datetime.utcnow() + timedelta(hours=24)).isoformat() + 'Z'
!atlas accessLists create --currentIp --projectId {project_id} --deleteAfter "{delete_after}"
2. Check that 'My current IP' was added:โ
!atlas accessLists list --output json --projectId {project_id}
Next Stepsโ
Start the chapter on Authentication for database user management.