Skip to content

Terraform

Progress checklist

All infrastructure in this walkthrough - VPC, subnets, CAPACITY-PROVIDER
Lambda Capacity Provider — an EC2-backed compute resource pool (subnets, security groups, operator role) that Lambda Managed Instances functions run on instead of shared Lambda infrastructure.
, LAMBDA
AWS Lambda — a serverless compute service that runs code in response to events without provisioning servers.
functions, IAM
Identity and Access Management — the AWS service that controls permissions and roles for all resources.
roles - is created and destroyed with Terraform
Terraform — the infrastructure-as-code tool used to create and manage all AWS resources in this walkthrough.
. Nothing is created manually in the console (except one-off checks). Using Terraform means:

  • Every change is reviewed before it is applied
  • The full environment can be torn down with one command (terraform destroy)
  • State tracks what has been created so incremental updates are safe

This site expects the HashiCorp AWS provider ~> 6.0 so resources such as aws_lambda_capacity_provider and capacity_provider_config on aws_lambda_function are available. The Terraform code lives in a separate repository (terraform-aws-lambda-managed-instance). You will clone it in the Git step.

  1. Install Terraform. Required

    Use Terraform 1.5 or later. The walkthrough uses features from 1.5+.

    Install via Homebrew (HashiCorp tap)
    brew tap hashicorp/tap
    brew install hashicorp/tap/terraform

    To upgrade later:

    Terminal window
    brew upgrade hashicorp/tap/terraform
  2. Verify the installation.

    Terminal window
    terraform version

    Expected output:

    Terraform v1.x.x
    on linux_amd64

    The version must be 1.5 or higher. If you have an older version installed via a different method, uninstall it first.

  3. Create a workspace directory.

    Create a dedicated directory where you will clone and run Terraform. This keeps the walkthrough files separate from other projects.

    Terminal window
    mkdir -p ~/workspace
    cd ~/workspace

    You will clone the Terraform repo into this directory in the Git step.

  4. Understand the state setup.

Continue to Git to install Git, set your identity, and clone the Terraform repo.