[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

linlin
已提問 1 個月前檢視次數 88 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南