npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@phila/cdk-s3

v0.0.1

Published

City of Philadelphia s3 bucket CDK constructs.

Downloads

166

Readme

S3 CDK Construct Library

City of Philadelphia s3 bucket CDK constructs.

Overview

This CDK construct library provides reusable AWS S3 bucket constructs for different use cases: web hosting files, log storage, and general file storage. Each construct is configured with appropriate security settings, encryption, and lifecycle management.

Installation

npm install @phila/cdk-s3

Bucket Types

WebfilesBucket

Creates an S3 bucket for static website files which must be served via CloudFront. Do not use for protected and private files, just public website ones. This bucket is configured with:

  • S3-managed encryption (no KMS)
  • No lifecycle rules
  • Fully private. (Must use AOC in CloudFront for serving)
  • SSL enforcement
  • No versioning
  • Automatic cleanup in non-production environments

Props:

Usage:

import { Compliance, Confidentiality, WebfilesBucket } from "@phila/cdk-s3";

const webfilesBucket = new WebfilesBucket(stack, "WebfilesBucket", {
  project: "my-project",
  environment: "production",
  department: "4-oit",
  team: "Platform Engineering",
  contact: "[email protected]",
  compliance: Compliance.STANDARD,
  confidentiality: Confidentiality.LOW,
  tags: {
    Example: "Example tag",
  },
  logBucket: logBucket.bucket, // optional
});

LogBucket

Creates an S3 bucket for centralized S3 access logs. This bucket is configured with:

  • KMS encryption
  • Configurable log retention (default: 30 days)
  • Fully private with SSL enforcement
  • No versioning
  • Automatic cleanup enabled

Props:

  • GlobalProps (required) - See GlobalProps documentation
  • logRetentionDays?: number (optional) - Log retention days (default: 30).
  • logBucket?: IBucket (optional) - Optional log bucket for access logging (typically not used for log buckets themselves because it may create a cycle loop)

Usage:

import { Compliance, Confidentiality, LogBucket } from "@phila/cdk-s3";

const logBucket = new LogBucket(stack, "LogBucket", {
  project: "my-project",
  environment: "production",
  department: "4-oit",
  team: "Platform Engineering",
  contact: "[email protected]",
  compliance: Compliance.STANDARD,
  confidentiality: Confidentiality.LOW,
  tags: {
    Example: "Example tag",
  },
  logRetentionDays: 90, // optional, default is 30
});

FilesBucket

Creates an S3 bucket for application file storage. This bucket is configured with:

  • KMS encryption
  • Optional Glacier transition for cost optimization
  • Fully private (all public access blocked), access must be granted via IAM policies. (e.g. Fargate task role to Read and Write application files in the bucket)
  • Optional versioning (default: false)
  • SSL enforcement
  • Automatic cleanup in non-production environments

Props:

  • GlobalProps (required) - See GlobalProps documentation
  • glacierTransitionDays?: number (optional) - Days before transitioning files to Glacier (default: 60). Set to 0 to disable Glacier transition.
  • versioned?: boolean (optional) - Enable versioning on the bucket (default: false)
  • logBucket?: IBucket (optional) - Optional log bucket for access logging

Usage:

import { Compliance, Confidentiality, FilesBucket } from "@phila/cdk-s3";

const filesBucket = new FilesBucket(stack, "FilesBucket", {
  project: "my-project",
  environment: "production",
  department: "4-oit",
  team: "Platform Engineering",
  contact: "[email protected]",
  compliance: Compliance.STANDARD,
  confidentiality: Confidentiality.MEDIUM,
  tags: {
    Example: "Example tag",
  },
  glacierTransitionDays: 90, // optional, default is 60, set to 0 to disable
  versioned: true, // optional, default is false
  logBucket: logBucket.bucket, // optional
});

GlobalProps

All bucket constructs require GlobalProps. For complete documentation on GlobalProps, including all properties, enums, and usage examples, see the Shared CDK Construct Library documentation.

Features

  • Security: All buckets are fully private with SSL enforcement
  • Encryption: KMS encryption for log and files buckets, S3-managed for web files
  • Lifecycle Management: Configurable retention and Glacier transitions
  • CDK Outputs: Exposes bucket names as CloudFormation outputs
  • Compliance: NIST 800-53 Rev 5 compliant with appropriate CDK Nag suppressions

Development

Prerequisites

  • Node.js 22+
  • pnpm
  • AWS CDK CLI

Commands

  • pnpm run build - Build the library
  • pnpm run watch - Build in watch mode
  • pnpm run test - Run tests
  • pnpm run lint - Lint code
  • pnpm run format - Format code