-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EMPv2 SDK Harvest Job issue #6635
Comments
Hi @kannansamynathan - thanks for reaching out. I'm not sure if the code you share is incomplete as it's not showing where you call import {
MediaPackageV2Client,
CreateHarvestJobCommand,
CreateHarvestJobCommandOutput,
GetHarvestJobCommand,
GetHarvestJobCommandOutput,
} from '@aws-sdk/client-mediapackagev2';
const mediapackageClient = new MediaPackageV2Client({ region: process.env.REGION });
const input = {
ChannelGroupName: channelGroupName,
ChannelName: channelName,
OriginEndpointName: originEndpointName,
Description: description,
HarvestedManifests: {
HlsManifests: [
{
ManifestName: manifestName,
},
],
},
ScheduleConfiguration: {
StartTime: new Date(Number(start) * 1000),
EndTime: new Date(Number(end) * 1000),
},
Destination: {
S3Destination: {
BucketName: bucket,
DestinationPath: manifest,
},
},
ClientToken: UUID,
HarvestJobName: UUID,
};
const createHarvestJobCommand = new CreateHarvestJobCommand(input);
const createHarvestResponse: CreateHarvestJobCommandOutput =
await mediapackageClient.send(createHarvestJobCommand);
// After creating the harvest job, you can retrieve its details using GetHarvestJobCommand
const getHarvestJobInput = {
ChannelGroupName: channelGroupName,
ChannelName: channelName,
OriginEndpointName: originEndpointName,
HarvestJobName: createHarvestResponse.HarvestJob.HarvestJobName,
};
const getHarvestJobCommand = new GetHarvestJobCommand(getHarvestJobInput);
const getHarvestJobResponse: GetHarvestJobCommandOutput = await mediapackageClient.send(getHarvestJobCommand); Hope it helps! |
Thanks John. I have used the exact same code - the issue I am facing is, when I try this code in my local connecting to AWS its working as expected - it is generating the harvest job and I was able to get the status as well. But when I deploy (via git pipeline) the same code to the lambda, then I am getting the error 'te.GetHarvestJobCommand is not a constructor'. (I tried disable minify as well - but getting the same error) |
Depending on how you deploy your code, the process may remove the AWS SDK packages to use the Lambda-provided copy. For example, the AWS CDK may do this (configurable). In such cases, the version on Lambda is older than the latest version and may not have as many operations implemented. |
Thanks Kuhe, It worked finally using the lamda layer and I was able to create the objects in the S3. But now I am facing a different issue say, how to set the owner of the *.m3u8 objects in the S3? In the previous version of EMP Params we had an optoin to set the rolearn in the S3Destination as shown below const params = {
EndTime: end,
Id: UUID,
OriginEndpointId: channel,
S3Destination: {
BucketName: bucket,
ManifestKey: manifest,
RoleArn: arn,
},
StartTime: start,
};
mediapackage.createHarvestJob(params, function (err, data) {
if (err) {...}...}` But in the latest version I dont have that option to set in the S3Destination as shown below. const input = {
ChannelGroupName: channelGroupName,
ChannelName: channelName,
OriginEndpointName: originEndpointName,
Description: description,
HarvestedManifests: {
HlsManifests: [
{
ManifestName: manifestName,
},
],
},
ScheduleConfiguration: {
StartTime: new Date(Number(start) * 1000),
EndTime: new Date(Number(end) * 1000),
},
Destination: {
S3Destination: {
BucketName: bucket,
DestinationPath: manifest,
},
},
ClientToken: UUID,
HarvestJobName: UUID,
}; As a result I am seeing weird S3 Object (*.m3u8) owner names - and when I try to read these objects in other lambdas getting access denied. Any view/recommendation please share. |
Describe the bug
I am using the below package to create the harvest job. But facing error when executing the code from the lambda (Runtime: Node.js 20.x).
Package: @aws-sdk/client-mediapackagev2
version: "3.682.0"
Error: GetHarvestJobCommand is not a constructor
Typescript code snippet used.
Regression Issue
Expected Behavior
It should create harves job in EMPV2
Current Behavior
Throwing error 'GetHarvestJobCommand is not a constructor' , when using the Package: @aws-sdk/client-mediapackagev2
version: "3.682.0"
Reproduction Steps
Create the above code snippet in typescript and deploy that to a lambda with runtime Node.js 20.x - it will throw the error
Possible Solution
No response
Additional Information/Context
No response
SDK version used
3.682.0
Environment details (OS name and version, etc.)
Lambda: Runtime Node.js 20.x, Architecture x86_64
The text was updated successfully, but these errors were encountered: