[![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)
# @cloudcomponents/cdk-contentful-webhook
[![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)
[![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)
[![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-contentful-webhook)
[![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-contentful-webhook/)
> Create, update and delete contentful webhooks with your app deployment
## Install
TypeScript/JavaScript:
```bash
npm i @cloudcomponents/cdk-contentful-webhook
```
Python:
```bash
pip install cloudcomponents.cdk-contentful-webhook
```
## How to use
```python
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](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-contentful-webhook/API.md).
## Example
See more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).
## License
[MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-contentful-webhook/LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/cloudcomponents/cdk-constructs",
"name": "cloudcomponents.cdk-contentful-webhook",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.8",
"maintainer_email": null,
"keywords": null,
"author": "hupe1980",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/1f/28/e3465d6f181fdf24f47aa8a5b2626a140c7bb19f230dd16b256e1947e71d/cloudcomponents.cdk-contentful-webhook-2.3.0.tar.gz",
"platform": null,
"description": "[![cloudcomponents Logo](https://raw.githubusercontent.com/cloudcomponents/cdk-constructs/master/logo.png)](https://github.com/cloudcomponents/cdk-constructs)\n\n# @cloudcomponents/cdk-contentful-webhook\n\n[![Build Status](https://github.com/cloudcomponents/cdk-constructs/workflows/Build/badge.svg)](https://github.com/cloudcomponents/cdk-constructs/actions?query=workflow=Build)\n[![cdkdx](https://img.shields.io/badge/buildtool-cdkdx-blue.svg)](https://github.com/hupe1980/cdkdx)\n[![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@cloudcomponents/cdk-contentful-webhook)\n[![python](https://img.shields.io/badge/jsii-python-blueviolet.svg)](https://pypi.org/project/cloudcomponents.cdk-contentful-webhook/)\n\n> Create, update and delete contentful webhooks with your app deployment\n\n## Install\n\nTypeScript/JavaScript:\n\n```bash\nnpm i @cloudcomponents/cdk-contentful-webhook\n```\n\nPython:\n\n```bash\npip install cloudcomponents.cdk-contentful-webhook\n```\n\n## How to use\n\n```python\nimport { ContentfulWebhook } from '@cloudcomponents/cdk-contentful-webhook';\nimport { SecretKey } from '@cloudcomponents/cdk-secret-key';\nimport { Stack, StackProps, aws_apigateway } from 'aws-cdk-lib';\nimport { Construct } from 'constructs';\n\nexport class ContentfulWebhookStack extends Stack {\n constructor(scope: Construct, id: string, props?: StackProps) {\n super(scope, id, props);\n\n const api = new aws_apigateway.RestApi(this, 'Endpoint');\n api.root.addMethod('POST');\n\n if (typeof process.env.ACCESS_TOKEN === 'undefined') {\n throw new Error('environment variable ACCESS_TOKEN undefined');\n }\n const accessToken = SecretKey.fromPlainText(process.env.ACCESS_TOKEN);\n\n if (typeof process.env.SPACE_ID === 'undefined') {\n throw new Error('environment variable SPACE_ID undefined');\n }\n const spaceId = process.env.SPACE_ID;\n\n const topics = ['Entry.create'];\n\n new ContentfulWebhook(this, 'ContentfulWebhook', {\n accessToken,\n spaceId,\n name: 'ExampleWebhook',\n url: api.url,\n topics,\n logLevel: 'debug',\n });\n }\n}\n```\n\n## API Reference\n\nSee [API.md](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-contentful-webhook/API.md).\n\n## Example\n\nSee more complete [examples](https://github.com/cloudcomponents/cdk-constructs/tree/master/examples).\n\n## License\n\n[MIT](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-contentful-webhook/LICENSE)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Create, update and delete contentful webhooks with your app deployment",
"version": "2.3.0",
"project_urls": {
"Homepage": "https://github.com/cloudcomponents/cdk-constructs",
"Source": "https://github.com/cloudcomponents/cdk-constructs.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "da3fab1d9f92c10c725f3e88ded07ed1a02f569f001b79b1565a3ef23a9ab46f",
"md5": "97b800d98632d600a2c8a508abe86f24",
"sha256": "5386c6f99826681c3bfec2226cecb1b659c9bffa56b61a3b468ce368ca70b860"
},
"downloads": -1,
"filename": "cloudcomponents.cdk_contentful_webhook-2.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "97b800d98632d600a2c8a508abe86f24",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 1822776,
"upload_time": "2024-04-17T18:36:30",
"upload_time_iso_8601": "2024-04-17T18:36:30.116163Z",
"url": "https://files.pythonhosted.org/packages/da/3f/ab1d9f92c10c725f3e88ded07ed1a02f569f001b79b1565a3ef23a9ab46f/cloudcomponents.cdk_contentful_webhook-2.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1f28e3465d6f181fdf24f47aa8a5b2626a140c7bb19f230dd16b256e1947e71d",
"md5": "dfda8a42d8e269154ffc2dc312ce6cc4",
"sha256": "416a459a2e5056fb6ed6038b9d1ec9a1550550f9b8733cbfec1d45078feaabbc"
},
"downloads": -1,
"filename": "cloudcomponents.cdk-contentful-webhook-2.3.0.tar.gz",
"has_sig": false,
"md5_digest": "dfda8a42d8e269154ffc2dc312ce6cc4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 1823918,
"upload_time": "2024-04-17T18:36:38",
"upload_time_iso_8601": "2024-04-17T18:36:38.872744Z",
"url": "https://files.pythonhosted.org/packages/1f/28/e3465d6f181fdf24f47aa8a5b2626a140c7bb19f230dd16b256e1947e71d/cloudcomponents.cdk-contentful-webhook-2.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-17 18:36:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cloudcomponents",
"github_project": "cdk-constructs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cloudcomponents.cdk-contentful-webhook"
}