Bitbucket App connections
You can use Bitbucket to connect with CodeBuild. Bitbucket App connections are supported through AWS CodeConnections.
Note
CodeConnections is available in less regions than CodeBuild. You can use cross-region connections in CodeBuild. Connections created in opt-in regions, cannot be used in other regions. For more information, see AWS CodeConnections endpoints and quotas.
Topics
Step 1: Create a connection to Bitbucket (console)
Use these steps to use the CodeBuild console to add a connection for your project in Bitbucket.
To create a connection to Bitbucket
-
Follow the instructions in the Developer Tools User Guide for Create a connection to Bitbucket.
Step 2: Grant CodeBuild project IAM role access to use the connection
You can grant CodeBuild project IAM role access to use the Bitbucket tokens vended by your connection.
To grant CodeBuild project IAM role access
-
Create an IAM role for your CodeBuild project by following the instructions to Allow CodeBuild to interact with other AWS services for your CodeBuild project.
-
While following the instructions, add the following IAM policy to your CodeBuild project role to grant access to the connection.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "codeconnections:GetConnectionToken", "codeconnections:GetConnection" ], "Resource": [
<connection-arn>
] } ] }
Step 3: Configure CodeBuild to use the new connection
You can configure a connection as an account level credential and use it in a project.
For more information on setting up multiple tokens in your CodeBuild project, see Configure multiple tokens as source level credentials.