@layertwo/cdk-constructs 0.0.14 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.jsii CHANGED
@@ -9870,7 +9870,7 @@
9870
9870
  },
9871
9871
  "name": "@layertwo/cdk-constructs",
9872
9872
  "readme": {
9873
- "markdown": "# @layertwo/cdk-constructs\n\nReusable [AWS CDK](https://aws.amazon.com/cdk/) constructs with secure defaults baked in, for TypeScript projects.\n\nPublished to [npm](https://www.npmjs.com/package/@layertwo/cdk-constructs) as a JSII library. Only the TypeScript/JS package is published.\n\n## Installation\n\n```bash\nnpm install @layertwo/cdk-constructs\n```\n\n## Constructs\n\n| Construct | Extends | Enforced behaviour |\n| ------------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |\n| `SecureBucket` | `s3.Bucket` | Blocks all public access, S3-managed encryption, SSL enforced. Versioning on by default (`versioned: false` to opt out). |\n| `SecureTable` | `dynamodb.Table` | On-demand billing (`PAY_PER_REQUEST`), point-in-time recovery always enabled. |\n| `GitHubOidcRole` | `iam.Role` | Role assumable by GitHub Actions via OIDC, scoped to a repo and optionally a branch or environment. |\n| `DnsValidatedCertificate` | `certificatemanager.Certificate` | Always DNS-validated against the supplied Route53 hosted zone. |\n| `PythonFunction` | `lambda.Function` | Bundles a `uv` project in Docker, hashes the source tree (no re-upload when nothing changed), ARM64 + Python 3.15 by default. |\n| `UvLayer` | `lambda.LayerVersion` | Packages a `uv` project's dependencies under `/opt/python`, ARM64 + Python 3.15 by default. |\n\nEverything marked _enforced_ is hardcoded after your props are spread in — passing your own value for it is silently ignored. All other props pass straight through to the parent construct.\n\n## Usage\n\n```typescript\nimport * as path from \"node:path\";\nimport {\n DnsValidatedCertificate,\n GitHubOidcRole,\n PythonFunction,\n SecureBucket,\n SecureTable,\n UvLayer,\n} from \"@layertwo/cdk-constructs\";\nimport { HostedZone } from \"aws-cdk-lib/aws-route53\";\n\n// S3: public access blocked, encrypted, SSL-only, versioned\nconst bucket = new SecureBucket(this, \"Assets\");\n\n// DynamoDB: on-demand + PITR\nconst table = new SecureTable(this, \"Sessions\", {\n partitionKey: { name: \"id\", type: dynamodb.AttributeType.STRING },\n});\n\n// IAM role for a GitHub Actions workflow on main\nconst deployRole = new GitHubOidcRole(this, \"DeployRole\", {\n owner: \"layertwo\",\n repo: \"my-app\",\n branch: \"main\",\n});\n\n// ACM certificate validated via Route53\nnew DnsValidatedCertificate(this, \"Cert\", {\n domainName: \"example.com\",\n hostedZone: HostedZone.fromLookup(this, \"Zone\", {\n domainName: \"example.com\",\n }),\n});\n\n// Python Lambda from a uv project (built in Docker at synth time)\nnew PythonFunction(this, \"Fetcher\", {\n rootDir: path.join(__dirname, \"../services/fetcher\"),\n index: \"src/entrypoint/__init__.py\",\n handler: \"handle_event\",\n environment: { TABLE_NAME: table.tableName },\n});\n```\n\n### Python bundling and caching\n\n`PythonFunction` builds inside AWS's SAM build image for the Python version, so it needs Docker at synth time. The image ships `uv` and a C toolchain, and its glibc matches Lambda. The asset is fingerprinted from the project source — `uv.lock` changes rebuild it, caches and `.venv` do not.\n\nTwo things make that fast in CI:\n\n```yaml\n# Skip bundling entirely when the source hash matches a previous run.\n- uses: actions/cache@v4\n with:\n path: cdk.out\n key: cdk-assets-${{ github.sha }}\n restore-keys: cdk-assets-\n\n# Cache the image layers; type=gha needs BuildKit, and fails on a plain local daemon.\n- uses: docker/setup-buildx-action@v3\n```\n\n```typescript\nconst cacheScope = \"lambda-bundling\";\nnew PythonFunction(this, \"Fetcher\", {\n rootDir,\n bundling: process.env.CI\n ? {\n cacheFrom: [{ type: \"gha\", params: { scope: cacheScope } }],\n cacheTo: { type: \"gha\", params: { mode: \"max\", scope: cacheScope } },\n }\n : {},\n});\n```\n\nThe default image is AWS's SAM build image for the selected Python version, so dependencies that need a C toolchain build normally. Pass `bundling.image` to use your own build image.\n\n### Python layers\n\n`UvLayer` packages a project's third-party dependencies into a layer at `/opt/python`. It uses the same bundling engine and defaults as `PythonFunction`; pass it through the function's `layers` prop. A layer is built for one runtime and architecture, so keep them aligned with the functions that use it.\n\n`PythonFunction` still installs its own project's dependencies into the function package, so the layer only saves space when the function's project holds app code and no runtime dependencies. Put the dependencies in the layer's project, or share one layer across functions.\n\n```typescript\nconst deps = new UvLayer(this, \"Deps\", {\n rootDir: path.join(__dirname, \"../layers/deps\"),\n});\n\nnew PythonFunction(this, \"Fetcher\", {\n rootDir: path.join(__dirname, \"../services/fetcher\"),\n layers: [deps],\n});\n```\n\n## Development\n\nThis project uses [Projen](https://projen.io/) for configuration and build management. Configuration lives in `.projenrc.ts`.\n\n### Setup\n\n```bash\nyarn install\nnpx projen # regenerate project files from .projenrc.ts\n```\n\nNode.js 22 or 24 (the versions jsii supports). Dependency upgrades arrive as Renovate PRs — there is no local upgrade task.\n\n### Common commands\n\n```bash\nnpm run build # full build: compile (jsii) + test + package\nnpm run compile # compile TypeScript only\nnpm test # tests with coverage\nnpm run test:watch # tests in watch mode\nnpm run eslint # linter\nnpm run package # generate distributable packages\nnpx projen # re-synthesize generated files\n```\n\n### Making changes\n\n1. Add the construct in `src/` and export it from `src/index.ts`.\n2. Add a matching `test/<name>.test.ts` using CDK assertions.\n3. Run `npm run build`.\n4. For build/config changes, edit `.projenrc.ts` and run `npx projen`.\n\nDo not edit files marked `~~ Generated by projen` — change `.projenrc.ts` and regenerate instead.\n\n## Technology Stack\n\n- **Language**: TypeScript 5.9\n- **Framework**: AWS CDK 2.275.0\n- **Testing**: Jest 30 with ts-jest and CDK assertions\n- **Linting**: ESLint 9 + Prettier\n- **Publishing**: JSII\n\n## Contributing\n\nEnsure `npm run build` passes before opening a PR. Commits on `mainline` follow conventional commits; the release workflow bumps the version and publishes.\n\n## License\n\nApache-2.0\n\n## Author\n\nLucas Messenger (1335960+layertwo@users.noreply.github.com)\n\n## Repository\n\nhttps://github.com/layertwo/cdk-constructs\n"
9873
+ "markdown": "# @layertwo/cdk-constructs\n\nReusable [AWS CDK](https://aws.amazon.com/cdk/) constructs with secure defaults baked in, for TypeScript projects.\n\nPublished to [npm](https://www.npmjs.com/package/@layertwo/cdk-constructs) as a JSII library. Only the TypeScript/JS package is published.\n\n## Installation\n\n```bash\nnpm install @layertwo/cdk-constructs\n```\n\n## Constructs\n\n| Export | Applies to | Defaults |\n| ----------------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |\n| `BucketDefaultsInjector` | `s3.Bucket` | Blocks all public access, S3-managed encryption, SSL enforced, versioning on. Skips `encryption` when `encryptionKey` is set, and `blockPublicAccess` when a public `accessControl` is set. |\n| `TableDefaultsInjector` | `dynamodb.Table` | On-demand billing (`PAY_PER_REQUEST`), point-in-time recovery, deletion protection. Skipped when provisioned capacity is passed. |\n| `LogGroupDefaultsInjector` | `logs.LogGroup` | One month retention. Logs are never destroyed with the stack. |\n| `KeyDefaultsInjector` | `kms.Key` | Key rotation enabled for symmetric keys. |\n| `DistributionDefaultsInjector` | `cloudfront.Distribution` | TLS 1.2 (2021) floor when a certificate is set, `PRICE_CLASS_100`. |\n| `GitHubOidcRole` | `iam.Role` | Role assumable by GitHub Actions via OIDC, scoped to a repo and optionally a branch or environment. |\n| `DnsValidatedCertificate` | `certificatemanager.Certificate` | Always DNS-validated against the supplied Route53 hosted zone. |\n| `PythonFunction` | `lambda.Function` | Bundles a `uv` project in Docker, hashes the source tree (no re-upload when nothing changed), ARM64 + Python 3.15 by default. |\n| `UvLayer` | `lambda.LayerVersion` | Packages a `uv` project's dependencies under `/opt/python`, ARM64 + Python 3.15 by default. |\n\n`layertwoDefaults()` returns all five injectors. They only fill props you leave unset, so passing your own value wins. `API.md` lists classes only; `layertwoDefaults()` is the TypeScript entry point. The other constructs enforce their listed behaviour even when you pass the same prop; all unlisted props pass straight through.\n\nUpgrading from `SecureBucket` / `SecureTable`? They are removed. Use the plain `s3.Bucket` / `dynamodb.Table` L2s with `layertwoDefaults()`. The old classes forced their security props; the injectors only fill unset props, so explicit values now win. For a public website bucket, pass `publicReadAccess: true` together with `blockPublicAccess: BlockPublicAccess.BLOCK_ACLS`.\n\nTwo cases need care before you adopt this in an existing stack. Log groups without a retention keep two years by default; adopting this shortens them to 30 days and CloudWatch deletes older events, so set `retention` on groups you need to keep longer. Tables with provisioned secondary indexes (`addGlobalSecondaryIndex` with `readCapacity`/`writeCapacity`) need `billingMode: BillingMode.PROVISIONED`, because the default is on-demand.\n\n## Usage\n\n```typescript\nimport * as path from \"node:path\";\nimport { App } from \"aws-cdk-lib\";\nimport {\n DnsValidatedCertificate,\n GitHubOidcRole,\n PythonFunction,\n UvLayer,\n layertwoDefaults,\n} from \"@layertwo/cdk-constructs\";\nimport { AttributeType, Table } from \"aws-cdk-lib/aws-dynamodb\";\nimport { HostedZone } from \"aws-cdk-lib/aws-route53\";\nimport { BlockPublicAccess, Bucket } from \"aws-cdk-lib/aws-s3\";\n\n// Register the baseline once for every stack in the app\nconst app = new App({ propertyInjectors: layertwoDefaults() });\n// then create your stacks with `new MyStack(app, \"MyStack\")`\n\n// Inside a stack: plain L2s pick up the defaults\nconst bucket = new Bucket(this, \"Assets\");\n\nconst table = new Table(this, \"Sessions\", {\n partitionKey: { name: \"id\", type: AttributeType.STRING },\n});\n\n// IAM role for a GitHub Actions workflow on main\nconst deployRole = new GitHubOidcRole(this, \"DeployRole\", {\n owner: \"layertwo\",\n repo: \"my-app\",\n branch: \"main\",\n});\n\n// ACM certificate validated via Route53\nnew DnsValidatedCertificate(this, \"Cert\", {\n domainName: \"example.com\",\n hostedZone: HostedZone.fromLookup(this, \"Zone\", {\n domainName: \"example.com\",\n }),\n});\n\n// Python Lambda from a uv project (built in Docker at synth time)\nnew PythonFunction(this, \"Fetcher\", {\n rootDir: path.join(__dirname, \"../services/fetcher\"),\n index: \"src/entrypoint/__init__.py\",\n handler: \"handle_event\",\n environment: { TABLE_NAME: table.tableName },\n});\n```\n\n### Python bundling and caching\n\n`PythonFunction` builds inside AWS's SAM build image for the Python version, so it needs Docker at synth time. The image ships `uv` and a C toolchain, and its glibc matches Lambda. The asset is fingerprinted from the project source — `uv.lock` changes rebuild it, caches and `.venv` do not.\n\nTwo things make that fast in CI:\n\n```yaml\n# Skip bundling entirely when the source hash matches a previous run.\n- uses: actions/cache@v4\n with:\n path: cdk.out\n key: cdk-assets-${{ github.sha }}\n restore-keys: cdk-assets-\n\n# Cache the image layers; type=gha needs BuildKit, and fails on a plain local daemon.\n- uses: docker/setup-buildx-action@v3\n```\n\n```typescript\nconst cacheScope = \"lambda-bundling\";\nnew PythonFunction(this, \"Fetcher\", {\n rootDir,\n bundling: process.env.CI\n ? {\n cacheFrom: [{ type: \"gha\", params: { scope: cacheScope } }],\n cacheTo: { type: \"gha\", params: { mode: \"max\", scope: cacheScope } },\n }\n : {},\n});\n```\n\nThe default image is AWS's SAM build image for the selected Python version, so dependencies that need a C toolchain build normally. Pass `bundling.image` to use your own build image.\n\n### Python layers\n\n`UvLayer` packages a project's third-party dependencies into a layer at `/opt/python`. It uses the same bundling engine and defaults as `PythonFunction`; pass it through the function's `layers` prop. A layer is built for one runtime and architecture, so keep them aligned with the functions that use it.\n\n`PythonFunction` still installs its own project's dependencies into the function package, so the layer only saves space when the function's project holds app code and no runtime dependencies. Put the dependencies in the layer's project, or share one layer across functions.\n\n```typescript\nconst deps = new UvLayer(this, \"Deps\", {\n rootDir: path.join(__dirname, \"../layers/deps\"),\n});\n\nnew PythonFunction(this, \"Fetcher\", {\n rootDir: path.join(__dirname, \"../services/fetcher\"),\n layers: [deps],\n});\n```\n\n## Development\n\nThis project uses [Projen](https://projen.io/) for configuration and build management. Configuration lives in `.projenrc.ts`.\n\n### Setup\n\n```bash\nyarn install\nnpx projen # regenerate project files from .projenrc.ts\n```\n\nNode.js 22 or 24 (the versions jsii supports). Dependency upgrades arrive as Renovate PRs — there is no local upgrade task.\n\n### Common commands\n\n```bash\nnpm run build # full build: compile (jsii) + test + package\nnpm run compile # compile TypeScript only\nnpm test # tests with coverage\nnpm run test:watch # tests in watch mode\nnpm run eslint # linter\nnpm run package # generate distributable packages\nnpx projen # re-synthesize generated files\n```\n\n### Making changes\n\n1. Add the construct in `src/` and export it from `src/index.ts`.\n2. Add a matching `test/<name>.test.ts` using CDK assertions.\n3. Run `npm run build`.\n4. For build/config changes, edit `.projenrc.ts` and run `npx projen`.\n\nDo not edit files marked `~~ Generated by projen` — change `.projenrc.ts` and regenerate instead.\n\n## Technology Stack\n\n- **Language**: TypeScript 5.9\n- **Framework**: AWS CDK 2.275.0\n- **Testing**: Jest 30 with ts-jest and CDK assertions\n- **Linting**: ESLint 9 + Prettier\n- **Publishing**: JSII\n\n## Contributing\n\nEnsure `npm run build` passes before opening a PR. Commits on `mainline` follow conventional commits; the release workflow bumps the version and publishes.\n\n## License\n\nApache-2.0\n\n## Author\n\nLucas Messenger (1335960+layertwo@users.noreply.github.com)\n\n## Repository\n\nhttps://github.com/layertwo/cdk-constructs\n"
9874
9874
  },
