Search code examples
amazon-web-servicesgithubaws-code-deploy

AWS Code Deploy 403 error on accessing repo


I'm trying to setup Code Deploy with AWS, but the code-deploy agent log is telling me there is a 403 error:

2021-03-16 21:17:26 ERROR [codedeploy-agent(6548)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during perform: RuntimeError - Could not download bundle at 'https://api.github.com/repos/MY_ORG/PROJECT/tarball/HASH' after 3 retries. Server returned codes: 403 'Forbidden'; 403 'Forbidden'; 403 'Forbidden'; 403 'Forbidden'. - /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:373:in rescue in download_from_github'`

I connected my personal Github account to Code Deploy, which has access to my organization's repository on which I'm an owner. On the repo itself, I'm an admin.

The repository is private, making it public gets past the issue, however, I don't want the repository to be public.

I can get Code Deploy to work using a repo under my personal account, not the org account.

Do I need to authenticate differently? Is there a switch I need to flip?


Solution

  • Figured it out!

    There is a separate step that needs to be taken when deploying for an organization

    This page from AWS covers the different routes you can go down.