CUDOS -Optimization Data Collection - Transit gateway Lambda failing with errors

0

Hello, I have deployed the Cost Optimization Data Collection Module. The Transit Gateway Lambda is failing with below erorr -

[ERROR] Runtime.UserCodeSyntaxError: Syntax error in module 'index': invalid syntax (index.py, line 125) Traceback (most recent call last):   File "/var/task/index.py" Line 125                 aws_access_key_id=credentials['AccessKeyId'],

질문됨 일 년 전255회 조회
4개 답변
1

Hello,

This is Tom from AWS Support.

I see that Lambda function throws "UserCodeSyntaxError" while executing. This indicates the function is unable to execute because of unknown/incorrect syntax for current Python file. I would recommend check on line 125 (and the sections around this line) to see if there are any syntax issue with current file.

Alternatively, you may try copying the entire Lambda function code into a local IDE, for instance, Visual Studio Code with Python extension [1], to see if the Python function has any syntax errors.

I hope the above information helps. Have a nice day!

Links and References

[1] https://code.visualstudio.com/docs/languages/python

AWS
지원 엔지니어
Tom_T
답변함 일 년 전
1

Hello,

As stated above, this seems more like a syntax error and thus the function is not able to be executed. It is best to check for any issues with respect to the syntax on or around line 125. And also as rightly said above you can try to check for any syntax related issues by copying the code to the Local IDE with which it will be easier to identify the error and work around resolving the same.

Also there can be possibility of the credentials being configured incorrectly. It looks like there might be an issue with the format of the parameters being passed to the call on the125 line. To resolve the issue, you should check the code on line 125 to ensure that the syntax is correct and that the parameters being passed are properly formatted. [+]https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html

profile pictureAWS
지원 엔지니어
답변함 일 년 전
0

Looks like the the credentials are not configured properly. Please refer https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html and configure your credentials accordingly ?

AWS
Arun
답변함 일 년 전
0

Thank you for your response! I found a missing comma in the code. I added the comma and redeployed the template file and have verified the transit gateway data collection is working now. Enter image description here

Bijal
답변함 일 년 전

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

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

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