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.749.tar.gz
(1.2 MB
view details)
Built Distribution
File details
Details for the file cdk-common-1.0.749.tar.gz
.
File metadata
- Download URL: cdk-common-1.0.749.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e0dca4ae9f339c7d727303ae064aa517b38695e4032173b668c1df7cb326dfb |
|
MD5 | 9f86ef8a068461264ec3d713410e6a53 |
|
BLAKE2b-256 | 6806fb91e33abe66908a0f5f67bf7afede274987e03106c986ca28629331a0ef |
File details
Details for the file cdk_common-1.0.749-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-1.0.749-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a5aa023b71324f113b7a58b234231b420885d5d0edee207e9d686d6414f4478 |
|
MD5 | 4257b3254e1905b624f2faf5b4480fdb |
|
BLAKE2b-256 | b4c84e605fcd62c73100d5c69fd1447e63475d02ec856e9926d34af165caf920 |