Skip to main content

Phase 2: Programming

Author: GPS

How does this phase apply to Cloud?

Programming is a fundamental skill for cloud engineering, enabling you to create, manage, and optimize cloud resources efficiently.

You don't need to know how to build UIs but you need to know how to work with APIs and other cloud services like storage, databases, etc. Knowing how to program will make you more competitive in the hiring market. Additionally, understanding prompt engineering with tools like GitHub Copilot can enhance your coding productivity and capabilities.

In the previous step you were introduced to programming basics and wrote your first Bash script. You can now leverage this knowledge and apply it to your choice of programming language.

How to break down this phase

There are several programming languages that are popular with Cloud: Python, Go, Rust, .NET, JavaScript. If you know any of these, you can continue using them, if not, I would go with Python. It's a very popular language and there are many quality free resources out there to learn it.

Continue adding your projects to your GitHub profile that you created in the past phase.

I would suggest spending time on these two topics and this timeline:

OrderTopic
1Learn to Code
2Learn Prompt Engineering

Resources

OrderTitleNotes
1Python Crash CourseA great Python book, also there is an Appendix in there on Git which is great!
1Python for BeginnersA 44 part video series introducing you to Python
17 Days of PythonA 7 day guide to Python
2A Beginner's Guide to Prompt Engineering with GitHub CopilotAn article by Rizèl Scarlett on how to get the most out of GitHub Copilot.

Capstone Project: Serverless Movies API.

Create an API with serverless functions that display movie information. Don't forget to create a GitHub repo and document in your README.md

Capstone Steps

  1. Create Your Cloud Infrastructure:

    • Use an SDK to set up your cloud infrastructure.
    • You will need a NoSQL database, cloud storage, and serverless functions.
    • Depending on the cloud provider (AWS, Azure, Google Cloud), additional setup steps may be required.
  2. Prepare Your Data:

    • Find movie data or create it and store it in your cloud NoSQL db.
    • Store movie cover images of each movie in cloud storage.
  3. Create Serverless Functions:

    1. GetMovies: Returns a JSON list of all movies in your database. Ensure the response includes a URL for the movie cover.
    2. GetMoviesByYear: Returns a list of movies released in a specified year. The year is provided by the client.
    3. EXTRA CREDIT - GetMovieSummary: Returns a summary generated by AI for a specified movie.

Example Data Model

Your movie data model could look like:

{
"title":"title of the movie",
"releaseYear":"when the movie was released",
"genre":"genre of the movie",
"coverUrl":"url-to-image-in-cloud-storage"
}

Example API Endpoints

  • GetMovies yourapi.com/getmovies
[
{
"title": "Inception",
"releaseYear": "2010",
"genre": "Science Fiction, Action",
"coverUrl": "https://example.com/inception.jpg"
},
{
"title": "The Shawshank Redemption",
"releaseYear": "1994",
"genre": "Drama, Crime",
"coverUrl": "https://example.com/shawshank-redemption.jpg"
},
{
"title": "The Dark Knight",
"releaseYear": "2008",
"genre": "Action, Crime, Drama",
"coverUrl": "https://example.com/dark-knight.jpg"
}
]
  • GetMoviesByYear yourapi.com/getmoviesbyyear/2010
[
{
"title": "Inception",
"releaseYear": "2010",
"genre": "Science Fiction, Action",
"coverUrl": "https://example.com/inception.jpg"
}
]
  • GetMovieSummary yourapi.com/getmoviesummary/inception
{
"title": "Inception",
"releaseYear": "2010",
"genre": "Science Fiction, Action",
"coverUrl": "https://example.com/inception.jpg",
"generatedSummary": "A mind-bending sci-fi thriller about dream theft and manipulation."
}

Things you should be familiar with at the end of this phase

Programming

  • Variables: Understand how to declare and use variables.
  • Data Types: Familiarize yourself with different data types (e.g., strings, integers, lists, dictionaries).
  • Comments: Learn to write comments to document your code.
  • Functions: Learn to define and call functions.
  • Object-Oriented Programming (OOP): Understand the basics of OOP (classes, objects, inheritance).
  • Lists: Learn how to create and manipulate lists.
  • Modules: Understand how to use and import modules.
  • Dictionaries: Learn to use dictionaries for key-value data storage.
  • Loops: Master loops (for, while) to iterate over data.
  • Control Statements: Understand conditional statements (if, else, elif).
  • Exceptions: Learn to handle exceptions and errors in your code.

Git

  • Create a Git Repo Locally: Initialize a repository and add files.
  • Create a GitHub Repo and Clone It Locally: Understand the process of creating a remote repository and cloning it.
  • Create a Git Branch: Learn to work with branches.
  • Add Changes to a Git Branch: Stage and commit changes.
  • Merge Git Changes: Merge changes from different branches.
  • Document Code with a README: Write clear and informative README files.