Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed code sample and documentation clarity #12

Merged
merged 3 commits into from
Dec 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions .jsii
Original file line number Diff line number Diff line change
Expand Up @@ -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(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",
Expand Down Expand Up @@ -1050,5 +1050,5 @@
}
},
"version": "0.1.0",
"fingerprint": "6Xlh9ciL2TWmwUYFwzFsI5Yv6ADypdv6vBYK7BoRNl4="
"fingerprint": "E3kjr8b5AaUQfrAlzt4bk5ce+DPTEwDj0uBDQ1pVaDw="
}
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -38,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'],
});
Expand Down