Module utils

Source
Expand description

Utility functions for interacting with EC2 instances

Constants§

DEPLOYER_MAX_PORT
Maximum port for deployer ingress
DEPLOYER_MIN_PORT
Minimum port for deployer ingress
DEPLOYER_PROTOCOL
Protocol for deployer ingress
MAX_POLL_ATTEMPTS
Maximum number of polling attempts for service status
MAX_SSH_ATTEMPTS
Maximum number of SSH connection attempts before failing
RETRY_INTERVAL
Interval between retries

Functions§

enable_bbr
Enables BBR on a remote instance by copying and applying sysctl settings.
exact_cidr
Converts an IP address to a CIDR block
get_public_ip
Fetch the current machine’s public IPv4 address
poll_service_active
Polls the status of a systemd service on a remote instance until active
poll_service_inactive
Polls the status of a systemd service on a remote instance until it becomes inactive
rsync_file
Copies a local file to a remote instance via rsync with retries
ssh_execute
Executes a command on a remote instance via SSH with retries