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.802.tar.gz
(997.8 kB
view details)
Built Distribution
cdk_common-1.0.802-py3-none-any.whl
(996.5 kB
view details)
File details
Details for the file cdk-common-1.0.802.tar.gz
.
File metadata
- Download URL: cdk-common-1.0.802.tar.gz
- Upload date:
- Size: 997.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ea698dc7ba2274b07d66271a0d61a22b886ea19d584b58115c481730958abe4 |
|
MD5 | 332ae77a9f0ec84abc37b2b9fff715ce |
|
BLAKE2b-256 | 4c9ae9d810f4ff7088de92ef77e0073ce05a38ae94683d7c2223519941674f8c |
File details
Details for the file cdk_common-1.0.802-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-1.0.802-py3-none-any.whl
- Upload date:
- Size: 996.5 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 | 136bc67c51e2b3df2576f8abca9ea45ead7239de9453304d716451887efa6923 |
|
MD5 | 553d2d9a8fe5ebea4e543b61e877e0cf |
|
BLAKE2b-256 | 147dc11870eecd3babc444f13e2eda266e1312be8882b1fca55c868894193b87 |