Below 3 things to be setup on the VM for which the metadata is to be queried:
- Git
- Google Cloud SDK
- Python 3.x
- A google cloud account
- Running Instance
This repository contains 2 files:
- get_metadata.sh -> Contains code to fetch full instance metadata in instancemetadata.json file dynamically.
- metadayaquery.py -> Contains code to fetch specific data keys from the instancemetadata.json invoked by get_metadata.sh
- Login into the compute engine
- Clone this repository
- cd challenge2
- ./get_metadata.sh and enter the values prompted for.