cloudcomponents.cdk-contentful-webhook


Namecloudcomponents.cdk-contentful-webhook JSON
Version 2.4.0 PyPI version JSON
download
home_pagehttps://github.com/cloudcomponents/cdk-constructs
SummaryCreate, update and delete contentful webhooks with your app deployment
upload_time2024-05-16 19:33:36
maintainerNone
docs_urlNone
authorhupe1980
requires_python~=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![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/f7/41/272b8e1abc722f5236bb2d88589b6d1c59fd689121d6f979090c4db25e78/cloudcomponents.cdk-contentful-webhook-2.4.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.4.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": "2f16675eacf8b7f24f254160585c668a5d852a77cfa9376d89d72b8e81b072bd",
                "md5": "d3922795f996ea0e29cddc04f45ae357",
                "sha256": "ab653ad59c4a7063b2e11028cc9dfcbd088e92012eaed4db2abb5472ecb618ae"
            },
            "downloads": -1,
            "filename": "cloudcomponents.cdk_contentful_webhook-2.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d3922795f996ea0e29cddc04f45ae357",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 619635,
            "upload_time": "2024-05-16T19:33:27",
            "upload_time_iso_8601": "2024-05-16T19:33:27.703311Z",
            "url": "https://files.pythonhosted.org/packages/2f/16/675eacf8b7f24f254160585c668a5d852a77cfa9376d89d72b8e81b072bd/cloudcomponents.cdk_contentful_webhook-2.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f741272b8e1abc722f5236bb2d88589b6d1c59fd689121d6f979090c4db25e78",
                "md5": "96059a3a91b7fbaf2f095be64b0e7aff",
                "sha256": "c6ce1dd9ea26cc87dcc37f43e3d9cc0d106377a3fea60c354998f678bfb021c1"
            },
            "downloads": -1,
            "filename": "cloudcomponents.cdk-contentful-webhook-2.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "96059a3a91b7fbaf2f095be64b0e7aff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 620645,
            "upload_time": "2024-05-16T19:33:36",
            "upload_time_iso_8601": "2024-05-16T19:33:36.868785Z",
            "url": "https://files.pythonhosted.org/packages/f7/41/272b8e1abc722f5236bb2d88589b6d1c59fd689121d6f979090c4db25e78/cloudcomponents.cdk-contentful-webhook-2.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-16 19:33:36",
    "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"
}
        
Elapsed time: 0.21944s