Git Product home page Git Product logo

bitbucket-webhook-aws-terraform's Introduction

Bitbucket webhook to AWS SNS

Publish Bitbucket webhook events to AWS SNS, enabling easy consumption by Lambda or other subscribers in the AWS ecosystem.

Usage

Multiple HTTP resources can be created. Each corresponds to a separate SNS topic.

SNS messages have an attribute "event" with the contents of X-Event-Key. You may use this for subscription filter policies.

The "signature" attribute is "sha256=<hmac>". The message contents have not been validated with the signature; consumer must do that.

Inputs

Name Type Description Default
deploy_version string Arbitrary version to force deployment of API gateway "1"
endpoints list Names of endpoints ["all"]
name string Namespace for resources "bitbucket-events"

Outputs

Name Type Description
gateway_api_id string ID of API gateway
gateway_invoke_url string URL of deployed API
gateway_stage_name string Stage name of API gateway
sns_topic_arns list ARNs of SNS topics

Requests can be made against "${gateway_invoke_url}/${endpoint}". (Or use a custom domain)

Examples

Basic

module "bitbucket-events" {
  source         = "github.com/rivethealth/bitbucket-webhook-aws-terraform"
}

Custom domain

data "aws_acm_certificate" "bitbucket-events" {
  domain   = "bitbucket-events.example.com"
  statuses = ["ISSUED"]
}

module "bitbucket-events" {
  source         = "github.com/rivethealth/bitbucket-webhook-aws-terraform"
}

resource "aws_api_gateway_base_path_mapping" "bitbucket-events" {
  api_id      = "${module.bitbucket-events.gateway_api_id}"
  stage_name  = "${module.bitbucket-events.gateway_stage_name}"
  domain_name = "${aws_api_gateway_domain_name.bitbucket-events.domain_name}"
}

resource "aws_api_gateway_domain_name" "bitbucket-events" {
  certificate_arn = "${data.aws_acm_certificate.bitbucket-events.arn}"
  domain_name     = "bitbucket-events.example.com"
}

Note that a custom domain name will not be ready for several minutes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.