For the complete documentation index, see llms.txt. This page is also available as Markdown.

Lambda infrastructure

Create Harness environments and AWS Lambda infrastructure definitions to target your AWS account and region for deployment.

An infrastructure definition links a Harness environment to the AWS account and region where Harness deploys your Lambda function. You create both at Deployments > Environments and reuse them across pipelines and stages.


What you will learn

  • How to create a Harness environment for Lambda deployments.

  • How to configure an infrastructure definition with an AWS connector and region.

  • How Lambda step execution and infrastructure definitions relate to each other.


Before you begin

  • AWS connector: A connector configured with an IAM role that has the permissions listed in AWS IAM permissions. Go to Project Settings > Connectors to add one.


Create an environment

  1. Go to Deployments, expand the drop-down, and select Environments.

  2. Select + New Environment.

  3. Enter a name and select an environment type: Pre-Production or Production. The type affects governance policies and deployment dashboards.

  4. Select Save.

Harness opens the environment detail page with two tabs: Configuration and Infrastructure Definitions.


Create an infrastructure definition

Infrastructure definitions live inside an environment. Each definition links the environment to a specific AWS account and region.

  1. Open the environment and select the Infrastructure Definitions tab.

  2. Select + Create Infrastructure.

  3. In the dialog, select AWS Lambda as the deployment target.

  4. Enter a name; Harness auto-suggests one, and you can change both the name and ID.

  5. Under Storage, choose Inline or a Git repository.

  6. Fill in the Amazon Web Services details as described below.

  7. Select Save.

Amazon Web Services details

Field
Required
Description

Connector

Yes

A Harness AWS connector. Harness uses this to authenticate to AWS and deploy the Lambda function. The connector must have the IAM permissions listed in AWS IAM permissions.

Region

Yes

The AWS region where the Lambda function is deployed, for example us-east-1 or us-west-1.

Additional settings

Setting
Default
Description

Simultaneous deployments

False

By default, Harness queues deployments to the same infrastructure to avoid conflicts. Enable this to allow multiple deployments to run concurrently against the same infrastructure definition.

Scope to Specific Services

False

Restrict this infrastructure definition so it can only be used by the services you specify. Useful for enforcing separation of concerns across teams.


Infrastructure expressions

Lambda deployment steps resolve their AWS connection details automatically from the infrastructure definition at runtime. Use these expressions when you need to reference infrastructure values in custom steps or pipeline expressions.

Value
CEL expression
JEXL expression

AWS connector reference

${{infra.connectorRef}}

<+infra.connectorRef>

AWS region

${{infra.region}}

<+infra.region>

These expressions are pre-populated in the built-in Lambda step templates (Rolling Deploy, Canary Deploy, Traffic Shift, and rollback steps). You only need them when wiring custom steps or adding expressions to approval messages.


Stage runtime

The AWS Lambda infrastructure definition specifies where Harness deploys your function (AWS account and region). Separately, the stage Runtime Environment setting specifies where the Lambda step containers execute. These are two distinct configurations.

Harness supports three runtime options for step execution:

Runtime
Description

Harness Cloud

Steps run on Harness-hosted infrastructure. No delegate or cluster setup required.

Delegate

Steps run on any available installed delegate. Harness selects one automatically, or you can inherit from a delegate installed in your environment.

Kubernetes

Steps run as containers on a Kubernetes cluster you specify. Requires a Kubernetes connector and a namespace.

Example — Kubernetes runtime block in the stage YAML:

The Kubernetes connector in the runtime block targets the cluster that runs step containers. The AWS connector in the infrastructure definition targets Lambda in your AWS account. They serve different roles and are configured independently.


Next steps

  • Go to Lambda services to configure function definitions and artifact sources.

  • Go to Overview to review deployment strategy options.

Last updated

Was this helpful?