Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use the Post-Receive WebHooks to get notification in an AWS service like SQS or SNS?

Alfredo Nava
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 15, 2018

I have put the URL of an SQS into the webhook URL field, but none of the POSTs are coming through at all. 

2 answers

0 votes
Steffen Opel _Utoolity_
Community Champion
April 26, 2018

You cannot POST data to the Amazon SNS or Amazon SQS APIs without signing the request with AWS credentials. Using the built-in WebHook features of either Bitbucket Cloud or Server as is is therefore not possible.

Possible workaround

You could use Amazon API Gateway to implement an endpoint that will allow POST requests from Bitbucket without authentication, and then use AWS Lambda to relay the webhook payload to SQS - of course, you probably want to somewhat restrict who can use this public endpoint, for example via IP whitelisting in Bitbucket Cloud, or webhook secrets in Bitbucket Server.

Mid-term alternative

Our (commercial) Automation with AWS app family already supports sending SNS messages from various Jira and Bamboo extension points, and thus implicitly also SQS messages as outlined in Sending Amazon SNS Messages to Amazon SQS Queues.

The message signing is handled by the freely included Identity Federation for AWS app family, which is also available for Bitbucket Server already (though not yet public in the Marketplace, let me know if you would like early access).

So if your use case happens to be Bitbucket Server, fell free to contact us, we'd be happy to discuss how our early internal "Automation with AWS (Bitbucket)" prototype can be evolved to cover your needs.

0 votes
jredmond
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 15, 2018

Is this Bitbucket Cloud (bitbucket.org) or Bitbucket Server? Are there any error messages when you try to use that hook? Are you using any AWS security groups to limit access to the SQS queues, and if so, are the relevant source IPs able to send? Is there any authentication necessary for the queue?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events