Supported webhook events:
- Repository – Push
- Pull request – Created
- Pull request – Updated
What’s on this page:
- Getting started
- Creating an SNS topic
- Adding webhook URL via Subscriptions
- Setup webhook for AWS repository
- Verification and troubleshooting
Getting started
AWS CodeCommit supports webhooks. For users that came from other Git hosting services, this feature is accessible in the triggers settings. This guide will help users who are unfamiliar with AWS web portal to get things moving.
Start by logging in to your AWS CodeCommit admin or poweruser account that has access to configure SNS topics.
Creating an SNS topic
-
From your Console Home, go to Amazon Simple Notification Service to start creating a topic. You may use the Services search bar to access the SNS configuration page.
On the Create topic section, type a Topic name on the provided box.
-
Click Next step. The following page is displayed.
-
For the Details section, set Type to Standard.
-
The Name field uses the Topic name entered from the previous page.
-
Scroll down to the bottom of the page and click Create topic. This creates a new SNS topic with the specified name.
-
Adding webhook URL via Subscriptions
-
Continuing from the steps above, go to the Subscriptions tab and create a new subscription. You’ll be seeing the following page.
-
For the Topic ARN, select an SNS topic. For this case, set it to the SNS topic created previously from the above steps.
-
Set Protocol to HTTPS.
-
-
On your Jira Cloud instance, go to Apps ➜ Git Integration: Manage integrations ➜ Indexing triggers and copy the Webhook URL.
-
Switch back to your AWS web portal (where you’re on the Create subscription page) and paste this URL into the Endpoint field.
-
Click Create subscription to complete this setup.
AWS CodeCommit sends a special type of confirmation request, “SubscriptionConfirmation
“, to the specified endpoint URL. The Git Integration for Jira app receives this request, processes it, and then sends back the confirmation automatically. If CodeCommit doesn’t receive the handshake to the confirmation request, the subscription will hang in ‘Pending confirmation’ status for three days – see the related article here.
Setup webhook for AWS repository
The webhook setup can be simply performed by any user to the repository as long as an existing SNS topic has been configured.
-
On the AWS web portal, open the CodeCommit git repository to work on.
-
Go to the repository Settings on the sidebar.
-
Start to create a trigger for this repository via the Triggers tab.
-
Click Create trigger. The following screen is displayed.
-
Enter a meaningful Trigger name.
-
Set Events to All repository events (RECOMMENDED).
-
Setting the Branch name is optional unless a specific branch is used.
-
For Service to use, choose Amazon SNS.
-
Use the SNS topic subscription created from the previous process.
-
-
Test the trigger to see if everything works. Otherwise, verify entered settings.
-
Click Create trigger. This configuration is added to the Triggers list.
Verification and troubleshooting
Test and create new commits and see if webhooks have arrived without errors in the Indexing triggers log on your Jira Cloud instance.
If errors are received, verify AWS triggers settings and make the necessary changes. Perform a reindex on the integration/repository in the Git repository configuration list to pull supported events and commits from the AWS repository.