# orchard-datadog-lambda-extension

## Overview

This is a wrapper Docker Lambda Extension used for serverless application monitoring. This image is used as a Lambda layer for containerized Lambda Functions.

Configuration guides for
[Python](https://docs.datadoghq.com/serverless/installation/python/?tab=containerimage) and
[NodeJS](https://docs.datadoghq.com/serverless/installation/nodejs/?tab=containerimage) applications.

## Usage

Add the `COPY` line to your Dockerfile to install the extension:

```Dockerfile
FROM amazon/aws-lambda-python:3.8
COPY --from=437795906767.dkr.ecr.us-east-1.amazonaws.com/orchard-datadog-lambda-extension:latest /opt/extensions/ /opt/extensions
```

## Bumping Versions

We use the latest version of the extension, so run
[the pipeline](https://pipeline.theorchard.io/job/orchard-datadog-lambda-extension-docker-to-ecr/) to update it.

## Update Docker image on Dev environment

Create ECR repository:

```bash
aws ecr create-repository --repository-name=orchard-datadog-lambda-extension --image-scanning-configuration scanOnPush=true
```

Build and publish Docker image:

```bash
docker build -t orchard-datadog-lambda-extension:local . \
  && docker tag orchard-datadog-lambda-extension:local 103233932089.dkr.ecr.us-east-1.amazonaws.com/orchard-datadog-lambda-extension:latest \
  && docker push 103233932089.dkr.ecr.us-east-1.amazonaws.com/orchard-datadog-lambda-extension:latest
```
