Webhook Self-Service Actions
Port can trigger webhooks based on a customer provided
URL Both for
The steps shown in the image above are as follows:
Port generates an invocation of
Port signs the payload + timestamp using
HMAC-SHA-256and puts it in the request header. :::info WEBHOOK SECURITY Verifying the webhook request using the request headers provides the following benefits:
- Ensures that the request payload has not been tampered with
- Ensures that the sender of the message is Port
- Ensures that the received message is not a replay of an older message
To learn how to verify the webhook request, refer to the Verifying Webhook Signature page.
Port publishes an invoked
POSTrequest to the customer defined
A listener implemented on the Client side receives the new
POSTrequest and runs code defined by the DevOps team.
The listener can be anything that can read from a Kafka topic and run code based on the received message, for example:
- AWS Lambda;
- Python code that reads from the topic;
- Docker container running code.
You control how you interact with webhooks, in the way that best suits your organization and infrastructure.
An example flow would be:
- A developer asks to deploy a new version of an existing
createaction is sent to the defined
- An AWS Lambda function is triggered by this new action message;
- The Lambda function deploys a new version of the service;
- When the Lambda is done, it reports back to Port about the new Microservice
When creating the action, the
Backend step includes multiple configurations that you can customize:
HTTP request type
By default, a
POST request will be sent to the specified endpoint URL. You can change the request to any of the supported types:
Sync vs. async execution
By default, the action will be executed asynchronous, meaning that your backend will need to explicitly send Port its result via the API.
Alternatively, you can set the execution type to synchronous, which will cause the action to automatically report its result back to Port via the returned HTTP status code and payload.
To get started with webhook Self-Service Actions, please check the sources below:
- Create an S3 bucket using Self-Service Actions
- Webhook changelog listener
- Provisioning software templates using Cookiecutter