Sky Archive

자격증/AWS Developer Associate

[AWS] Certified Developer Associate Dump 문제 017

Anchovy ʕ-᷅ᴥ-᷄ʔ 2021. 8. 11. 21:38

A Developer has created a large Lambda function, and deployment is failing with the following error:
ClientError: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: Unzipped size must be smaller than XXXXXXXXX bytesג€™, where XXXXXXXXX is the current Lambda limit
What can the Developer do to fix this problem?


A. Submit a limit increase request to AWS Support to increase the function to the size needed.
B. Use a compression algorithm that is more efficient than ZIP.
C. Break the function into multiple smaller Lambda functions.
D. ZIP the ZIP file twice to compress it further.


개발자가 대규모 람다 함수를 생성했으며 배포가 실패하고 다음 오류가 발생함:
ClientError: CreateFunction 작업을 호출할 때 오류 발생(InvalidParameterValueException): 압축되지 않은 크기는 XXXXXXXXX바이트보다 작아야 하며 여기서 XXXXXXXXXXX는 현재 람다 제한임


개발자가 이 문제를 해결하기 위해 할 수 있는 일은 무엇인가?


A. 기능을 필요한 크기로 늘리려면 AWS Support에 제한 증가 요청을 제출하십시오.
B. ZIP보다 효율적인 압축 알고리즘을 사용하십시오.
C. 함수를 여러 개의 작은 람다 함수로 나누십시오.
D. ZIP 파일을 더 압축하려면 ZIP 파일을 두 번 압축하십시오.


정답↓

더보기

C

몇 가지 간단한 방법.
1. Lambda가 Node.js에 있는 경우, 서버 없는 웹 팩을 사용하면 크기를 상당히 줄일 수 있다.
2. 개별적으로: True 플래그를 사용하여 람다 함수를 개별적으로 패키지한다.
3. 패키지의 일부로 큰 이진 파일, 이미지 또는 파일이 있는 경우 S3에 저장한 후 런타임을 다운로드하십시오.
여기서 중요한 점은 압축되지 않은 상태일 때 코드와 그 종속성이 250MB 크기 제한 내에 있어야 한다는 것. 더 큰 패키지 크기를 고려하더라도 람다 함수의 콜드 스타트 시간에 심각한 영향을 미칠 수 있다. 따라서 람다 함수는 더 큰 패키지 크기로 실행하는 데 더 오랜 시간이 걸린다.

 

1. If your Lambda is in Node.js; using serverless-webpack can significantly reduce the size.

2. Package the Lambda functions individually using the individually: true flag.

3. If you have large binaries, images, or files as a part of the package; store them on S3 and download them runtime.

The important thing to notice here is that your code and its dependencies should be within 250 MB size limit when in uncompressed state.