Ultimate access to all questions.
A company is constructing a CI/CD pipeline using AWS CodePipeline and AWS CodeBuild within a dedicated build account. This pipeline comprises two stages: the initial stage involves a CodeBuild job responsible for building and packaging an AWS Lambda function, while the second stage involves deployment actions across two distinct AWS accounts representing a development environment and a production environment. These deployment stages leverage AWS CloudFormation actions initiated by CodePipeline to deploy the necessary infrastructure for the Lambda function. The pipeline is set up to encrypt build artifacts using the AWS Key Management Service (AWS KMS) with the AWS-managed key for Amazon S3 (aws/s3 key), and these artifacts are stored in an S3 bucket. Despite these configurations, when the pipeline executes, the CloudFormation actions encounter an access denied error. What steps must the DevOps engineer undertake to rectify this issue?