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.226.tar.gz
(1.1 MB
view details)
Built Distribution
File details
Details for the file cdk-common-1.0.226.tar.gz
.
File metadata
- Download URL: cdk-common-1.0.226.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 | 51950538baab25286d623309707132d788754fb735d94f1b8a132a249771b2bc |
|
MD5 | 6eb8201a96a1416b92048105d78a1050 |
|
BLAKE2b-256 | 3725d4cd3d349573fc28ead4fad918a04a77c2f9ec00a8ad553dace7e0d6b4e3 |
File details
Details for the file cdk_common-1.0.226-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-1.0.226-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 | feef1040375600f6f1a3480ed0b542901ae5a9a313a409b0fc7a74d868e45708 |
|
MD5 | 614726e27c0a4fdf086eacd30e25e651 |
|
BLAKE2b-256 | 2169f13541f992e32a3334e59493ca027663a2215c2c5072dc1cf7687727448b |