Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aereal/cdk-ecs-task-retirement-events-mackerel-annotator

cdk-ecs-task-retirement-events-mackerel-annotator provides AWS CDK resource class consists of Lambda function that annotates ECS task stop event and CloudWatch Events rule that invokes the Lambda function.
https://github.com/aereal/cdk-ecs-task-retirement-events-mackerel-annotator

aws-cdk

Last synced: 2 months ago
JSON representation

cdk-ecs-task-retirement-events-mackerel-annotator provides AWS CDK resource class consists of Lambda function that annotates ECS task stop event and CloudWatch Events rule that invokes the Lambda function.

Awesome Lists containing this project

README

        

![npm-badge][npm-badge]

# @aereal/cdk-ecs-task-retirement-events-mackerel-annotator

![mackerel-annotation-image][]

cdk-ecs-task-retirement-events-mackerel-annotator provides [AWS CDK][] resource class consists of Lambda function that annotates ECS task stop event
and CloudWatch Events rule that invokes the Lambda function.

## Install

```sh
npm install @aereal/cdk-ecs-task-retirement-events-mackerel-annotator
```

```sh
yarn add @aereal/cdk-ecs-task-retirement-events-mackerel-annotator
```

## Usage

```typescript
import { Stack } from "@aws-cdk/core";
import { StringParameter } from "@aws-cdk/aws-ssm";
import { FargateService } from "@aws-cdk/aws-ecs";
import { EcsServiceEventsMackerelAnnotator } from "@aereal/cdk-ecs-task-retirement-events-mackerel-annotator";

const stack = new Stack();

const service = new FargateService(...);

new EcsServiceEventsMackerelAnnotator(stack, "Annotator", {
mackerelApiKey: StringParameter.fromSecureStringParameterAttributes(
stack,
"MackerelAPIKey",
{
parameterName: "mackerel-api-key",
version: 1,
}
),
mackerelServiceRolesMappings: [
{
ecsService: service,
serviceRoles: {
service: "My-App",
roles: ["app"],
},
},
],
});
```

[AWS CDK]: https://docs.aws.amazon.com/cdk/latest/guide/home.html
[npm-badge]: https://img.shields.io/npm/v/@aereal/cdk-ecs-task-retirement-events-mackerel-annotator
[mackerel-annotation-image]: /docs/images/annotation.png