9875
9875
  "repository": {
9876
9876
  "type": "git",
@@ -9883,6 +9883,156 @@
9883
9883
  }
9884
9884
  },
9885
9885
  "types": {
9886
+ "@layertwo/cdk-constructs.BucketDefaultsInjector": {
9887
+ "assembly": "@layertwo/cdk-constructs",
9888
+ "docs": {
9889
+ "remarks": "Explicit props win.",
9890
+ "stability": "stable",
9891
+ "summary": "Secure S3 bucket defaults."
9892
+ },
9893
+ "fqn": "@layertwo/cdk-constructs.BucketDefaultsInjector",
9894
+ "initializer": {
9895
+ "docs": {
9896
+ "stability": "stable"
9897
+ }
9898
+ },
9899
+ "interfaces": [
9900
+ "aws-cdk-lib.IPropertyInjector"
9901
+ ],
9902
+ "kind": "class",
9903
+ "locationInModule": {
9904
+ "filename": "src/injectors.ts",
9905
+ "line": 24
9906
+ },
9907
+ "methods": [
9908
+ {
9909
+ "docs": {
9910
+ "stability": "stable",
9911
+ "summary": "The injector to be applied to the constructor properties of the Construct."
9912
+ },
9913
+ "locationInModule": {
9914
+ "filename": "src/injectors.ts",
9915
+ "line": 27
9916
+ },
9917
+ "name": "inject",
9918
+ "overrides": "aws-cdk-lib.IPropertyInjector",
9919
+ "parameters": [
9920
+ {
9921
+ "name": "originalProps",
9922
+ "type": {
9923
+ "primitive": "any"
9924
+ }
9925
+ },
9926
+ {
9927
+ "name": "_context",
9928
+ "type": {
9929
+ "fqn": "aws-cdk-lib.InjectionContext"
9930
+ }
9931
+ }
9932
+ ],
9933
+ "returns": {
9934
+ "type": {
9935
+ "primitive": "any"
9936
+ }
9937
+ }
9938
+ }
9939
+ ],
9940
+ "name": "BucketDefaultsInjector",
9941
+ "properties": [
9942
+ {
9943
+ "docs": {
9944
+ "stability": "stable",
9945
+ "summary": "The unique Id of the Construct class."
9946
+ },
9947
+ "immutable": true,
9948
+ "locationInModule": {
9949
+ "filename": "src/injectors.ts",
9950
+ "line": 25
9951
+ },
9952
+ "name": "constructUniqueId",
9953
+ "overrides": "aws-cdk-lib.IPropertyInjector",
9954
+ "type": {
9955
+ "primitive": "string"
9956
+ }
9957
+ }
9958
+ ],
9959
+ "symbolId": "src/injectors:BucketDefaultsInjector"
9960
+ },
9961
+ "@layertwo/cdk-constructs.DistributionDefaultsInjector": {
9962
+ "assembly": "@layertwo/cdk-constructs",
9963
+ "docs": {
9964
+ "remarks": "Explicit props win.",
9965
+ "stability": "stable",
9966
+ "summary": "CloudFront TLS floor and price class."
9967
+ },
9968
+ "fqn": "@layertwo/cdk-constructs.DistributionDefaultsInjector",
9969
+ "initializer": {
9970
+ "docs": {
9971
+ "stability": "stable"
9972
+ }
9973
+ },
9974
+ "interfaces": [
9975
+ "aws-cdk-lib.IPropertyInjector"
9976
+ ],
9977
+ "kind": "class",
9978
+ "locationInModule": {
9979
+ "filename": "src/injectors.ts",
9980
+ "line": 115
9981
+ },
9982
+ "methods": [
9983
+ {
9984
+ "docs": {
9985
+ "stability": "stable",
9986
+ "summary": "The injector to be applied to the constructor properties of the Construct."
9987
+ },
9988
+ "locationInModule": {
9989
+ "filename": "src/injectors.ts",
9990
+ "line": 119
9991
+ },
9992
+ "name": "inject",
9993
+ "overrides": "aws-cdk-lib.IPropertyInjector",
9994
+ "parameters": [
9995
+ {
9996
+ "name": "originalProps",
9997
+ "type": {
9998
+ "primitive": "any"
9999
+ }
10000
+ },
10001
+ {
10002
+ "name": "_context",
10003
+ "type": {
10004
+ "fqn": "aws-cdk-lib.InjectionContext"
10005
+ }
10006
+ }
10007
+ ],
10008
+ "returns": {
10009
+ "type": {
10010
+ "primitive": "any"
10011
+ }
10012
+ }
10013
+ }
10014
+ ],
10015
+ "name": "DistributionDefaultsInjector",
10016
+ "properties": [
10017
+ {
10018
+ "docs": {
10019
+ "stability": "stable",
10020
+ "summary": "The unique Id of the Construct class."
10021
+ },
10022
+ "immutable": true,
10023
+ "locationInModule": {
10024
+ "filename": "src/injectors.ts",
10025
+ "line": 116
10026
+ },
10027
+ "name": "constructUniqueId",
10028
+ "overrides": "aws-cdk-lib.IPropertyInjector",
10029
+ "type": {
10030
+ "primitive": "string"
10031
+ }
10032
+ }
10033
+ ],
10034
+ "symbolId": "src/injectors:DistributionDefaultsInjector"
10035
+ },
9886
10036
  "@layertwo/cdk-constructs.DnsValidatedCertificate": {
9887
10037
  "assembly": "@layertwo/cdk-constructs",
9888
10038
  "base": "aws-cdk-lib.aws_certificatemanager.Certificate",
@@ -10239,6 +10389,156 @@
10239
10389
  "name": "ICommandHooks",
10240
10390
  "symbolId": "src/uv-bundling:ICommandHooks"
10241
10391
  },
10392
+ "@layertwo/cdk-constructs.KeyDefaultsInjector": {
10393
+ "assembly": "@layertwo/cdk-constructs",
10394
+ "docs": {
10395
+ "remarks": "Explicit props win.",
10396
+ "stability": "stable",
10397
+ "summary": "KMS key rotation."
10398
+ },
10399
+ "fqn": "@layertwo/cdk-constructs.KeyDefaultsInjector",
10400
+ "initializer": {
10401
+ "docs": {
10402
+ "stability": "stable"
10403
+ }
10404
+ },
10405
+ "interfaces": [
10406
+ "aws-cdk-lib.IPropertyInjector"
10407
+ ],
10408
+ "kind": "class",
10409
+ "locationInModule": {
10410
+ "filename": "src/injectors.ts",
10411
+ "line": 95
10412
+ },
10413
+ "methods": [
10414
+ {
10415
+ "docs": {
10416
+ "stability": "stable",
10417
+ "summary": "The injector to be applied to the constructor properties of the Construct."
10418
+ },
10419
+ "locationInModule": {
10420
+ "filename": "src/injectors.ts",
10421
+ "line": 98
10422
+ },
10423
+ "name": "inject",
10424
+ "overrides": "aws-cdk-lib.IPropertyInjector",
10425
+ "parameters": [
10426
+ {
10427
+ "name": "originalProps",
10428
+ "type": {
10429
+ "primitive": "any"
10430
+ }
10431
+ },
10432
+ {
10433
+ "name": "_context",
10434
+ "type": {
10435
+ "fqn": "aws-cdk-lib.InjectionContext"
10436
+ }
10437
+ }
10438
+ ],
10439
+ "returns": {
10440
+ "type": {
10441
+ "primitive": "any"
10442
+ }
10443
+ }
10444
+ }
10445
+ ],
10446
+ "name": "KeyDefaultsInjector",
10447
+ "properties": [
10448
+ {
10449
+ "docs": {
10450
+ "stability": "stable",
10451
+ "summary": "The unique Id of the Construct class."
10452
+ },
10453
+ "immutable": true,
10454
+ "locationInModule": {
10455
+ "filename": "src/injectors.ts",
10456
+ "line": 96
10457
+ },
10458
+ "name": "constructUniqueId",
10459
+ "overrides": "aws-cdk-lib.IPropertyInjector",
10460
+ "type": {
10461
+ "primitive": "string"
10462
+ }
10463
+ }
10464
+ ],
10465
+ "symbolId": "src/injectors:KeyDefaultsInjector"
10466
+ },
10467
+ "@layertwo/cdk-constructs.LogGroupDefaultsInjector": {
10468
+ "assembly": "@layertwo/cdk-constructs",
10469
+ "docs": {
10470
+ "remarks": "Explicit props win.",
10471
+ "stability": "stable",
10472
+ "summary": "CloudWatch log group retention."
10473
+ },
10474
+ "fqn": "@layertwo/cdk-constructs.LogGroupDefaultsInjector",
10475
+ "initializer": {
10476
+ "docs": {
10477
+ "stability": "stable"
10478
+ }
10479
+ },
10480
+ "interfaces": [
10481
+ "aws-cdk-lib.IPropertyInjector"
10482
+ ],
10483
+ "kind": "class",
10484
+ "locationInModule": {
10485
+ "filename": "src/injectors.ts",
10486
+ "line": 80
10487
+ },
10488
+ "methods": [
10489
+ {
10490
+ "docs": {
10491
+ "stability": "stable",
10492
+ "summary": "The injector to be applied to the constructor properties of the Construct."
10493
+ },
10494
+ "locationInModule": {
10495
+ "filename": "src/injectors.ts",
10496
+ "line": 83
10497
+ },
10498
+ "name": "inject",
10499
+ "overrides": "aws-cdk-lib.IPropertyInjector",
10500
+ "parameters": [
10501
+ {
10502
+ "name": "originalProps",
10503
+ "type": {
10504
+ "primitive": "any"
10505
+ }
10506
+ },
10507
+ {
10508
+ "name": "_context",
10509
+ "type": {
10510
+ "fqn": "aws-cdk-lib.InjectionContext"
10511
+ }
10512
+ }
10513
+ ],
10514
+ "returns": {
10515
+ "type": {
10516
+ "primitive": "any"
10517
+ }
10518
+ }
10519
+ }
10520
+ ],
10521
+ "name": "LogGroupDefaultsInjector",
10522
+ "properties": [
10523
+ {
10524
+ "docs": {
10525
+ "stability": "stable",
10526
+ "summary": "The unique Id of the Construct class."
10527
+ },
10528
+ "immutable": true,
10529
+ "locationInModule": {
10530
+ "filename": "src/injectors.ts",
10531
+ "line": 81
10532
+ },
10533
+ "name": "constructUniqueId",
10534
+ "overrides": "aws-cdk-lib.IPropertyInjector",
10535
+ "type": {
10536
+ "primitive": "string"
10537
+ }
10538
+ }
10539
+ ],
10540
+ "symbolId": "src/injectors:LogGroupDefaultsInjector"
10541
+ },
10242
10542
  "@layertwo/cdk-constructs.PythonFunction": {
10243
10543
  "assembly": "@layertwo/cdk-constructs",
10244
10544
  "base": "aws-cdk-lib.aws_lambda.Function",
@@ -10418,136 +10718,80 @@
10418
10718
  ],
10419
10719
  "symbolId": "src/lambda:PythonFunctionProps"
10420
10720
  },
