Setup Github Codespace for Deployment

alt text

Step-by-Step Guide to Set Up GitHub Codespace from Browser

  • Log in to GitHub

  • Fork the Repository

    alt text

    Disclaimer: The labs and repository used in this setup may vary depending on the session. Different environments and configurations are used for various sessions. Always ensure you're working with the correct repository and instructions for your specific session..

    • In the top-right corner, click the Fork button to create a copy of the repository in your GitHub account.

    alt text

  • Open the Forked Repository in Codespace

    • Go to your forked version of the repository in your GitHub account.

    alt text

    • Click the Code button, then select the Codespaces tab.

    • Choose New Codespace or Create Codespace on main (or any branch you're working on).

    alt text

  • Wait for Initialization

    • The Codespace will initialize, setting up a virtual development environment.

    alt text

    • Once ready, you will be directed to a VSCode-like environment where you can develop and test your project.

    alt text

  • Configure Your Environment

    • Ensure all necessary dependencies for the project are installed by following the repository’s setup instructions.
    • Follow Post Codespace Setup: Terminal Commands mentioned below.
      • Once the Codespace setup is complete, perform the following steps from the terminal:

        1. Navigate to the project directory
          Run the command:
        ls
        cd eks/
        

        alt text

        1. Make the pre-deployment script executable
          Use the following command:
        chmod +x pre-deploy.sh
        

        alt text

        1. Run the pre-deployment script
          Execute the pre-deployment script to prepare the environment:
        source pre-deploy.sh
        

        alt text

        These steps will help you prepare the environment and deploy your project as part of the lab setup. This will take upto 10 minutes.

Patience is virtue !

  • Setup AWS Credentials

    • Copy the credentials from AWS Console.

    In case there is a csv fro credentials which was downloaded, copy the credentials from the csv. This credentials file must be securely stored.

    • Use the terminal in Codespace to setup aws cli.
    aws configure
    

    alt text

    Enter the access key, secret key, region & output format.

    • Validate the credentials via aws sts get-caller-identity.
    aws sts get-caller-identity
    

    alt text

Refer to this video for detailed walkthrough


  • Next step is to deploy the vulnerable scenario for the learning, proceed to next lesson.