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.987.tar.gz
(1.4 MB
view details)
Built Distribution
File details
Details for the file cdk_common-1.0.987.tar.gz
.
File metadata
- Download URL: cdk_common-1.0.987.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb3e5cd34617065214a2856bb0f2d7e6eac59c0e0c0cc9032499bdca8a900e97 |
|
MD5 | 404b2834e2ddca8e674c0a77c62135bd |
|
BLAKE2b-256 | bea06a769d1c0c7615e8b33890143cbc88adbee31e9026f0c3bff84dd90b6b58 |
File details
Details for the file cdk_common-1.0.987-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-1.0.987-py3-none-any.whl
- Upload date:
- Size: 1.4 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 | a65223ef59a0ad1692e10f2583189af801eb630a6db0d3ee03be95d11b22c42d |
|
MD5 | 3adf900aca7a880ae5708f713f9ce37e |
|
BLAKE2b-256 | 2b4321fcc455c567a2f9f0ab4a1449c3717a0fd3e956ce74a4e571af3e28d949 |