I have a an AWS codebuild job that works fine when I initate manually as a root user.
I have a codepipe line that should initiate the build job when codecommit merges into master. It fires the job and the build start but it fails when trying to download source.
Ive attached full S3/codebuild/codecommit policies to the pipeline, but it still throws access denied.
Which permissions am I missing?
CodePipeline integrates with multiple AWS and third-party services, including GitHub, AWS CodeCommit, CodeBuild, AWS CloudFormation, Amazon S3, and many others.
CodePipeline builds, tests, and deploys your code every time there is a code change, based on the release process models you define. AWS CodeDeploy belongs to "Deployment as a Service" category of the tech stack, while AWS CodePipeline can be primarily classified under "Continuous Deployment".
I am not authorized to perform an action in CodePipeline If the AWS Management Console tells you that you're not authorized to perform an action, you must contact your administrator for assistance. Your administrator is the person who provided you with your user name and password.
This generally happens when you have a CodeBuild project already and you integrate it to the CodePipeline project. The Codebuild now does not download the sources from CodeCommit/Github repo. Instead, it will try to dowload the source artifact created in the codepipeline bucket in S3. So, you will need to provide permissions to the CodeBuild role to access the codepipline bucket in S3.
You can do this by modifying Codebuild role's attached policy (or attaching a new policy) that gives access to the following operations
s3:ListObjects
s3:GetObject
s3:ListBucket
for your Codepipeline bucket and its objects
"arn:aws:s3:::codepipeline-bucket",
"arn:aws:s3:::codepipeline-bucket/*"
Or you can just choose to add all operations for this bucket and its object. You can release the changes and it would work. Lmk if it does not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With