10421
- "@layertwo/cdk-constructs.SecureBucket": {
10721
+ "@layertwo/cdk-constructs.TableDefaultsInjector": {
10422
10722
  "assembly": "@layertwo/cdk-constructs",
10423
- "base": "aws-cdk-lib.aws_s3.Bucket",
10424
10723
  "docs": {
10724
+ "remarks": "Explicit props win.",
10425
10725
  "stability": "stable",
10426
- "summary": "An S3 Bucket with security defaults enforced: - All public access blocked - S3-managed encryption (AES256) - SSL enforced (HTTP requests denied) - Versioning enabled by default (opt out with `versioned: false`)."
10726
+ "summary": "DynamoDB table defaults: on-demand, PITR, deletion protection."
10427
10727
  },
10428
- "fqn": "@layertwo/cdk-constructs.SecureBucket",
10728
+ "fqn": "@layertwo/cdk-constructs.TableDefaultsInjector",
10429
10729
  "initializer": {
10430
10730
  "docs": {
10431
10731
  "stability": "stable"
10432
- },
10433
- "locationInModule": {
10434
- "filename": "src/s3.ts",
10435
- "line": 25
10436
- },
10437
- "parameters": [
10438
- {
10439
- "name": "scope",
10440
- "type": {
10441
- "fqn": "constructs.Construct"
10442
- }
10443
- },
10444
- {
10445
- "name": "id",
10446
- "type": {
10447
- "primitive": "string"
10448
- }
10449
- },
10450
- {
10451
- "name": "props",
10452
- "optional": true,
10453
- "type": {
10454
- "fqn": "@layertwo/cdk-constructs.SecureBucketProps"
10455
- }
10456
- }
10457
- ]
10458
- },
10459
- "kind": "class",
10460
- "locationInModule": {
10461
- "filename": "src/s3.ts",
10462
- "line": 24
10463
- },
10464
- "name": "SecureBucket",
10465
- "symbolId": "src/s3:SecureBucket"
10466
- },
10467
- "@layertwo/cdk-constructs.SecureBucketProps": {
10468
- "assembly": "@layertwo/cdk-constructs",
10469
- "datatype": true,
10470
- "docs": {
10471
- "remarks": "Hardcoded (not overridable): blockPublicAccess, encryption, enforceSSL.\nThese are always applied regardless of what is passed in props.",
10472
- "stability": "stable",
10473
- "summary": "Properties for SecureBucket."
10732
+ }
10474
10733
  },
10475
- "fqn": "@layertwo/cdk-constructs.SecureBucketProps",
10476
10734
  "interfaces": [
10477
- "aws-cdk-lib.aws_s3.BucketProps"
10735
+ "aws-cdk-lib.IPropertyInjector"
10478
10736
  ],
10479
- "kind": "interface",
10737
+ "kind": "class",
10480
10738
  "locationInModule": {
10481
- "filename": "src/s3.ts",
10482
- "line": 15
10483
- },
10484
- "name": "SecureBucketProps",
10485
- "symbolId": "src/s3:SecureBucketProps"
10486
- },
10487
- "@layertwo/cdk-constructs.SecureTable": {
10488
- "assembly": "@layertwo/cdk-constructs",
10489
- "base": "aws-cdk-lib.aws_dynamodb.Table",
10490
- "docs": {
10491
- "stability": "stable",
10492
- "summary": "A DynamoDB Table with best-practice defaults enforced: - On-demand billing (PAY_PER_REQUEST) - Point-in-time recovery always enabled."
10739
+ "filename": "src/injectors.ts",
10740
+ "line": 49
10493
10741
  },
10494
- "fqn": "@layertwo/cdk-constructs.SecureTable",
10495
- "initializer": {
10496
- "docs": {
10497
- "stability": "stable"
10498
- },
10499
- "locationInModule": {
10500
- "filename": "src/dynamodb.ts",
10501
- "line": 18
10502
- },
10503
- "parameters": [
10504
- {
10505
- "name": "scope",
10506
- "type": {
10507
- "fqn": "constructs.Construct"
10508
- }
10742
+ "methods": [
10743
+ {
10744
+ "docs": {
10745
+ "stability": "stable",
10746
+ "summary": "The injector to be applied to the constructor properties of the Construct."
10509
10747
  },
10510
- {
10511
- "name": "id",
10512
- "type": {
10513
- "primitive": "string"
10514
- }
10748
+ "locationInModule": {
10749
+ "filename": "src/injectors.ts",
10750
+ "line": 52
10515
10751
  },
10516
- {
10517
- "name": "props",
10752
+ "name": "inject",
10753
+ "overrides": "aws-cdk-lib.IPropertyInjector",
10754
+ "parameters": [
10755
+ {
10756
+ "name": "originalProps",
10757
+ "type": {
10758
+ "primitive": "any"
10759
+ }
10760
+ },
10761
+ {
10762
+ "name": "_context",
10763
+ "type": {
10764
+ "fqn": "aws-cdk-lib.InjectionContext"
10765
+ }
10766
+ }
10767
+ ],
10768
+ "returns": {
10518
10769
  "type": {
10519
- "fqn": "@layertwo/cdk-constructs.SecureTableProps"
10770
+ "primitive": "any"
10520
10771
  }
10521
10772
  }
10522
- ]
10523
- },
10524
- "kind": "class",
10525
- "locationInModule": {
10526
- "filename": "src/dynamodb.ts",
10527
- "line": 17
10528
- },
10529
- "name": "SecureTable",
10530
- "symbolId": "src/dynamodb:SecureTable"
10531
- },
10532
- "@layertwo/cdk-constructs.SecureTableProps": {
10533
- "assembly": "@layertwo/cdk-constructs",
10534
- "datatype": true,
10535
- "docs": {
10536
- "remarks": "Hardcoded (not overridable): billingMode, pointInTimeRecoverySpecification.\nThese are always applied regardless of what is passed in props.",
10537
- "stability": "stable",
10538
- "summary": "Properties for SecureTable."
10539
- },
10540
- "fqn": "@layertwo/cdk-constructs.SecureTableProps",
10541
- "interfaces": [
10542
- "aws-cdk-lib.aws_dynamodb.TableProps"
10773
+ }
10543
10774
  ],
10544
- "kind": "interface",
10545
- "locationInModule": {
10546
- "filename": "src/dynamodb.ts",
10547
- "line": 10
10548
- },
10549
- "name": "SecureTableProps",
10550
- "symbolId": "src/dynamodb:SecureTableProps"
10775
+ "name": "TableDefaultsInjector",
10776
+ "properties": [
10777
+ {
10778
+ "docs": {
10779
+ "stability": "stable",
10780
+ "summary": "The unique Id of the Construct class."
10781
+ },
10782
+ "immutable": true,
10783
+ "locationInModule": {
10784
+ "filename": "src/injectors.ts",
10785
+ "line": 50
10786
+ },
10787
+ "name": "constructUniqueId",
10788
+ "overrides": "aws-cdk-lib.IPropertyInjector",
10789
+ "type": {
10790
+ "primitive": "string"
10791
+ }
10792
+ }
10793
+ ],
10794
+ "symbolId": "src/injectors:TableDefaultsInjector"
10551
10795
  },
10552
10796
  "@layertwo/cdk-constructs.UvBundling": {
10553
10797
  "assembly": "@layertwo/cdk-constructs",
@@ -11293,6 +11537,6 @@
11293
11537
  "symbolId": "src/lambda:UvLayerProps"
11294
11538
  }
11295
11539
  },
11296
- "version": "0.0.14",
11297
- "fingerprint": "LL2lr1vwcqOhTyLuogtrkCVnsbNWDGlrsjmjX6gsxW8="
11540
+ "version": "0.1.0",
11541
+ "fingerprint": "ie0fEIAalfqAXvGhdKcomTFvofDIdFUUPgPRW3ad0sg="
11298
11542
  }