p6-barrier
TypeScript icon, indicating that this package has built-in type declarations

0.1.75 • Public • Published

P6Barrier is an AWS CDK Construct that deploys a Custom Resource which will poll until AWS Lambda Function isReady returns true. Ideal for running code AFTER an RDS or EKS is ready.

P6Barrier

Badges

License Gitpod ready-to-code Build Release Mergify codecov Known Vulnerabilities

Distributions

npm version PyPI version NuGet version Maven Central

Summary

Use this to wait for an RDS or for that matter anything to become ready.

This deploys a Custom Resource which is obviously backed by an AWS Lambda. This lambda calls the lambda with Arn functionArn.

This function should return the string 'True' if the resource is ready. Otherwise 'False'. This function must be provided by you and is custom for your needs.

This is abstracted from @aws-cdk/aws-eks/cluster.ts where a Custom Resource which makes an SSM Parameter is used as a barrier for Resources to depend on until the EKS Cluster is ready for Helm to be run via an addHelmChart

Usage

Example 1 - External Lambda

import { P6Barrier } from 'p6-barrier';

new P6Barrier(this, 'p6-barrier', {
  name: 'some_useful_name',
  dependencies: [dep1, dep2],
  functionArn: "functionArn"
});

Example 2 - CDK Lambda (same stack)

import { P6Barrier } from 'p6-barrier';

const isReady = new lambdajs.NodejsFunction(this, 'isReady', {
  timeout: Duration.minutes(15),
  tracing: lambda.Tracing.ACTIVE,
});

new P6Barrier(this, 'p6-barrier', {
  name: 'some_useful_name',
  dependencies: [dep1, dep2],
  functionArn: isReady.functionArn,
});

Contributing

Code of Conduct

Changes

Authors

Philip M. Gollucci pgollucci@p6m7g8.com

Readme

Keywords

Package Sidebar

Install

npm i p6-barrier

Weekly Downloads

5

Version

0.1.75

License

Apache-2.0

Unpacked Size

61.7 MB

Total Files

1953

Last publish

Collaborators

  • pgollucci