Reputation: 651
I have an AWS Code Pipeline whose build step uses the AWS CLI, so of course it needs AWS credentials to work.
I don't see how to do this ... the 'source stage' checks out from github and therefore has the source artifact as its output artifact.
I wound up just committing the credentials into the branch I'm building from (currently unencrypted, though I can of course encrypt them if this workaround has to go into production) ... and this works.
Isn't there some way to do this "correctly" without getting the credentials from that branch?
Upvotes: 1
Views: 861
Reputation: 106
In the build action, if you are using CodeBuild project, You need to attach custom policies to CodeBuild service role. So, when you use AWS CLI goes through the credentials providers in order and will fetch temporary credentials for that role. This way you don't have to commit sensitive environment configuration in your repo.
Upvotes: 1