{"id":42891881,"url":"https://github.com/horietakehiro/aws-cdk-utul","last_synced_at":"2026-01-30T14:59:19.357Z","repository":{"id":260068771,"uuid":"861471111","full_name":"horietakehiro/aws-cdk-utul","owner":"horietakehiro","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-25T15:04:18.000Z","size":1066,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-26T07:58:00.071Z","etag":null,"topics":["aws","aws-cdk","cloudformation","infrastructure-as-code","typescript","unittest"],"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/horietakehiro.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-23T00:52:01.000Z","updated_at":"2026-01-25T15:04:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"3affd704-4164-41bd-9224-edc72d9949af","html_url":"https://github.com/horietakehiro/aws-cdk-utul","commit_stats":null,"previous_names":["horietakehiro/aws-cdk-utul"],"tags_count":146,"template":false,"template_full_name":null,"purl":"pkg:github/horietakehiro/aws-cdk-utul","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horietakehiro%2Faws-cdk-utul","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horietakehiro%2Faws-cdk-utul/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horietakehiro%2Faws-cdk-utul/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horietakehiro%2Faws-cdk-utul/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/horietakehiro","download_url":"https://codeload.github.com/horietakehiro/aws-cdk-utul/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/horietakehiro%2Faws-cdk-utul/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","aws-cdk","cloudformation","infrastructure-as-code","typescript","unittest"],"created_at":"2026-01-30T14:59:19.291Z","updated_at":"2026-01-30T14:59:19.345Z","avatar_url":"https://github.com/horietakehiro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS CDK Unit Test Utility Library\n\n\u003cp align=\"left\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@horietakehiro/aws-cdk-utul?activeTab=readme\" \u003e \n        \u003cimg alt=\"NPM Version\" src=\"https://img.shields.io/npm/v/%40horietakehiro%2Faws-cdk-utul\"\u003e\n   \u003c/a\u003e\n\u003c/p\u003e\n\n**aws-cdk-utul(unit test utility library) makes it faster, more efficient with less mistakes for you to code AWS CDK unit tests.**\n\n---\n\n## Features\n\n---\n\n### TypedTemplate\n\n`TypedTemplate` class provides you proper type definitions for (almost) all AWS CloudFormation resource types. So you can easily and quickly code AWS CDK unit tests without trivial mistakes and googling.\n\n![type-hinting-1](./docs/type-hinting-1.png)\n\n\u003c!-- - You can use by just wrapping AWS CDK's `Template` class. --\u003e\n- You can use all methods implemented by AWS CDK's `Template` class with proper type definitions.\n- Return values of some methods - e.g. `findResources` - are changed from original ones, so that succeeding processes can handle and access them more easily.\n- You can still use AWS CDK's `Matcher` class and other arbitrary objects too.\n\n```js\nimport { Stack } from \"aws-cdk-lib\";\nimport { TypedTemplate } from \"@horietakehiro/aws-cdk-utul/lib/assertions\";\nimport { AWS_EC2_SUBNET, AWS_EC2_VPC } from \"@horietakehiro/aws-cdk-utul/lib/types/cfn-resource-types\";\nconst stack = new Stack()\n\nconst template = TypedTemplate.fromStack(stack)\n// you can execute all method implemented in original `Template` instance\ntemplate.hasResource(AWS_EC2_VPC({Properties: {\n  CidrBlock: \"10.0.0.0/16\"\n}}))\n// you can still use original `Matcher` class too.\nconst subnets = template.findResources(AWS_EC2_SUBNET({Properties: {\n  Tags: Match.arrayWith([\n    {Key: \"Name\", Value: Match.stringLikeRegexp(\"Public\")}\n  ])\n}}))\n// you can access resources with more efficient way\nsubnets.forEach((sn) =\u003e { \n  expect(sn.def.Properties?.CidrBlock?.endsWith(\"/24\")).toBe(true)\n})\n```\n\n---\n\n### ExtraMatch\n\n`ExtraMatch` class provides you some kind of a syntax sugar for AWS CDK's `Match` class.\n\n```js\nimport { ExtraMatch } from \"@horietakehiro/aws-cdk-utul/lib/assertions\"\n// get just vpc's logical id\nconst [{id}] = template.findResources(AWS_EC2_VPC({}))\ntemplate.allResources(AWS_EC2_SUBNET({\n  // Equals to {VpcId: {Ref: id}}\n  Properties: {VpcId: ExtraMatch.ref(id)}\n}))\ntemplate.hasOutput(\"VPCARN\", {\n  // Equals to {Value: {\"Fn::GetAtt\": [id, \"Arn\"]}}\n  Value: ExtraMatch.getAttArn(id)\n})\n```\n\n`ExtraMatch.iamPolicyLike` method provides schemas for [IAM Policy document](https://docs.aws.amazon.com/ja_jp/IAM/latest/UserGuide/reference_policies_grammar.html) - it's useful when defining tests for `AWS::IAM::Policy` and `AWS::IAM::Role`\n\n![](./docs/iam-policy-like.png)\n\n---\n\n`ExtraMatch.{arrayWith,arrayLike,objectLike,objectEquals,not,exact}` are same method as those of `Match` class but additionally provide type hints. These are useful to type-safely use `Matcher`\n\n![](./docs/ExtraMatch-type-hints-right.png)\n\n![](./docs/ExtraMatch-type-hints-wrong.png)\n\n---\n\n## Install\n\n```bash\nnpm install @horietakehiro/aws-cdk-utul\n```\n\nBy default, you may feel difficult to use this library because import path is too long for type hits to fit in IDE dialog box like below.\n\n![](./docs//default-tsconfig.png)\n\nSo I recommend that you add module alias settings in your `tsconfig.json` file like below.\n\n```json\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      \"@/cfn-types\": [\"node_modules/@horietakehiro/aws-cdk-utul/lib/types/cfn-resource-types\"],\n      \"@/cfn-types/*\": [\"node_modules/@horietakehiro/aws-cdk-utul/lib/types/cfn-resource-types/*\"]\n    }\n  }\n}\n```\n\n![](./docs/customized-tsconfig.png)\n\n---\n\n## Release policy\n\nThis package will be released new version every 3 days, so that catching up updates of AWS CloudFormation resource types and those schemas which will be happened frequently and irregularly.\n\n---\n\n\n## Some other notes\n\n- Schemas of AWS CloudFormation resource types used in this library are based on [those at `us-east-1`](https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/resource-type-schemas.html)\n- Compatible with AWS CDK v2.0.0 or greater.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhorietakehiro%2Faws-cdk-utul","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhorietakehiro%2Faws-cdk-utul","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhorietakehiro%2Faws-cdk-utul/lists"}