Skip to main content

Library of helpful constants to work with the CDK

Project description

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

# install
npm i cdk-constants

# upgrade
npm i -g cdk-constants@latest

Usage

# Example automatically generated. See https://github.com/aws/jsii/issues/826
from cdk_constants import SERVICE_PRINCIPALS, MANAGED_POLICIES

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

Properties

SERVICE_PRINCIPALS

  • enum of all AWS services principals

MANAGED_POLICIES

  • enum of all managed AWS policies

SERVICE_NAMES

  • enum of all aws service names

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cdk_constants-2.1.2-py3-none-any.whl (199.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page