npm install aws-slack-cost-reporter@0.0.3
SlackCostReporter
The constructs sets up a chatbot sending cost reports of the current bill & the expected forecast to a slack channel based on a rate or schedule.
To use this construct, manual steps are required to be able to authorize with the AWS account. Therefore, navigate to {@link https://us-east-2.console.aws.amazon.com/chatbot/home} and configure the slack client corresponding to the {@link SlackCostReporterProps.slackWorkspaceId}. Right now, this is neither possible via the CLI, nor CloudFormation. If this is not done, the deployment is going to fail with the error message "Invalid request provided: AWS Chatbot can't create the configuration because Slack workspace *** is not authorized with AWS account ***".
import { SlackCostReporter } from 'aws-slack-cost-reporter'new SlackCostReporter(scope: Construct, id: string, props: SlackCostReporterProps)
| Name | Type | Description |
|---|---|---|
scope | Construct | No description. |
id | string | No description. |
props | SlackCostReporterProps | No description. |
- Type: Construct
- Type: string
- Type: SlackCostReporterProps
| Name | Description |
|---|---|
toString | Returns a string representation of this construct. |
public toString(): string
Returns a string representation of this construct.
| Name | Description |
|---|---|
isConstruct | Checks if x is a construct. |
import { SlackCostReporter } from 'aws-slack-cost-reporter'SlackCostReporter.isConstruct(x: any)
Checks if x is a construct.
Use this method instead of instanceof to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct in each copy of the constructs library
is seen as a different class, and an instance of one class will not test as
instanceof the other class. npm install will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof will behave
unpredictably. It is safest to avoid using instanceof, and using
this type-testing method instead.
- Type: any
Any object.
public readonly node: Node;
- Type: Node
The tree node.
Use the snippets below in your Git repositories or elsewhere to add a button that links to this package. The button will automatically update to light mode or dark mode based on whether the user's client has requested a light or dark theme.
[](https://constructs.dev/packages/aws-slack-cost-reporter)
<a href="https://constructs.dev/packages/aws-slack-cost-reporter"><img src="https://constructs.dev/badge?package=aws-slack-cost-reporter" alt="View on Construct Hub"/></a>
