
Answer-first summary for fast verification
Answer: Create a CodePipeline action immediately after the API deployment stage. Configure this action to trigger an AWS Lambda function that downloads the SDK from API Gateway, uploads it to the S3 bucket, and initiates a CloudFront invalidation for the SDK path.
Option A is the correct answer. It recommends creating a CodePipeline action immediately after the API deployment stage. This action triggers an AWS Lambda function, which handles the tasks of downloading the SDK from API Gateway, uploading it to the S3 bucket, and creating a CloudFront invalidation for the SDK path. This approach ensures that the newly updated SDK is available automatically and promptly after each deployment. The other options either do not directly trigger the necessary invalidations or propose invalidating the cache via S3, which does not support such an operation. Only CloudFront provides the needed invalidation capability.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
A company frequently updates its Amazon API Gateway API using AWS CodePipeline. As part of the deployment process, they manually export the JavaScript SDK for the API, upload it to an Amazon S3 bucket, and use this bucket as the origin for an Amazon CloudFront distribution. Web clients access the SDK through the CloudFront endpoint. To streamline this process, a DevOps engineer must implement an automated solution that ensures the latest SDK is available immediately after each API deployment. Which solution meets these requirements?
A
Create a CodePipeline action immediately after the API deployment stage. Configure this action to trigger an AWS Lambda function that downloads the SDK from API Gateway, uploads it to the S3 bucket, and initiates a CloudFront invalidation for the SDK path.
B
Create a CodePipeline action immediately after the API deployment stage. Configure this action to use the CodePipeline integration with API Gateway to export the SDK to Amazon S3, followed by another action that uses the CodePipeline integration with Amazon S3 to invalidate the cache for the SDK path.
C
Create an Amazon EventBridge rule that responds to UpdateStage events from aws.apigateway. Configure this rule to trigger an AWS Lambda function that downloads the SDK from API Gateway, uploads it to the S3 bucket, and calls the CloudFront API to create an invalidation for the SDK path.
D
Create an Amazon EventBridge rule that responds to CreateDeployment events from aws.apigateway. Configure this rule to trigger an AWS Lambda function that downloads the SDK from API Gateway, uploads it to the S3 bucket, and calls the S3 API to invalidate the cache for the SDK path.
No comments yet.