{"id":15396639,"url":"https://github.com/hupe1980/custom-resource-helper","last_synced_at":"2025-04-16T00:23:09.485Z","repository":{"id":33973212,"uuid":"163998632","full_name":"hupe1980/custom-resource-helper","owner":"hupe1980","description":"A helper for cloudformation custom resources","archived":false,"fork":false,"pushed_at":"2023-01-06T01:37:55.000Z","size":1319,"stargazers_count":2,"open_issues_count":14,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-07T05:27:35.617Z","etag":null,"topics":["aws","cloudformation","customresource","lambda"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hupe1980.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-03T16:42:57.000Z","updated_at":"2024-08-20T20:36:16.000Z","dependencies_parsed_at":"2023-01-15T03:43:49.644Z","dependency_job_id":null,"html_url":"https://github.com/hupe1980/custom-resource-helper","commit_stats":null,"previous_names":["cloudcomponents/custom-resource-helper"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fcustom-resource-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fcustom-resource-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fcustom-resource-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fcustom-resource-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hupe1980","download_url":"https://codeload.github.com/hupe1980/custom-resource-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249174382,"owners_count":21224707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cloudformation","customresource","lambda"],"created_at":"2024-10-01T15:34:26.781Z","updated_at":"2025-04-16T00:23:09.408Z","avatar_url":"https://github.com/hupe1980.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# custom-resource-helper\n\n[![Build Status](https://travis-ci.org/hupe1980/custom-resource-helper.svg?branch=master)](https://travis-ci.org/hupe1980/custom-resource-helper)\n\n\u003e A helper for cloudformation custom resources\n\n## Install\n\n```bash\nnpm install --save custom-resource-helper\n```\n\n## How to use\n\n```typescript\nimport { customResourceHelper, ResourceHandler, ResourceHandlerReturn } from 'custom-resource-helper';\n\nexport const handler = customResourceHelper(\n  (): ResourceHandler =\u003e ({\n    onCreate: async (event, context, logger): Promise\u003cResourceHandlerReturn\u003e =\u003e {\n      // Place your code to handle Create events here.\n      const physicalResourceId = 'myResourceId';\n      const responseData = {};\n\n      return {\n        physicalResourceId,\n        responseData\n      };\n    },\n    onUpdate: async (event, context, logger): Promise\u003cResourceHandlerReturn\u003e =\u003e {\n      // Place your code to handle Update events here.\n      const physicalResourceId = event.PhysicalResourceId;\n      const responseData = {};\n\n      return {\n        physicalResourceId,\n        responseData\n      };\n    },\n    onDelete: async (event, context, logger): Promise\u003cvoid\u003e =\u003e {\n      // Place your code to handle Delete events here\n      return;\n    }\n  })\n  /* optional: customLogFactory */\n);\n```\n\n## Logging\n\nBy default log level is set to warning. This can be customized with a custom LogFactory or by defining the \"LogLevel\" property in the custom resource resource in your template. For example:\n\n```json\n\"MyCustomResource\": {\n    \"Type\": \"AWS::CloudFormation::CustomResource\",\n    \"Properties\": {\n        \"LogLevel\": \"debug\",\n        //...\n    }\n}\n```\n\n## Utils\n\n```typescript\nimport { camelizeKeys } from 'custom-resource-helper';\n//...\nconsole.log(event);\n/*\n{\n  ...\n  ResourceProperties: {\n    ...\n    BucketName: 'testbucket',\n    ---\n  }\n  ...\n}\n*/\nconst {\n  resourceProperties: { bucketName }\n} = camelizeKeys(event);\n\nconsole.log(bucketName); //prints: testBuckets\n//...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhupe1980%2Fcustom-resource-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhupe1980%2Fcustom-resource-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhupe1980%2Fcustom-resource-helper/lists"}