Skip to content

Commit

Permalink
Merge pull request #9 from alvyn279/v1
Browse files Browse the repository at this point in the history
Documentation tweaks and CICD release automation
  • Loading branch information
alvyn279 authored Dec 18, 2020
2 parents 4822929 + 00fd6a1 commit 1ed4580
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "v*"

jobs:
build:
build_and_publish: # publish to package managers
runs-on: ubuntu-latest

steps:
Expand All @@ -15,7 +15,7 @@ jobs:
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}

- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
fetch-depth: 1

Expand All @@ -39,3 +39,33 @@ jobs:
uses: udondan/[email protected]
with:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

release: # release versioned source code to GitHub
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Extract repo attributes
id: attrs
uses: ibnesayeed/repo-attrs@master

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
## Changes in this release
Changes from `${{ steps.attrs.outputs.tail }}` to `${{ steps.attrs.outputs.head }}`
### Pull requests
${{ steps.attrs.outputs.prs }}
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\nA CDK construct that sets up email notification for when you exceed a given AWS estimated charges amount.\n\nCreate this construct in a billing stack **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).\nPlease read and perform the entire setup process carefully.\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#### Typescript\n\n```console\nnpm install --save 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 [email protected]\n // if estimated charges exceed 50 USD\n new BillingAlarm(stack, 'AWSAccountBillingAlarm', {\n monthlyThreshold: 50,\n emails: ['[email protected]'],\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 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 `[email protected]`\n // if estimated charges exceed 50 USD\n new BillingAlarm(stack, 'AWSAccountBillingAlarm', {\n monthlyThreshold: 50,\n emails: ['[email protected]'],\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": "YRvowwv1HRIUrh0sI9/jVzUHbp/tIlK6j0jF9IRKH5E="
"fingerprint": "6Xlh9ciL2TWmwUYFwzFsI5Yv6ADypdv6vBYK7BoRNl4="
}
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# aws-cdk-billing-alarm
[![Build status](https://github.com/alvyn279/aws-cdk-billing-alarm/workflows/build/badge.svg)](https://github.com/alvyn279/aws-cdk-billing-alarm/actions/)
[![NPM version](https://badge.fury.io/js/aws-cdk-billing-alarm.svg)](https://www.npmjs.com/package/aws-cdk-billing-alarm)
[![PyPI version](https://badge.fury.io/py/aws-cdk-billing-alarm.svg)](https://pypi.org/project/aws-cdk-billing-alarm/)

A CDK construct that sets up email notification for when you exceed a given AWS estimated charges amount.

Create this construct in a billing stack **with only a few lines**. This construct is an implementation of the manual
Create this construct in any stack you find appropriate **with only a few lines**. This construct is an implementation of the manual
setup described on [AWS Estimated Charges Monitoring](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/gs_monitor_estimated_charges_with_cloudwatch.html).
Please read and perform the entire setup process carefully.

## Get Started

Expand All @@ -20,10 +20,12 @@ 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
#### Typescript

```console
```shell
# node
npm install --save aws-cdk-billing-alarm
# python
pip install aws-cdk-billing-alarm
```

```typescript
Expand All @@ -34,7 +36,7 @@ export class CdkStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);

// Create an alarm that emails [email protected]
// Create an alarm that emails `[email protected]`
// if estimated charges exceed 50 USD
new BillingAlarm(stack, 'AWSAccountBillingAlarm', {
monthlyThreshold: 50,
Expand Down

0 comments on commit 1ed4580

Please sign in to comment.