DevOps Coding Challenge (Allot at least 2 hours)
- Clone the read-only bucket https://s3-us-west-2.amazonaws.com/bbc-devops-challenge/, and its contents into your personal s3 account. Read through each JSON file located on this your copy of this bucket. If the key "bump_waste_threshold" is not present in any
.jsonfiles, add this key with a default value of '.23' and replace the old file.
Generate a web application in a framework of your choice that does the following:
- Connects to the s3 bucket cloned above, and stores a text representation of the subdirectories of the bucket in Redis (or a similar key-value store). This text representation should match the output format of the unix command
tree. Additionally, store the
jsonfiles as the values with keys given by their paths from the root of this bucket.
- Serves the plain text of the directory tree from the root path of the application.
- All non-root paths must return a sample of poetry(anything you like) in plain text.
- Monitor for new JSON file uploads to the s3 bucket, update the data store. SNS/SQS are strongly encouraged. The changes should be visable no more than 10 minutes after the file is uploaded.
- Dockerize the application ensuring that the state is maintained between restarts (Note that Redis must be set up in its own, standalone container).
- Deploy your microservice to EC2 (you can use their free-tier resources) as part of an ECS cluster.
- Make the application publicly accessible.
- In the README of your application, describe how you would automate deployment with this infrastructure.
- Use a Terraform to set up the server
- Use a configuration management tool (such as Puppet, Chef or Ansible) to bootstrap the server
- Put the server behind a load balancer
- Log the values of the newly added JSON files to an RDS with the following columns:
- json name (relative path from top bucket)
- updated at