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.756.tar.gz
(1.3 MB
view details)
Built Distribution
File details
Details for the file cdk-common-1.0.756.tar.gz
.
File metadata
- Download URL: cdk-common-1.0.756.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e9d68496dcaada66d23da1e25d9156111e1af3e2ea872390dd1c0f2c360e748 |
|
MD5 | ef1635da1e4463564929610e0f6cc7dd |
|
BLAKE2b-256 | 4618106ebed293d3f8ed597eb978c4229138e71fc10fb3aba323b871a00de020 |
File details
Details for the file cdk_common-1.0.756-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-1.0.756-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d901276f5ce1c67478f060506b05ee3dc52564d5f65b62c0c56d27e5adaea25 |
|
MD5 | 456c8804de947c1ef33b86998604c8f1 |
|
BLAKE2b-256 | 254979ed918076c518600a3551739d8cfe298088283ad2e2f7b5f374a0088de7 |