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.210.tar.gz
(1.1 MB
view details)
Built Distribution
File details
Details for the file cdk-common-1.0.210.tar.gz
.
File metadata
- Download URL: cdk-common-1.0.210.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d87cebaac82b252dc3d28ce25d42dd911f09576d62d94007dd2aa48f1da42f5 |
|
MD5 | 35d1939739d5c8aba2653a538e3a61bb |
|
BLAKE2b-256 | f21628b05df6b08deede4e7091ec5bb1742c2b40e5987d50b035f7095afd8c1b |
File details
Details for the file cdk_common-1.0.210-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-1.0.210-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87437f7c0c4b7776bfa4e48af657bda957e7f883e33b7e92eba5230a0f6ae996 |
|
MD5 | dd02fb8cd1053a1e37ab3fef44238045 |
|
BLAKE2b-256 | 5f979d9b25014410b2e4430a0b77b2062e52c553e4418f7572a6940151c9c159 |