[CloudWatch Evidently with client-side evaluation - powered by AWS AppConfig] can't be used at lambda(nodejs18@ aws sdk V3)

0

Hello,

Sorry to trouble you.

I would like to use the solution [CloudWatch Evidently with client-side evaluation - powered by AWS AppConfig] , [https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Evidently-client-side-evaluation.html]

In order for Lambda to access AWS AppConfig Lambda extension ,The endpoint parameter of EvidentlyClient must be set to 'http://localhost:2772'. The AWS SDK V2 can be like below.

const AWS = require('aws-sdk');
const evidently = new AWS.Evidently({
    region: "us-west-2",
    endpoint: "http://localhost:2772",
    hostPrefixEnabled: false
});

but for AWS SDK V3,there seems no way to cofigure the endpoint for EvidentlyClient. I have tried like below,But I got the "Error: getaddrinfo ENOTFOUND dataplane.localhost at GetAddrInfoReqWrap.onlookup" error.

// Import the Evidently client from AWS SDK v3
import { EvidentlyClient, EvaluateFeatureCommand } from "@aws-sdk/client-evidently";

// Initialize the Evidently client
const evidentlyClient = new EvidentlyClient({
    region: "ap-northeast-1",
    endpoint:"http://localhost:2772"
});

So could you give some advise for how to use [CloudWatch Evidently with client-side evaluation - powered by AWS AppConfig] at lambda(nodejs18@ aws sdk V3)

Thanks and best regards, Lin@Panasonic

Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen