From d98dd9be6a9cf0ff1a3de67615bc0dc9b8a8c8eb Mon Sep 17 00:00:00 2001 From: alvyn le Date: Sat, 19 Dec 2020 11:20:38 -0500 Subject: [PATCH 1/3] chore(v1): [#8] explicitly linked python and ts docs --- .jsii | 4 ++-- README.md | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.jsii b/.jsii index 76a75fb..af6ec5d 100644 --- a/.jsii +++ b/.jsii @@ -932,7 +932,7 @@ }, "name": "aws-cdk-billing-alarm", "readme": { - "markdown": "# aws-cdk-billing-alarm\n[![Build status](https://github.com/alvyn279/aws-cdk-billing-alarm/workflows/build/badge.svg)](https://github.com/alvyn279/aws-cdk-billing-alarm/actions/)\n[![NPM version](https://badge.fury.io/js/aws-cdk-billing-alarm.svg)](https://www.npmjs.com/package/aws-cdk-billing-alarm)\n[![PyPI version](https://badge.fury.io/py/aws-cdk-billing-alarm.svg)](https://pypi.org/project/aws-cdk-billing-alarm/)\n\nA CDK construct that sets up email notification for when you exceed a given AWS estimated charges amount.\n\nCreate this construct in any stack you find appropriate **with only a few lines**. This construct is an implementation of the manual\nsetup described on [AWS Estimated Charges Monitoring](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/gs_monitor_estimated_charges_with_cloudwatch.html).\n\n## Get Started\n\n### Pre-Requisites\n\n> **IMPORTANT!** Only complete **_Step 1: Enable Billing Alerts_** of the following documentation link. This construct will take\ncare of creating the rest of the resources for you.\n\nYou must first enable billing alerts from the AWS Console as per [documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/gs_monitor_estimated_charges_with_cloudwatch.html#gs_turning_on_billing_metrics).\n\nBilling alerts will allow your AWS account to start collecting billing metrics (`EstimatedCharges`) on a periodic 6-hour basis.\n\n### Installation and Usage\n\n```shell\n# node\nnpm install --save aws-cdk-billing-alarm\n# python\npip install aws-cdk-billing-alarm\n```\n\n```typescript\nimport * as cdk from '@aws-cdk/core';\nimport { BillingAlarm } from 'aws-cdk-billing-alarm';\n\nexport class CdkStack extends cdk.Stack {\n constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {\n super(scope, id, props);\n\n // Create an alarm that emails `admin@example.com`\n // if estimated charges exceed 50 USD\n new BillingAlarm(stack, 'AWSAccountBillingAlarm', {\n monthlyThreshold: 50,\n emails: ['admin@example.com'],\n });\n }\n}\n```\n\n### Post-Deployment\n\nConfirm the subscription to the newly created topic for the emails you specified as endpoints in `BillingAlarmProps`.\nYou can do so by clicking on the `SubscribeURL` of the JSON email you received.\n> **Note**: If you did not receive the email, you can fire a **Request confirmation** for the subscription from the AWS SNS Console.\n\n\n## Limitations\n\n- [USD currency](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html#creating_billing_alarm_with_wizard)\n" + "markdown": "# aws-cdk-billing-alarm\n[![Build status](https://github.com/alvyn279/aws-cdk-billing-alarm/workflows/build/badge.svg)](https://github.com/alvyn279/aws-cdk-billing-alarm/actions/)\n[![NPM version](https://badge.fury.io/js/aws-cdk-billing-alarm.svg)](https://www.npmjs.com/package/aws-cdk-billing-alarm)\n[![PyPI version](https://badge.fury.io/py/aws-cdk-billing-alarm.svg)](https://pypi.org/project/aws-cdk-billing-alarm/)\n\nA CDK construct that sets up email notification for when you exceed a given AWS estimated charges amount.\n\nCreate this construct in any stack you find appropriate **with only a few lines**. This construct is an implementation of the manual\nsetup described on [AWS Estimated Charges Monitoring](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/gs_monitor_estimated_charges_with_cloudwatch.html).\n\n## Get Started\n\n### Pre-Requisites\n\n> **IMPORTANT!** Only complete **_Step 1: Enable Billing Alerts_** of the following documentation link. This construct will take\ncare of creating the rest of the resources for you.\n\nYou must first enable billing alerts from the AWS Console as per [documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/gs_monitor_estimated_charges_with_cloudwatch.html#gs_turning_on_billing_metrics).\n\nBilling alerts will allow your AWS account to start collecting billing metrics (`EstimatedCharges`) on a periodic 6-hour basis.\n\n### Installation\n\n#### [Node documentation](https://www.npmjs.com/package/aws-cdk-billing-alarm)\n```shell\nnpm install --save aws-cdk-billing-alarm\n```\n\n#### [Python documentation](https://pypi.org/project/aws-cdk-billing-alarm/)\n```shell\npip install aws-cdk-billing-alarm\n```\n\n### Usage\n```typescript\nimport * as cdk from '@aws-cdk/core';\nimport { BillingAlarm } from 'aws-cdk-billing-alarm';\n\nexport class CdkStack extends cdk.Stack {\n constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {\n super(scope, id, props);\n\n // Create an alarm that emails `admin@example.com`\n // if estimated charges exceed 50 USD\n new BillingAlarm(stack, 'AWSAccountBillingAlarm', {\n monthlyThreshold: 50,\n emails: ['admin@example.com'],\n });\n }\n}\n```\n\n### Post-Deployment\n\nConfirm the subscription to the newly created topic for the emails you specified as endpoints in `BillingAlarmProps`.\nYou can do so by clicking on the `SubscribeURL` of the JSON email you received.\n> **Note**: If you did not receive the email, you can fire a **Request confirmation** for the subscription from the AWS SNS Console.\n\n\n## Limitations\n\n- [USD currency](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html#creating_billing_alarm_with_wizard)\n" }, "repository": { "type": "git", @@ -1050,5 +1050,5 @@ } }, "version": "0.1.0", - "fingerprint": "6Xlh9ciL2TWmwUYFwzFsI5Yv6ADypdv6vBYK7BoRNl4=" + "fingerprint": "vcOCT7LYJzu74iobssUT9btfWr0Xkf1ET02ouDlGcg8=" } diff --git a/README.md b/README.md index 695d132..cb3b9ee 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,19 @@ You must first enable billing alerts from the AWS Console as per [documentation] Billing alerts will allow your AWS account to start collecting billing metrics (`EstimatedCharges`) on a periodic 6-hour basis. -### Installation and Usage +### Installation +#### [Node documentation](https://www.npmjs.com/package/aws-cdk-billing-alarm) ```shell -# node npm install --save aws-cdk-billing-alarm -# python +``` + +#### [Python documentation](https://pypi.org/project/aws-cdk-billing-alarm/) +```shell pip install aws-cdk-billing-alarm ``` +### Usage ```typescript import * as cdk from '@aws-cdk/core'; import { BillingAlarm } from 'aws-cdk-billing-alarm'; From 0ca2200ec3b46772c245d23b0ae9bc2a0f136048 Mon Sep 17 00:00:00 2001 From: alvyn le Date: Sat, 19 Dec 2020 11:22:51 -0500 Subject: [PATCH 2/3] fix(v1): [#10] Fixed naming of release in automation --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6847865..97a7ab0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -60,7 +60,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} + release_name: ${{ github.ref }} body: | ## Changes in this release From 1251b4a78053cf06f6004619ecad2cf8080c1626 Mon Sep 17 00:00:00 2001 From: alvyn le Date: Sat, 19 Dec 2020 11:24:21 -0500 Subject: [PATCH 3/3] fix(v1): [#11] fixed construct scope reference in code sample --- .jsii | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.jsii b/.jsii index af6ec5d..8a9a140 100644 --- a/.jsii +++ b/.jsii @@ -932,7 +932,7 @@ }, "name": "aws-cdk-billing-alarm", "readme": { - "markdown": "# aws-cdk-billing-alarm\n[![Build status](https://github.com/alvyn279/aws-cdk-billing-alarm/workflows/build/badge.svg)](https://github.com/alvyn279/aws-cdk-billing-alarm/actions/)\n[![NPM version](https://badge.fury.io/js/aws-cdk-billing-alarm.svg)](https://www.npmjs.com/package/aws-cdk-billing-alarm)\n[![PyPI version](https://badge.fury.io/py/aws-cdk-billing-alarm.svg)](https://pypi.org/project/aws-cdk-billing-alarm/)\n\nA CDK construct that sets up email notification for when you exceed a given AWS estimated charges amount.\n\nCreate this construct in any stack you find appropriate **with only a few lines**. This construct is an implementation of the manual\nsetup described on [AWS Estimated Charges Monitoring](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/gs_monitor_estimated_charges_with_cloudwatch.html).\n\n## Get Started\n\n### Pre-Requisites\n\n> **IMPORTANT!** Only complete **_Step 1: Enable Billing Alerts_** of the following documentation link. This construct will take\ncare of creating the rest of the resources for you.\n\nYou must first enable billing alerts from the AWS Console as per [documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/gs_monitor_estimated_charges_with_cloudwatch.html#gs_turning_on_billing_metrics).\n\nBilling alerts will allow your AWS account to start collecting billing metrics (`EstimatedCharges`) on a periodic 6-hour basis.\n\n### Installation\n\n#### [Node documentation](https://www.npmjs.com/package/aws-cdk-billing-alarm)\n```shell\nnpm install --save aws-cdk-billing-alarm\n```\n\n#### [Python documentation](https://pypi.org/project/aws-cdk-billing-alarm/)\n```shell\npip install aws-cdk-billing-alarm\n```\n\n### Usage\n```typescript\nimport * as cdk from '@aws-cdk/core';\nimport { BillingAlarm } from 'aws-cdk-billing-alarm';\n\nexport class CdkStack extends cdk.Stack {\n constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {\n super(scope, id, props);\n\n // Create an alarm that emails `admin@example.com`\n // if estimated charges exceed 50 USD\n new BillingAlarm(stack, 'AWSAccountBillingAlarm', {\n monthlyThreshold: 50,\n emails: ['admin@example.com'],\n });\n }\n}\n```\n\n### Post-Deployment\n\nConfirm the subscription to the newly created topic for the emails you specified as endpoints in `BillingAlarmProps`.\nYou can do so by clicking on the `SubscribeURL` of the JSON email you received.\n> **Note**: If you did not receive the email, you can fire a **Request confirmation** for the subscription from the AWS SNS Console.\n\n\n## Limitations\n\n- [USD currency](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html#creating_billing_alarm_with_wizard)\n" + "markdown": "# aws-cdk-billing-alarm\n[![Build status](https://github.com/alvyn279/aws-cdk-billing-alarm/workflows/build/badge.svg)](https://github.com/alvyn279/aws-cdk-billing-alarm/actions/)\n[![NPM version](https://badge.fury.io/js/aws-cdk-billing-alarm.svg)](https://www.npmjs.com/package/aws-cdk-billing-alarm)\n[![PyPI version](https://badge.fury.io/py/aws-cdk-billing-alarm.svg)](https://pypi.org/project/aws-cdk-billing-alarm/)\n\nA CDK construct that sets up email notification for when you exceed a given AWS estimated charges amount.\n\nCreate this construct in any stack you find appropriate **with only a few lines**. This construct is an implementation of the manual\nsetup described on [AWS Estimated Charges Monitoring](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/gs_monitor_estimated_charges_with_cloudwatch.html).\n\n## Get Started\n\n### Pre-Requisites\n\n> **IMPORTANT!** Only complete **_Step 1: Enable Billing Alerts_** of the following documentation link. This construct will take\ncare of creating the rest of the resources for you.\n\nYou must first enable billing alerts from the AWS Console as per [documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/gs_monitor_estimated_charges_with_cloudwatch.html#gs_turning_on_billing_metrics).\n\nBilling alerts will allow your AWS account to start collecting billing metrics (`EstimatedCharges`) on a periodic 6-hour basis.\n\n### Installation\n\n#### [Node documentation](https://www.npmjs.com/package/aws-cdk-billing-alarm)\n```shell\nnpm install --save aws-cdk-billing-alarm\n```\n\n#### [Python documentation](https://pypi.org/project/aws-cdk-billing-alarm/)\n```shell\npip install aws-cdk-billing-alarm\n```\n\n### Usage\n```typescript\nimport * as cdk from '@aws-cdk/core';\nimport { BillingAlarm } from 'aws-cdk-billing-alarm';\n\nexport class CdkStack extends cdk.Stack {\n constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {\n super(scope, id, props);\n\n // Create an alarm that emails `admin@example.com`\n // if estimated charges exceed 50 USD\n new BillingAlarm(this, 'AWSAccountBillingAlarm', {\n monthlyThreshold: 50,\n emails: ['admin@example.com'],\n });\n }\n}\n```\n\n### Post-Deployment\n\nConfirm the subscription to the newly created topic for the emails you specified as endpoints in `BillingAlarmProps`.\nYou can do so by clicking on the `SubscribeURL` of the JSON email you received.\n> **Note**: If you did not receive the email, you can fire a **Request confirmation** for the subscription from the AWS SNS Console.\n\n\n## Limitations\n\n- [USD currency](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html#creating_billing_alarm_with_wizard)\n" }, "repository": { "type": "git", @@ -1050,5 +1050,5 @@ } }, "version": "0.1.0", - "fingerprint": "vcOCT7LYJzu74iobssUT9btfWr0Xkf1ET02ouDlGcg8=" + "fingerprint": "E3kjr8b5AaUQfrAlzt4bk5ce+DPTEwDj0uBDQ1pVaDw=" } diff --git a/README.md b/README.md index cb3b9ee..2467ed9 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ export class CdkStack extends cdk.Stack { // Create an alarm that emails `admin@example.com` // if estimated charges exceed 50 USD - new BillingAlarm(stack, 'AWSAccountBillingAlarm', { + new BillingAlarm(this, 'AWSAccountBillingAlarm', { monthlyThreshold: 50, emails: ['admin@example.com'], });