cdkeventbridgepartnerprocessors

package module
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

Eventbridge SaaS Partner fURLs

npm version PyPI version Go project version

This CDK Construct library provides CDK constructs for the 1st-party (i.e. developed by AWS) lambda fURL webhook receivers for:

  • GitHub
  • Stripe
  • Twilio

Usage Examples (Simplified)

These examples are consistent for all 3 primary exported constructs of this library:

  • GitHubEventProcessor
  • TwilioEventProcessor
  • StripeEventProcessor
Typescript
import { GitHubEventProcessor } from 'cdk-eventbridge-partner-processors';
import { Stack, StackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { EventBus } from 'aws-cdk-lib/aws-events';
import { Secret } from 'aws-cdk-lib/aws-secretsmanager';

export class MyStackWithABetterName extends Stack {
    constructor(scope: Construct, id: string, props: StackProps) {
        super(scope, id, props);

        // This library has no opinion on how you reference your EventBus,
        // It just needs to fulfill the IEventBus protocol
        const myEventBus = new EventBus(this, 'TheBestBusEver', {
            eventBusName: 'TheGreatestBus'
        });

        // This library has no opinion on how you reference your secret,
        // It just needs to fulfill the ISecret protocol
        const mySecret = Secret.fromSecretNameV2(this, 'MyNuclearCodeSecret', '/home/recipes/icbm')

        // Function will automatically receive permission to:
        // 1. Post events to the given bus
        // 2. Read the given secret
        const githubEventProcessor = new GitHubEventProcessor(this, 'GitHubProcessor', {
            eventBus: myEventBus,
            webhookSecret: mySecret,
            lambdaInvocationAlarmThreshold: 2000,
        })

    }
}
Disclaimer

⚠ The Lambda Functions that handle the actual event processing in this Library are owned and maintained by Amazon Web Services. This CDK Construct library provides a thin deployment wrapper for these functions. Changes made to the S3 location of the functions will break this library. Until I have a way to deterministically track where these things are, please raise an issue if you have reason to believe that the functions have moved.

AWS Documentation

See here for additional information.

Documentation

Overview

cdk-eventbridge-partner-processors

cdk-eventbridge-partner-processors

cdk-eventbridge-partner-processors

cdk-eventbridge-partner-processors

cdk-eventbridge-partner-processors

cdk-eventbridge-partner-processors

cdk-eventbridge-partner-processors

cdk-eventbridge-partner-processors

cdk-eventbridge-partner-processors

cdk-eventbridge-partner-processors

cdk-eventbridge-partner-processors

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitHubEventProcessor_IsConstruct

func GitHubEventProcessor_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.

func InvocationAlarm_IsConstruct

func InvocationAlarm_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.

func NewGitHubEventProcessor_Override

func NewGitHubEventProcessor_Override(g GitHubEventProcessor, scope constructs.Construct, id *string, props *GitHubProps)

func NewInvocationAlarm_Override

func NewInvocationAlarm_Override(i InvocationAlarm, scope constructs.Construct, id *string, props *InvocationAlarmProps)

func NewPartnerProcessor_Override added in v0.0.5

func NewPartnerProcessor_Override(p PartnerProcessor, scope constructs.Construct, id *string, props *PartnerFunctionProps)

func NewStripeEventProcessor_Override added in v0.0.5

func NewStripeEventProcessor_Override(s StripeEventProcessor, scope constructs.Construct, id *string, props *StripeProps)

func NewTwilioEventProcessor_Override added in v0.0.5

func NewTwilioEventProcessor_Override(t TwilioEventProcessor, scope constructs.Construct, id *string, props *TwilioProps)

func PartnerProcessor_IsConstruct added in v0.0.5

func PartnerProcessor_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.

func StripeEventProcessor_IsConstruct added in v0.0.5

func StripeEventProcessor_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.

func TwilioEventProcessor_IsConstruct added in v0.0.5

func TwilioEventProcessor_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead.

Types

type GitHubEventProcessor

type GitHubEventProcessor interface {
	PartnerProcessor
	InvocationAlarm() InvocationAlarm
	SetInvocationAlarm(val InvocationAlarm)
	// The tree node.
	Node() constructs.Node
	PartnerEventsFunction() awslambda.Function
	SetPartnerEventsFunction(val awslambda.Function)
	// Returns a string representation of this construct.
	ToString() *string
}

CDK wrapper for the GitHub Eventbridge processor. See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas-furls.html#furls-connection-github

func NewGitHubEventProcessor

func NewGitHubEventProcessor(scope constructs.Construct, id *string, props *GitHubProps) GitHubEventProcessor

type GitHubProps

type GitHubProps struct {
	// Eventbus to send GitHub events to.
	EventBus awsevents.IEventBus `field:"required" json:"eventBus" yaml:"eventBus"`
	// Maximum number of concurrent invocations on the fURL function before triggering the alarm.
	LambdaInvocationAlarmThreshold *float64 `field:"required" json:"lambdaInvocationAlarmThreshold" yaml:"lambdaInvocationAlarmThreshold"`
	// SM Secret containing the secret string used to validate webhook events.
	WebhookSecret awssecretsmanager.ISecret `field:"required" json:"webhookSecret" yaml:"webhookSecret"`
}

type InvocationAlarm

type InvocationAlarm interface {
	constructs.Construct
	// The tree node.
	Node() constructs.Node
	// Returns a string representation of this construct.
	ToString() *string
}

Cloudwatch Alarm used across this construct library.

func NewInvocationAlarm

func NewInvocationAlarm(scope constructs.Construct, id *string, props *InvocationAlarmProps) InvocationAlarm

type InvocationAlarmProps

type InvocationAlarmProps struct {
	// The function to monitor.
	EventFunction awslambda.IFunction `field:"required" json:"eventFunction" yaml:"eventFunction"`
	// Lambda Invocation threshold.
	Threshold *float64 `field:"required" json:"threshold" yaml:"threshold"`
}

type Partner added in v0.0.5

type Partner string

Supported partners with fURL integrations.

const (
	Partner_GITHUB Partner = "GITHUB"
	Partner_STRIPE Partner = "STRIPE"
	Partner_TWILIO Partner = "TWILIO"
)

type PartnerFunctionProps added in v0.0.5

type PartnerFunctionProps struct {
	// The partner to create an events processor for.
	EventbridgePartner Partner `field:"required" json:"eventbridgePartner" yaml:"eventbridgePartner"`
	// Eventbus to send Partner events to.
	EventBus awsevents.IEventBus `field:"required" json:"eventBus" yaml:"eventBus"`
	// Maximum number of concurrent invocations on the fURL function before triggering the alarm.
	LambdaInvocationAlarmThreshold *float64 `field:"required" json:"lambdaInvocationAlarmThreshold" yaml:"lambdaInvocationAlarmThreshold"`
	// SM Secret containing the secret string used to validate webhook events.
	WebhookSecret awssecretsmanager.ISecret `field:"required" json:"webhookSecret" yaml:"webhookSecret"`
}

type PartnerProcessor added in v0.0.5

type PartnerProcessor interface {
	constructs.Construct
	InvocationAlarm() InvocationAlarm
	SetInvocationAlarm(val InvocationAlarm)
	// The tree node.
	Node() constructs.Node
	PartnerEventsFunction() awslambda.Function
	SetPartnerEventsFunction(val awslambda.Function)
	// Returns a string representation of this construct.
	ToString() *string
}

CDK wrapper for the GitHub Eventbridge processor. See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas-furls.html#furls-connection-github

type StripeEventProcessor added in v0.0.5

type StripeEventProcessor interface {
	PartnerProcessor
	InvocationAlarm() InvocationAlarm
	SetInvocationAlarm(val InvocationAlarm)
	// The tree node.
	Node() constructs.Node
	PartnerEventsFunction() awslambda.Function
	SetPartnerEventsFunction(val awslambda.Function)
	// Returns a string representation of this construct.
	ToString() *string
}

CDK wrapper for the GitHub Eventbridge processor. See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas-furls.html#furls-connection-github

func NewStripeEventProcessor added in v0.0.5

func NewStripeEventProcessor(scope constructs.Construct, id *string, props *StripeProps) StripeEventProcessor

type StripeProps added in v0.0.5

type StripeProps struct {
	// Eventbus to send GitHub events to.
	EventBus awsevents.IEventBus `field:"required" json:"eventBus" yaml:"eventBus"`
	// Maximum number of concurrent invocations on the fURL function before triggering the alarm.
	LambdaInvocationAlarmThreshold *float64 `field:"required" json:"lambdaInvocationAlarmThreshold" yaml:"lambdaInvocationAlarmThreshold"`
	// SM Secret containing the secret string used to validate webhook events.
	WebhookSecret awssecretsmanager.ISecret `field:"required" json:"webhookSecret" yaml:"webhookSecret"`
}

type TwilioEventProcessor added in v0.0.5

type TwilioEventProcessor interface {
	PartnerProcessor
	InvocationAlarm() InvocationAlarm
	SetInvocationAlarm(val InvocationAlarm)
	// The tree node.
	Node() constructs.Node
	PartnerEventsFunction() awslambda.Function
	SetPartnerEventsFunction(val awslambda.Function)
	// Returns a string representation of this construct.
	ToString() *string
}

CDK wrapper for the GitHub Eventbridge processor. See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-saas-furls.html#furls-connection-github

func NewTwilioEventProcessor added in v0.0.5

func NewTwilioEventProcessor(scope constructs.Construct, id *string, props *TwilioProps) TwilioEventProcessor

type TwilioProps added in v0.0.5

type TwilioProps struct {
	// Eventbus to send GitHub events to.
	EventBus awsevents.IEventBus `field:"required" json:"eventBus" yaml:"eventBus"`
	// Maximum number of concurrent invocations on the fURL function before triggering the alarm.
	LambdaInvocationAlarmThreshold *float64 `field:"required" json:"lambdaInvocationAlarmThreshold" yaml:"lambdaInvocationAlarmThreshold"`
	// SM Secret containing the secret string used to validate webhook events.
	WebhookSecret awssecretsmanager.ISecret `field:"required" json:"webhookSecret" yaml:"webhookSecret"`
}

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL