Metadata-Version: 2.1
Name: p6-barrier
Version: 0.1.9
Summary: p6-barrier
Home-page: https://github.com/p6m7g8/p6-barrier.git
Author: Philip M. Gollucci<pgollucci@p6m7g8.com>
License: Apache-2.0
Project-URL: Source, https://github.com/p6m7g8/p6-barrier.git
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: JavaScript
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Typing :: Typed
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: aws-cdk.aws-iam (<2.0.0,>=1.76.0)
Requires-Dist: aws-cdk.aws-lambda (<2.0.0,>=1.76.0)
Requires-Dist: aws-cdk.aws-ssm (<2.0.0,>=1.76.0)
Requires-Dist: aws-cdk.core (<2.0.0,>=1.76.0)
Requires-Dist: aws-cdk.custom-resources (<2.0.0,>=1.76.0)
Requires-Dist: constructs (<4.0.0,>=3.2.27)
Requires-Dist: jsii (<2.0.0,>=1.15.0)
Requires-Dist: publication (>=0.0.3)

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

* [P6Barrier](#p6barrier)

  * [Badges](#badges)
  * [Distributions](#distributions)
  * [Summary](#summary)

    * [Usage](#usage)
    * [Example 1 - External Lambda](#example-1---external-lambda)
    * [Example 2 - CDK Lambda (same stack)](#example-2---cdk-lambda-same-stack)
  * [Contributing](#contributing)
  * [Code of Conduct](#code-of-conduct)
  * [Changes](#changes)
  * [Authors](#authors)

## Badges

[![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg)](https://opensource.org/licenses/Apache-2.0)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/p6m7g8/p6-barrier)
![Build](https://github.com/p6m7g8/p6-barrier/workflows/Build/badge.svg)
![Release](https://github.com/p6m7g8/p6-barrier/workflows/Release/badge.svg)
[![Mergify](https://img.shields.io/endpoint.svg?url=https://gh.mergify.io/badges/p6m7g8/p6-barrier/&style=flat)](https://mergify.io)
[![codecov](https://codecov.io/gh/p6m7g8/p6-barrier/branch/master/graph/badge.svg?token=14Yj1fZbew)](https://codecov.io/gh/p6m7g8/p6-barrier)
[![Known Vulnerabilities](https://snyk.io/test/github/p6m7g8/p6-barrier/badge.svg?targetFile=package.json)](https://snyk.io/test/github/p6m7g8/p6-barrier?targetFile=package.json)

## Distributions

[![npm version](https://badge.fury.io/js/p6-barrier!.svg)](https://badge.fury.io/js/p6-barrier)
[![PyPI version](https://badge.fury.io/py/p6-barrier!.svg)](https://badge.fury.io/py/p6-barrier)
[![NuGet version](https://badge.fury.io/nu/P6m7g8.P6Namer.svg)](https://badge.fury.io/nu/P6m7g8.P6Namer)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/P6m7g8.P6Namer/P6Namer/badge.svg)](https://maven-badges.herokuapp.com/maven-central/P6m7g8.P6Namer/P6Namer)

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

```python
# 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="functionArn"
)
```

### Example 2 - CDK Lambda (same stack)

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

is_ready = lambda_.Function(self, "isReady",
    runtime=lambda_.Runtime.PYTHON_3_8,
    timeout=Duration.minutes(15),
    tracing=lambda_.Tracing.ACTIVE,
    handler="index.handler",
    code=lambda_.Code.from_asset(path.join(__dirname, "../resources/lambda/isReady"))
)

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

## Contributing

* [How to Contribute](CONTRIBUTING.md)

## Code of Conduct

* [Code of Conduct](CODE_OF_CONDUCT.md)

## Changes

* [Change Log](CHANGELOG.md)

## Authors

Philip M. Gollucci [pgollucci@p6m7g8.com](mailto:pgollucci@p6m7g8.com)


