This code runs serverless and gathers all logs from all instances registered to your portal and archives them to AWS S3. This is meant as a proof-of-concept/inspiration.
To run in GitHub Actions
- Click
Use this template
->Create a new repository
(note, using a public repo allows you to use Actions for free as of this writing) - In your new repository, configure secrets for:
- AWS: (for s3 access)
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_S3_BUCKET
(else it will default todevsummit-logging-archive
)- Ensure the bucket above is created in your account and the Access Key has write access
AWS_S3_LOG_FILENAME
(else it will default tologs-<timestamp>.json
)
- ArcGIS:
ARCGIS_PORTAL_URL
(the full url to the Portal web adaptor, e.g.https://arcgis.myenterprise.net/portal
)ARCGIS_PORTAL_ADMIN
(Admin username with read access to logs)ARCGIS_PORTAL_ADMIN_PASSWORD
(Password for above account)
- Run the Action from
main
to test - Configure cron or other triggers. See GitHub Actions documentation.
- 🎉