Skip to content

Git

Progress checklist

Git is used to clone the Terraform infrastructure repo used by this walkthrough. Install it, set your identity, and clone the infra repo before running any Terraform from the repo.

  1. Install Git. Required

    macOS ships with a system Git, but Homebrew’s version is kept up to date:

    Terminal window
    brew install git

    Verify:

    Terminal window
    git --version
  2. Configure your identity.

    Git requires a name and email for commits. This matters if you push any changes later (for example to your own fork of the Terraform repo).

    Terminal window
    git config --global user.name "Your Name"
    git config --global user.email "you@example.com"

    Confirm the settings:

    Terminal window
    git config --global --list
  3. Clone the Terraform infrastructure repo. Required

    The Terraform code for this walkthrough lives in a separate repository. Clone it into your workspace directory.

    Terminal window
    cd ~/workspace
    git clone https://github.com/jajera/terraform-aws-lambda-managed-instance.git
    cd terraform-aws-lambda-managed-instance

    Confirm the clone worked:

    Terminal window
    ls

    You should see README.md, modules/, examples/waf-loki/, and other Terraform files as described in that repository.

  4. Optional: use SSH instead of HTTPS.

    If you have an SSH key configured with GitHub, use SSH to avoid entering your credentials on every git pull:

    Terminal window
    git clone git@github.com:jajera/terraform-aws-lambda-managed-instance.git

    To set up an SSH key: GitHub docs - generating a new SSH key.

  5. Verify the remote.

    Terminal window
    git remote -v

    Expected output:

    origin https://github.com/jajera/terraform-aws-lambda-managed-instance.git (fetch)
    origin https://github.com/jajera/terraform-aws-lambda-managed-instance.git (push)

Continue to What else for region, cost, and Terraform state considerations before starting infrastructure.