cdk-events-notify is an AWS CDK Construct Library (currently v2.2.767) that provides a mechanism to trigger Lambda functions for push notifications to Line Notify or Slack. It primarily focuses on detecting AWS Console Login or switch role events via CloudTrail. The library is actively maintained with frequent updates, as indicated by its versioning and recent activity on PyPI and GitHub.
pip install cdk-events-notifyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up `cdk-events-notify` to send notifications to Line Notify for AWS console login events. It requires setting the `LINE_NOTIFY_TOKEN` environment variable and deploying the CDK stack. Ensure you have CloudTrail management events enabled for your account.
Migrate your AWS CDK application to v2 and ensure `cdk-events-notify` is installed for v2. Refer to the official AWS CDK migration guide.
Deploy `cdk-events-notify` stacks in each region where you expect to receive console login/switch role events, or ensure your CloudTrail configuration aggregates events to a central region where the stack is deployed.
Ensure `LINE_NOTIFY_TOKEN` or relevant Slack webhook configuration is provided to the `EventNotify` construct. Use AWS Secrets Manager or environment variables, avoiding hardcoding sensitive values.
Run `pip install cdk-events-notify` in your project's Python virtual environment. If using a `requirements.txt`, ensure it's listed and run `pip install -r requirements.txt`.
Set the `LINE_NOTIFY_TOKEN` environment variable before running `cdk deploy` or `cdk synth`. For example: `export LINE_NOTIFY_TOKEN='your-token-here'`.
Refactor your CDK application to avoid circular dependencies. This might involve combining resources into a single stack, using existing resources via `from_lookup` methods, or leveraging custom resources for advanced scenarios where native CDK constructs create circular references.