An example webhook handler for Common Fate, deployed using the AWS CDK. It uses a preshared authorization header for authentication.
-
Replace the authorization header and the permission set identifier in
cmd/lambda/main.go. -
Deploy the Lambda function:
npm run cdk deploy. -
Add a webhook handler to your Common Fate configuration, replacing the
urlandheadersvalues with ones matching the Lambda function you have deployed:
resource "commonfate_webhook_integration" "example_lambda" {
name = "Example Lambda"
url = "https://abcdef.lambda-url.ap-southeast-2.on.aws" // REPLACE THIS
headers = [
{
key = "Authorization",
value = "abcdef" // REPLACE THIS
},
]
send_audit_log_events = true
}npm run buildcompile typescript to jsnpm run watchwatch for changes and compilenpm run testperform the jest unit testsnpx cdk deploydeploy this stack to your default AWS account/regionnpx cdk diffcompare deployed stack with current statenpx cdk synthemits the synthesized CloudFormation template