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
💡💡💡 please click here, if you are using aws-cdk v1.x.x version.💡💡💡
AWS Managed Policies enum
import * as cdk from 'aws-cdk-lib';
import { AWSManagedPolicies } from 'cdk-common';
import { Construct } from 'constructs';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'integ-default', { env });
export class IntegDefault extends Construct {
constructor(scope: 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-2.0.1003.tar.gz
(3.9 MB
view details)
Built Distribution
File details
Details for the file cdk_common-2.0.1003.tar.gz
.
File metadata
- Download URL: cdk_common-2.0.1003.tar.gz
- Upload date:
- Size: 3.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0238f8161c2552e142b5e7130ca922c01e637d4a939c9b7dc97f0e12f8f592c7 |
|
MD5 | 5fc890921b17d3e3fed375bef213edbb |
|
BLAKE2b-256 | 24c3f6c94623bf1732545972273877298662befa4d38c41b987027c4eb53ac67 |
File details
Details for the file cdk_common-2.0.1003-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-2.0.1003-py3-none-any.whl
- Upload date:
- Size: 3.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45fad5c783f3826b2fa5c94c6a2535809a5bbb476fab7fb9a41a149443127f84 |
|
MD5 | e66ea718b86839de131d9ac93eb21f97 |
|
BLAKE2b-256 | 8d1940464492324d620a8f4531030b6c7e46f0986382fa52de141fcf68197f0e |