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.288.tar.gz
(1.5 MB
view details)
Built Distribution
File details
Details for the file cdk-common-1.0.288.tar.gz
.
File metadata
- Download URL: cdk-common-1.0.288.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bec8a3970c0332071e97a42857f6e934b1a321a16a9ec65742b7b239677e92b9 |
|
MD5 | b5232f553cf98f78e8972a6556c07cf5 |
|
BLAKE2b-256 | edad0de3ab6598a9a6c2564d871f8e41efe3a3bbece6889e22bfeaaac48d223d |
File details
Details for the file cdk_common-1.0.288-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-1.0.288-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e31b379389d1413f7ff763b6acc60df2ee3874a89389d53756fdc177debbb456 |
|
MD5 | a605658fb5d9effd79226a30b57212b7 |
|
BLAKE2b-256 | e6b5161f11c0d35c4995e21903bf686a527082af5f219490439340ce9de760f5 |