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
Distributions
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