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

cdk-constants

v3.0.3

Published

Library of helpful constants to work with the CDK

Downloads

59,762

Readme

CDK Constants

This repository contains constants that make it easier to work with the aws-cdk (CDK).

Why?

The CDK is awesome but it currently lacks types when initializing constructs such as IAM service principals and managed policies. Finding the right construct names requires diving into AWS documentation. Because there is no verification of these construct initializers, errors are only surfaced after deployment and via a rollback.

This library aims to be an up to date constants library for all things AWS so the above never happens again!

Quickstart

Install or update from npm

TypeScript/Javascript

npm i cdk-constants

Python

pip install cdk-constants

Usage

** TypeScript **

import { ServicePrincipals, ManagedPolicies } from "cdk-constants";

const lambdaRole = new Role(this, "lambdaDomainChecker", {
  assumedBy: new ServicePrincipal(ServicePrincipals.LAMBDA),
  managedPolicies: [
    ManagedPolicy.fromAwsManagedPolicyName(
      ManagedPolicies.AWS_LAMBDA_BASIC_EXECUTION_ROLE
    )
  ]
});

** Python **

from cdk_constants import ServicePrincipals, ManagedPolicies

lambda_role = Role(self, "lambdaDomainChecker",
    assumed_by=ServicePrincipal(ServicePrincipals.LAMBDA),
    managed_policies=[
        ManagedPolicy.from_aws_managed_policy_name(ManagedPolicies.AWS_LAMBDA_BASIC_EXECUTION_ROLE)
    ]
)

Properties

ServicePrincipals

  • AWS services principals

ManagedPolicies

  • Managed AWS policies

Credits

cdk-constants wouldn't be possible without modules from the following authors

Contributions

All contributors are welcome. As you are reading this, AWS has probably released a new service. Please see CONTRIBUTING for information on how to setup a development environment and submit code.

Some upcoming items on the roadmap:

  • list of aws regions and azs, including gov and china
  • list of all iam permissions
  • [x] jsii compilation into different languages that CDK supports

License

cdk-constants is distributed under the Apache License, Version 2.0.

See LICENSE for more information.