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.387.tar.gz
(1.6 MB
view details)
Built Distribution
File details
Details for the file cdk-common-1.0.387.tar.gz
.
File metadata
- Download URL: cdk-common-1.0.387.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd2f7cbbdb4c179d9018343ab87d63483cf8894b5911d7393eca79f107d5fdd6 |
|
MD5 | 9dea3a6bbc24894fcd60cdc6940cf466 |
|
BLAKE2b-256 | df0c31838405ea5c78a079f7249409a42fc74a45cda8e8145f36a33928dcfc0c |
File details
Details for the file cdk_common-1.0.387-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-1.0.387-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8af68ea000689e5e1eb9c4069f038c703cf3886ae100fefb39c26b05819302e1 |
|
MD5 | 9769275f932da3dca4c8bee40fd074ea |
|
BLAKE2b-256 | 40fee9ca8b595c779e002441bec55bbd8e3058dfe3f07f20cf95183c69a2cc56 |