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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@daysmart/cdk-cloudfront-behavior

v1.0.5

Published

This CDK Construct Library includes (`CdkCloudfrontBehavior`) which instantiates the [CdkBaseCfAcmR53](https://github.com/DaySmart/daysmart-cdk-constructs/tree/main/packages/cdk-base-cf-acm-r53) construct. The cloudfront distribution which is a part of th

Downloads

48

Readme

Welcome to the Open Source Construct for instantiating the CdkBaseCfAcmR53 construct and adding desired S3 or Http Origins/Behaviors to the Cloudfront Distribution!

This CDK Construct Library includes (CdkCloudfrontBehavior) which instantiates the CdkBaseCfAcmR53 construct. The cloudfront distribution which is a part of the instantiated base construct can then have additional behaviors added to it by calling this (CdkCloudfrontBehavior) construct's addS3OriginBehavior or addHttpOriginBehavior methods.

The construct defines an interface (CdkCloudfrontBehaviorProps) with the following properties that can be passed in:

  • defaultBehaviorOrigin: "http" | "s3" => The string identifying whether the default CloudFront distribution behavior will be with an s3 or http origin. (ex. "http" or "s3")
  • (required only if defaultBehaviorOrigin == "s3") defaultS3OriginBucketName: string => The bucket name for a default s3 origin (ex. app-bucket)
  • (required only if defaultBehaviorOrigin == "s3") defaultOriginAccessIdentity: string => The origin access identity for a default s3 origin (ex. EGIMNVDRYJKK243HJNV)
  • (required only if defaultBehaviorOrigin == "http") defaultHttpOriginName: string => The dns record for a default http origin (ex. test.google.com)
  • project: string => The project name (ex. onlineconverter)
  • baseEnv: string => The project environment (ex. dev)
  • componentName: string => The component/service the url is for in a project (ex. ui)
  • (required only if a dynamic env) dynamicEnv: string => A dynamic environment for this project. (ex. dev-test)
  • (optional) certificateArn: string => The arn of an existing acm certificate; one will be created in the construct if not provided
  • domains: string[] => An array of domain names for this project environment (ex. ['google.com', 'bing.com', 'apple.com'])
  • (optional) loggingBucketName: string => The name of an existing s3 bucket for receiving logs. (ex. logbucket1)
  • s3OriginCachePolicyId: string => The id of an existing CloudFront cache policy applicable for all s3 origins on the distribution. (ex. fndu46585032kjf403-00e5-4fea-af78-463829574dnnse5869)
  • httpOriginCachePolicyId: string => The id of an existing CloudFront cache policy applicable for all http origins on the distribution. (ex. fndu46585032kjf403-00e5-4fea-af78-463829574dnnse5869)

The addS3OriginBehavior method has the following required properties in order to call it:

  • project: string => The project name (ex. onlineconverter)
  • baseEnv: string => The project environment (ex. dev)
  • origins: S3Origin[] => An array of S3Origin objects, with an S3Origin defined as:
{
  bucketName: string;
  path: string;
  originAccessIdentity: string
}

The addHttpOriginBehavior method has the following required properties in order to call it:

  • project: string => The project name (ex. onlineconverter)
  • baseEnv: string => The project environment (ex. dev)
  • origins: HttpOrigin[] => An array of HttpOrigin objects, with a HttpOrigin defined as:
{
  host: string;
  path: string;
}

Useful commands

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile