I'm trying to setup AWS Codebuild to deploy an application to AWS Elastic Beanstalk.
The problem is that it seems that the EB CLI is not available from AWS CodeBuild (It seems like it should, reading this... https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli-codebuild.html)
So when I specify an eb cli command on CodeBuild:
version: 0.2
phases:
install:
commands:
- echo Logging into Amazon ECR...
- eb init --platform "multi-container-docker-18.03.1-ce-(generic)" --region us-west-1 application
I get:
/codebuild/output/tmp/script.sh: eb: not found
I also tried installing the CLI with:
- pip install --upgrade awsebcli awscli
- eb init --platform "multi-container-docker-18.03.1-ce-(generic)" --region us-west-1 application
And extended the generated AWS CodeBuild role with full access to Elastic Beanstalk
But I get this error:
ERROR: NotAuthorizedError - Operation Denied. Access Denied
I added a --debug flag to the command, and this is the exact error:
2018-09-10 13:33:55,151 (DEBUG) ebcli.lib.aws : Making api call: (elasticbeanstalk, describe_configuration_settings) to region: us-west-1 with args:{'ApplicationName': 'application', 'EnvironmentName': 'staging'}
2018-09-10 13:33:55,495 (DEBUG) ebcli.lib.aws : Response: {'Error': {'Type': 'Sender', 'Code': 'InsufficientPrivilegesException', 'Message': 'Access Denied'}, 'ResponseMetadata': {'RequestId': '32f4e739-1694-4aa2-9e2e-076ec4861ae7', 'HTTPStatusCode': 403, 'date': 'Mon, 10 Sep 2018 13:33:55 GMT', 'RetryAttempts': 0}}
2018-09-10 13:33:55,495 (DEBUG) ebcli.lib.aws : API call finished, status = 403
Am I missing something? How can I use the EB CLI from CodeBuild properly?
NotAuthorizedError? - progfaneb init- Carlos Martinezeb init --debug? This will show a stack trace, but in the lines leading up to it, there should also be an indication of which API call failed. This will likely be the last debug log statement of the kindMaking api call: (<service name>, <operation>). You would likely need to give your user role permissions to that service + operation. - progfan