Challenge2 EC2-Metadata And Get-data-Value from key Challenge3 Get-Value from nested objects
Get the metadata of ec2 instance within AWS and provide a json formatted output. A function in which pass the object and a key and get back the value
- Create an EC2 Linux instance on AWS
- SSH into the instance
- Install Python 3 and git on your instance
sudo yum install python3 git
- Clone this repository
- Install pipenv
sudo pip3 install pipenv
- Open the repository on your instance
cd aws-metadata-json
- Install project dependancies
pipenv install
- Open the
src
foldercd aws-metadata-json/src
- python3 get_ec2_metadata.py
- python3 get_data_key.py
- python3 get_value.py `
- It makes use of the http://169.254.169.254/latest/meta-data link-local address. Instance metatada is provided at this link, but only when you visit it from a running instance.
- A few simple Python scripts are used to extract the required information using the above API.
- See AWS user guide for more info on the instance metadata API.