Bitbucket
Firefly integrates with Bitbucket to connect your infrastructure code repositories with your cloud resources. This integration enables powerful features like tracing cloud resources back to their defining code ("Jump to Code") and automatically creating Pull Requests for newly codified resources and drift remediation.
Prerequisites
A Bitbucket account with access to your infrastructure repositories.
Appropriate permissions to create an OAuth consumer or an Atlassian API token (depending on the authentication method you choose).
Repositories containing Terraform, CloudFormation, or other IaC files you want to connect to Firefly.
Setup Procedures
Firefly supports two authentication methods for Bitbucket Cloud. Choose the one that best fits your needs:
OAuth — authorize Firefly through a Bitbucket OAuth consumer.
API Token — authenticate with a scoped Atlassian API token.
OAuth
Prerequisite: To successfully integrate Firefly with your Bitbucket account, you must be the workspace admin.
Log in to your Bitbucket account.
Click on your Avatar on the top right panel, then click on All workspaces.
Select the workspace Firefly will be integrated with.
Click on the Settings icon on the top right panel (to the left of your Avatar) and select Workspace settings.
Please scroll down in the left panel and click on OAuth clients.
Click on Create OAuth client to create a new integration with Firefly.
Select a name for the application.
Add a description (optional).
In the Callback URL, please paste the following URL:
https://app.firefly.ai/integrations/bitbucket-integrationIn the Permission section, please select the following:
Account: read
Repositories: write and admin
Pull requests: write
Webhooks: read and write
Note: All the permissions must be selected for the integration to be successful.
Scroll to the bottom of the page and click Save. You will be directed to the OAuth clients where you can see the newly created client.
Click on the new client to see its details:
Please copy the Client ID and paste it in Firefly's Bitbucket Integration page in the Client ID field.
Please copy the Secret and paste it in Firefly's Bitbucket Integration page in the Secret field.
After filling in the information, please click the Authorize button in Firefly's Bitbucket Integration page.
In the new page that opens, please press Grant Access.
Note: You must authorize for the integration to be successful.
After authorizing the new application, you will be redirected back to Firefly's application.
After the integration is completed, please enter your Bitbucket account email in the Bitbucket Email field and the workspace ID in the Workspace ID field. Click Create Integration to check if the workspace exists.
When the validation is complete, click on the Next button for webhooks to be installed.
API Token
Prerequisite: Create a scoped Atlassian API token (not an app password). Bitbucket Cloud app passwords are being retired. Follow Create an API token.
Select your profile in the upper-right corner of Bitbucket, then open Account settings.
On the Atlassian Account page, open the Security tab.
Select Create and manage API tokens, then Create API token with scopes.
Give the token a name and an expiry date, then select Next.
Select Bitbucket as the app, then select Next.
Select the following scopes (see API token permissions), then select Next:
Account: read
read:accountread:workspace:bitbucket
Repositories: write and admin
read:repository:bitbucketwrite:repository:bitbucketadmin:repository:bitbucket
Pull requests: write
read:pullrequest:bitbucketwrite:pullrequest:bitbucket
Webhooks: read and write
read:webhook:bitbucketwrite:webhook:bitbucket
Note: In the granular token model,
writedoes not implyread— select theread:*scopes explicitly. An unscoped API token will fail with401.Review and select Create token. Copy the token immediately — it is shown only once.
In Firefly, enter your Atlassian account email, paste the API token, and enter the Workspace ID. Click Create Integration.
When validation completes, click Next for webhooks to be installed.
Integrate Bitbucket Data Center
Enter the domain for your Bitbucket Data Center instance and paste the app password into the App Password box.
Features Enabled
Jump to Code: Trace resources in your cloud inventory back to the Bitbucket file and specific line that defines them.
Automated Pull Requests: When Firefly codifies an unmanaged resource, it can commit the new infrastructure code as a Pull Request.
IaC Tracking: Firefly maintains awareness of which resources are defined in code and which are not.
Drift Remediation: Firefly can detect drift between the code and the actual resources and create a Pull Request to fix it.
Last updated
Was this helpful?