Topic 1 Question 441
A developer hosts a static website on Amazon S3 and connects the website to an Amazon CloudFront distribution. The website uses a custom domain name that points to the CloudFront URL.
The developer has set up a continuous integration and continuous delivery (CI/CD) pipeline. The pipeline automatically runs when changes occur in an AWS CodeCommit repository. The pipeline has a source stage and then a build stage. The build stage invokes an AWS CodeBuild project that references a buildspec.yml file. The buildspec.yml file builds the code and deploys the static files to the S3 bucket.
The pipeline runs successfully, and the latest website files are visible in the S3 bucket and at the S3 website URL. However, when the developer accesses the website through the CloudFront domain, the updates are not reflected on the website.
What should the developer configure the buildspec.yml file to do to resolve this issue?
Properly synchronize the objects in the S3 bucket with new files from the source stage.
Delete the previous website files in the S3 bucket and redeploy the website files.
Invalidate the file caches for the primary CloudFront distribution.
Modify the cross-origin resource sharing (CORS) policy of the S3 bucket and redeploy the website files.
ユーザの投票
コメント(3)
- 正解だと思う選択肢: C
aws cloudfront create-invalidation --distribution-id EXAMPLE123 --paths "/*"
👍 1albert_kuo2024/10/09 - 正解だと思う選択肢: C
Invalidate the caches to enable the new code deployed to reflect
👍 14d716d62024/11/28 - 正解だと思う選択肢: C
Selected Answer: C Invalidate the CloudFront cache: To ensure that CloudFront serves the most up-to-date content, you can trigger a cache invalidation in your buildspec.yml file. This will force CloudFront to fetch the latest files from the S3 bucket rather than serving cached content. You can do this by using the AWS CLI to invalidate the CloudFront distribution cache.
👍 1examuserss2025/01/02
シャッフルモード