Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cdk-constants

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdk-constants

Library of helpful constants to work with the CDK

  • 3.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12K
increased by1.1%
Maintainers
1
Weekly downloads
 
Created
Source

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
  • 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.

Keywords

FAQs

Package last updated on 30 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc