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.844.tar.gz
(1.0 MB
view details)
Built Distribution
File details
Details for the file cdk-common-1.0.844.tar.gz
.
File metadata
- Download URL: cdk-common-1.0.844.tar.gz
- Upload date:
- Size: 1.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20c6b5c7b2c5a6dfeba6e6b411010a65bd7bc144f314d0e5de7e2e47c7587504 |
|
MD5 | 3807e1f6c7440121ba84cdff0b3995a2 |
|
BLAKE2b-256 | c9bb4bc7b1b50f833f0c5fe424b4f99345e5e44c520f34f7963ab3179ef4cf6c |
File details
Details for the file cdk_common-1.0.844-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-1.0.844-py3-none-any.whl
- Upload date:
- Size: 1.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0402a85312ebe24479bf0d53dc1ebbbec6e1987b13907f73e1154251c7693294 |
|
MD5 | 56ea78c06fb387152bcd7d3795124132 |
|
BLAKE2b-256 | f646d903bacfbcd7decafef0964dae635040bd355015a8fe0313e4ff2130768c |