[ SRE_ARENA ]
FUNCTIONS & SCOPE

Functions & Scope: Reusable Infrastructure

System Architecture Visualization
DOWNLOADING CONCEPT: DEFINING FUNCTIONS...
  • ↳Use the def keyword to define a function.
  • ↳Functions keep your automation scripts modular and testable.
python
def get_instance_ip(instance_id):
    # logic here
    return ip_address
▲ LIVE INCIDENTA script expects a modified global variable but sees the old one.
sre@arena:~/python-functions
sre@arena:~$ python3 config_loader.py