Coder Social home page Coder Social logo

cdk-constants's Introduction

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

  • AWS services principals
  • 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.

cdk-constants's People

Contributors

dependabot[bot] avatar kevinslin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.