Trouble with Custom Module in Lambda PowerShell

0

Hi - I've been successful with basic PS1 uploads to Lambda, but when I try and include a module with it, I'm getting errors when executing it. Here is what I see in CloudWatch:

2021-03-26T19:57:31.871-04:00 LOGS Name: cloudwatch_lambda_agent State: Subscribed Types: [platform]
2021-03-26T19:57:34.429-04:00 Importing module ./Modules/AWS.Tools.Common/4.1.10.0/AWS.Tools.Common.psd1
2021-03-26T19:57:34.429-04:00 Importing module ./Modules/MyModuleName/0.1/MyModuleName.psd1
2021-03-26T19:57:34.429-04:00

[Error] - Could not find a part of the path '/var/runtime/ref'.
[Error] - Could not find a part of the path '/var/runtime/ref'.

I've deleted and rebuilt, and I've confirmed the PSM1 and PSD1 are in the ZIP in my staging folder, but beyond that I'm not sure where to go with this error messages and would appreciate any help anyone has.

Thanks,
Chris

질문됨 3년 전294회 조회
1개 답변
0

Through process of elimination, I found the issue was with an Add-Type that created an ENUM. This doesn't appear to work when running in Lambda. Sample code:

Add-Type -TypeDefinition @"
public enum MySeasons
{
Spring,
Summer,
Autumn,
Winter
}
"@

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