Common AWS CDK librarys.
Project description
Welcome to cdk-common
This Constructs Library will collection of useful function
and class
for AWS CDK.
Install
Use the npm dist tag to opt in CDKv1 or CDKv2:
// for CDKv2
npm install cdk-common
or
npm install cdk-common@latest
// for CDKv1
npm install cdk-common@cdkv1
AWS Managed Policies enum
import * as cdk from '@aws-cdk/core';
import { AWSManagedPolicies } from 'cdk-common';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'integ-default', { env });
export class IntegDefault extends cdk.Construct {
constructor(scope: cdk.Construct, id: string ) {
super(scope, id);
const role = new iam.Role(this, 'iamrole', {
assumedBy: new iam.ServicePrincipal('ec2.amazonaws.com'),
});
// Use this way.
role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName(AWSManagedPolicies.AMAZON_SSM_MANAGED_INSTANCE_CORE));
// Not this way.
role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonSSMManagedInstanceCore'));
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cdk-common-1.0.789.tar.gz
(992.7 kB
view details)
Built Distribution
cdk_common-1.0.789-py3-none-any.whl
(991.6 kB
view details)
File details
Details for the file cdk-common-1.0.789.tar.gz
.
File metadata
- Download URL: cdk-common-1.0.789.tar.gz
- Upload date:
- Size: 992.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d57d26012b756684e28d62e7addb04145f76fb59fa0561b516709c0e1b37d034 |
|
MD5 | d56c18ed0325b8bbc6616eb6e0d21903 |
|
BLAKE2b-256 | 82d459da0ede352e0f177e5cffc498e1fc56455bbef8b3d27e2816204bc952c0 |
File details
Details for the file cdk_common-1.0.789-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-1.0.789-py3-none-any.whl
- Upload date:
- Size: 991.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f1a596ffd902611c90be1d08f6376f7fbd88e22e9aa2dc4c6ac4a0823c8f7e1 |
|
MD5 | cdf41a13ff8deccaa0e0c9821aae24f6 |
|
BLAKE2b-256 | 8dbf0d05bc2f124c07485c594ce3a962880105c3ef569aa702abc71bc0fbeb0d |