@cloudcomponents/cdk-contentful-webhook
Create, update and delete contentful webhooks with your app deployment
Install
TypeScript/JavaScript:
npm i @cloudcomponents/cdk-contentful-webhook
Python:
pip install cloudcomponents.cdk-contentful-webhook
How to use
import { ContentfulWebhook } from '@cloudcomponents/cdk-contentful-webhook';
import { SecretKey } from '@cloudcomponents/cdk-secret-key';
import { Stack, StackProps, aws_apigateway } from 'aws-cdk-lib';
import { Construct } from 'constructs';
export class ContentfulWebhookStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const api = new aws_apigateway.RestApi(this, 'Endpoint');
api.root.addMethod('POST');
if (typeof process.env.ACCESS_TOKEN === 'undefined') {
throw new Error('environment variable ACCESS_TOKEN undefined');
}
const accessToken = SecretKey.fromPlainText(process.env.ACCESS_TOKEN);
if (typeof process.env.SPACE_ID === 'undefined') {
throw new Error('environment variable SPACE_ID undefined');
}
const spaceId = process.env.SPACE_ID;
const topics = ['Entry.create'];
new ContentfulWebhook(this, 'ContentfulWebhook', {
accessToken,
spaceId,
name: 'ExampleWebhook',
url: api.url,
topics,
logLevel: 'debug',
});
}
}
API Reference
See API.md.
Example
See more complete examples.
License
Metadata
Release files for cloudcomponents.cdk-contentful-webhook 2.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cloudcomponents.cdk-contentful-webhook-2.4.0.tar.gz | 620.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cloudcomponents.cdk_contentful_webhook-2.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.2 MB
Release files / cloudcomponents.cdk-contentful-webhook-2.4.0.tar.gz
| Download URL | cloudcomponents.cdk-contentful-webhook-2.4.0.tar.gz |
|---|---|
| Size | 620.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6ce1dd9ea26cc87dcc37f43e3d9cc0d106377a3fea60c354998f678bfb021c1
|
|
BLAKE2b-256 checksum How to use checksums |
f741272b8e1abc722f5236bb2d88589b6d1c59fd689121d6f979090c4db25e78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / cloudcomponents.cdk_contentful_webhook-2.4.0-py3-none-any.whl
| Download URL | cloudcomponents.cdk_contentful_webhook-2.4.0-py3-none-any.whl |
|---|---|
| Size | 619.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab653ad59c4a7063b2e11028cc9dfcbd088e92012eaed4db2abb5472ecb618ae
|
|
BLAKE2b-256 checksum How to use checksums |
2f16675eacf8b7f24f254160585c668a5d852a77cfa9376d89d72b8e81b072bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|