Scan your whole stack
Are you using @layertwo/cdk-constructs?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.0.14
@layertwo/cdk-constructs was last scanned on 29 Nov 2026 at version 0.0.14. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.0.14 LATEST | 29 Nov 2026 | No rules fired |
| 0.0.13 | 29 Nov 2026 | No rules fired |
| 0.0.12 | 29 Nov 2026 | No rules fired |
| 0.0.11 | 29 Nov 2026 | Not shown |
| 0.0.0-stage | 29 Nov 2026 | Not shown |
Findings for v0.0.14. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.0.14; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Reusable AWS CDK constructs with secure defaults baked in, for TypeScript projects.
Published to npm as a JSII library. Only the TypeScript/JS package is published.
npm install @layertwo/cdk-constructs
| Construct | Extends | Enforced behaviour |
|---|---|---|
SecureBucket |
s3.Bucket |
Blocks all public access, S3-managed encryption, SSL enforced. Versioning on by default (versioned: false to opt out). |
SecureTable |
dynamodb.Table |
On-demand billing (PAY_PER_REQUEST), point-in-time recovery always enabled. |
GitHubOidcRole |
iam.Role |
Role assumable by GitHub Actions via OIDC, scoped to a repo and optionally a branch or environment. |
DnsValidatedCertificate |
certificatemanager.Certificate |
Always DNS-validated against the supplied Route53 hosted zone. |
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. |
UvLayer |
lambda.LayerVersion |
Packages a uv project's dependencies under /opt/python, ARM64 + Python 3.15 by default. |
Everything 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.
import * as path from "node:path";
import {
DnsValidatedCertificate,
GitHubOidcRole,
PythonFunction,
SecureBucket,
SecureTable,
UvLayer,
} from "@layertwo/cdk-constructs";
import { HostedZone } from "aws-cdk-lib/aws-route53";
// S3: public access blocked, encrypted, SSL-only, versioned
const bucket = new SecureBucket(this, "Assets");
// DynamoDB: on-demand + PITR
const table = new SecureTable(this, "Sessions", {
partitionKey: { name: "id", type: dynamodb.AttributeType.STRING },
});
// IAM role for a GitHub Actions workflow on main
const deployRole = new GitHubOidcRole(this, "DeployRole", {
owner: "layertwo",
repo: "my-app",
branch: "main",
});
// ACM certificate validated via Route53
new DnsValidatedCertificate(this, "Cert", {
domainName: "example.com",
hostedZone: HostedZone.fromLookup(this, "Zone", {
domainName: "example.com",
}),
});
// Python Lambda from a uv project (built in Docker at synth time)
new PythonFunction(this, "Fetcher", {
rootDir: path.join(__dirname, "../services/fetcher"),
index: "src/entrypoint/__init__.py",
handler: "handle_event",
environment: { TABLE_NAME: table.tableName },
});
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.
Two things make that fast in CI:
# Skip bundling entirely when the source hash matches a previous run.
- uses: actions/cache@v4
with:
path: cdk.out
key: cdk-assets-${{ github.sha }}
restore-keys: cdk-assets-
# Cache the image layers; type=gha needs BuildKit, and fails on a plain local daemon.
- uses: docker/setup-buildx-action@v3
const cacheScope = "lambda-bundling";
new PythonFunction(this, "Fetcher", {
rootDir,
bundling: process.env.CI
? {
cacheFrom: [{ type: "gha", params: { scope: cacheScope } }],
cacheTo: { type: "gha", params: { mode: "max", scope: cacheScope } },
}
: {},
});
The 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.
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.
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.
const deps = new UvLayer(this, "Deps", {
rootDir: path.join(__dirname, "../layers/deps"),
});
new PythonFunction(this, "Fetcher", {
rootDir: path.join(__dirname, "../services/fetcher"),
layers: [deps],
});
This project uses Projen for configuration and build management. Configuration lives in .projenrc.ts.
yarn install
npx projen # regenerate project files from .projenrc.ts
Node.js 22 or 24 (the versions jsii supports). Dependency upgrades arrive as Renovate PRs — there is no local upgrade task.
npm run build # full build: compile (jsii) + test + package
npm run compile # compile TypeScript only
npm test # tests with coverage
npm run test:watch # tests in watch mode
npm run eslint # linter
npm run package # generate distributable packages
npx projen # re-synthesize generated files
src/ and export it from src/index.ts.test/<name>.test.ts using CDK assertions.npm run build..projenrc.ts and run npx projen.Do not edit files marked ~~ Generated by projen — change .projenrc.ts and regenerate instead.
Ensure npm run build passes before opening a PR. Commits on mainline follow conventional commits; the release workflow bumps the version and publishes.
Apache-2.0
Lucas Messenger (1335960+layertwo@users.noreply.github.com)
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.