Skip to main content

p6-barrier

Project description

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

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from p6_barrier import P6Barrier

P6Barrier(self, "p6-barrier",
    name="some_useful_name",
    dependencies=[dep1, dep2],
    function_arn="functionArn"
)

Example 2 - CDK Lambda (same stack)

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from p6_barrier import P6Barrier

is_ready = lambdajs.NodejsFunction(self, "isReady",
    timeout=Duration.minutes(15),
    tracing=lambda_.Tracing.ACTIVE
)

P6Barrier(self, "p6-barrier",
    name="some_useful_name",
    dependencies=[dep1, dep2],
    function_arn=is_ready.function_arn
)

Contributing

Code of Conduct

Changes

Authors

Philip M. Gollucci pgollucci@p6m7g8.com

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

p6-barrier-0.1.107.tar.gz (8.1 MB view hashes)

Uploaded Source

Built Distribution

p6_barrier-0.1.107-py3-none-any.whl (8.1 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page