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
TypeScript/Javascript
npm i cdk-constants
Python
pip install cdk-constants
Usage
** TypeScript **
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
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)
]
)
** 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
- Jared Short: initial gist of all service principals
- Gene Wood: gist to pull all aws managed policies
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 Distribution
File details
Details for the file cdk-constants-3.0.3.tar.gz
.
File metadata
- Download URL: cdk-constants-3.0.3.tar.gz
- Upload date:
- Size: 240.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.41.0 PyPy/7.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a61b55b2ba040f428b594bf9de9c918b985321778f21258f5f3e3d16a69dc717 |
|
MD5 | e78a37d5f5aa5cdb2038ebf17cb426e8 |
|
BLAKE2b-256 | c6676d87c39158bb3144a17c30f2b05fcacd1566073288a487685e4e321c84b9 |