A Python reimplementation of the Greengrass v2 setup and removal workflow. It mirrors the behaviour of the original shell scripts with additional configuration structure and richer logging.
config.example.yaml– sample configuration file; copy toconfig.yamland update to match your environment.requirements.txt– Python dependencies (currently onlyPyYAML).setup.py– CLI entry point for installing Greengrass.remove.py– CLI entry point for uninstalling Greengrass.common/– reusable package with configuration parsing, download helpers, and installer orchestration.legacy/– Contains legacy setup and remove shell files from this entire orchestration is derived from.
-
Create a virtual environment and install dependencies:
cd aws-greengrass-setup/python-refactor python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt
-
Copy the example configuration and edit it:
cp config.example.yaml config.yaml $EDITOR config.yamlProvide either local artifact paths or download URLs for the installer and connection kit, and verify the target directories.
-
Install Greengrass:
python setup.py --config config.yaml --log-level INFO
-
Remove Greengrass:
python remove.py --config config.yaml
- Supports YAML or JSON configuration files.
- Downloads artifacts (or reuses local copies) with progress logging.
- Optionally installs Java when missing.
- Cleans up the workspace automatically unless
auto_cleanupis disabled. - Mirrors the uninstall steps from the shell version, including service removal and optional user/group cleanup.
- The installer commands rely on
sudo; ensure the executing user has appropriate privileges. - Only basic error handling is provided for network operations—consider wrapping network retries for production usage.
- Extend the package as needed (e.g., checksum validation, AWS SDK integration for presigned connection kits).