0

I am deploying a Next.js website to AWS via the SST v2 framework. I want to monitor it via DataDog. Below are the contents of my sst.config.ts file. I am not getting any errors during the deployment but nothing happens either. The website gets deployed,but the DataDog Lambda layer does not get created and attached to the Lambda function.

import { SSTConfig } from "sst";
import { NextjsSite } from "sst/constructs";
import { DatadogLambda } from "datadog-cdk-constructs-v2";

export default {
  config(_input) {
    return {
      name: "sst-test",
      region: "us-east-1",
    };
  },
  stacks(app) {
    app.stack(function Site({ stack }) {
      const datadog = new DatadogLambda(stack, "DatadogLambda", {
        nodeLayerVersion: 121,
        extensionLayerVersion: 77,
        site: "datadoghq.com",
        apiKeySecretArn: "<DATADOG_API_KEY_SECRET_ARN>" 
      });
      const site = new NextjsSite(stack, "site",{
        runtime: "nodejs20.x",
      });
      datadog.addLambdaFunctions(stack.getAllFunctions());
      stack.addOutputs({
        SiteUrl: site.url,
      });
    });
  },
} satisfies SSTConfig;

After checking the logs, it seems SST ignores the DataDog section of the config.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.