Metadata-Version: 2.1
Name: cdk-codepipeline-badge-notification
Version: 0.2.9
Summary: cdk-codepipeline-badge-notification
Home-page: https://github.com/kimisme9386/cdk-codepipeline-badge-notification
Author: Chris Yang
License: Apache-2.0
Project-URL: Source, https://github.com/kimisme9386/cdk-codepipeline-badge-notification
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: JavaScript
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Typing :: Typed
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

[![NPM version](https://badge.fury.io/js/cdk-codepipeline-badge-notification.svg)](https://badge.fury.io/js/cdk-codepipeline-badge-notification)
[![PyPI version](https://badge.fury.io/py/cdk-codepipeline-badge-notification.svg)](https://badge.fury.io/py/cdk-codepipeline-badge-notification)
[![Release](https://github.com/kimisme9386/cdk-codepipeline-badge-notification/actions/workflows/release.yml/badge.svg)](https://github.com/kimisme9386/cdk-codepipeline-badge-notification/actions/workflows/release.yml)

# CDK-CodePipeline-Badge-Notification

## Feature

* Generate badge when AWS CodePipeline state change
* Update GitHub commit status when AWS CodePipeline state change
* Notification for chat bot provider

  * Slack
  * Google
  * Telegram

## Usage

```python
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from cdk_pipeline_badge_notification import CodePipelineBadgeNotification
import aws_cdk.core as cdk
import aws_cdk.aws_codepipeline as code_pipeline

app = cdk.App()
env = {
    "region": process.env.CDK_DEFAULT_REGION,
    "account": process.env.CDK_DEFAULT_ACCOUNT
}
stack = cdk.Stack(app, "codepipeline-badge-notification", env=env)

pipeline = code_pipeline.Pipeline(stack, "TestPipeline",
    pipeline_name="testCodePipeline",
    cross_account_keys=False
)

CodePipelineBadgeNotification(stack, "CodePipelineBadgeNotification",
    pipeline_arn=pipeline.pipeline_arn,
    git_hub_token_from_secrets_manager={
        "secrets_manager_arn": "arn:aws:secretsmanager:ap-northeast-1:111111111111:secret:codepipeline/lambda/github-token-YWWmII",
        "secret_key": "codepipeline/lambda/github-token"
    },
    notification={
        "stage_name": "production",
        "ssm_slack_web_hook_url": "/chat/google/slack",
        "ssm_google_chat_web_hook_url": "/chat/google/webhook",
        "ssm_telegram_web_hook_url": "/chat/telegram/webhook"
    }
)
```

> :warning: telegram webhook url from ssm parameter which the URL is not include `text` query string

> gitHubTokenFromSecretsManager and notification is optional

#### Only badge

```python
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
CodePipelineBadgeNotification(stack, "CodePipelineBadgeNotification",
    pipeline_arn=pipeline.pipeline_arn
)
```


