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.922.tar.gz
(1.3 MB
view hashes)
Built Distribution
Close
Hashes for cdk_common-1.0.922-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8ef3cbc202579041696658641054611003367beb6fccadfb4f54ba1c9bb0b81 |
|
MD5 | 52971be4f6d511401e42902a3239ee83 |
|
BLAKE2b-256 | 6c21fa51dd0d61b71b3fb1f96a2e81079f59e679b293f6e35cd5d8ef03a731b3 |