Skip to content

NordicSemiconductor/cloud-aws-cloudformation-helpers-js

CloudFormation Helpers npm version

GitHub Actions semantic-release Renovate @commitlint/config-conventional code style: prettier ESLint: TypeScript

Helper functions which simplify working with AWS CloudFormation stacks.

Installation

npm i --save-dev --save-exact @nordicsemiconductor/cloudformation-helpers

Usage

cfnResponse

cfnResponse implements sending custom resource responses.

import {
  cfnResponse,
  ResponseStatus,
} from "@nordicsemiconductor/cloudformation-helpers";
import { CloudFormationCustomResourceEvent } from "aws-lambda";

/**
 * Lambda creating a custom resource
 */
export const handler = async (
  event: CloudFormationCustomResourceEvent,
): Promise<void> => {
  // Create custom resource ...

  await cfnResponse({
    Status: ResponseStatus.SUCCESS,
    event,
    PhysicalResourceId: "MyCustomResource",
  });
};