A company uses CodePipeline to deploy updates to an API Gateway API and exports a JavaScript SDK from the console, uploading it to S3 behind a CloudFront distribution. The SDK should be updated automatically whenever a new API deployment happens. Which solution will accomplish this?
Choose an answer
Tap an option to check your answer.
Correct answer: Add a CodePipeline action that runs a Lambda right after the API deployment stage. The Lambda should export/download the SDK from API Gateway, upload it to the S3 origin, and create a CloudFront invalidation for the SDK path..
Why this is the answer
The correct solution integrates directly into the existing CodePipeline workflow. A Lambda function can be triggered post-deployment to programmatically export the updated SDK from API Gateway, upload it to the S3 bucket, and then invalidate the CloudFront cache for the SDK path. This ensures the latest SDK is always available to users. The option suggesting a built-in CodePipeline API Gateway export integration is incorrect because CodePipeline does not have a native action for exporting API Gateway SDKs directly to S3. The EventBridge options are less efficient as they introduce an out-of-band trigger, and the "CreateDeployment" event is not the most reliable for capturing SDK changes. Additionally, S3 does not have a "cache invalidation" mechanism; CloudFront is responsible for caching and invalidation.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed