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.794.tar.gz
(995.5 kB
view details)
Built Distribution
cdk_common-1.0.794-py3-none-any.whl
(994.3 kB
view details)
File details
Details for the file cdk-common-1.0.794.tar.gz
.
File metadata
- Download URL: cdk-common-1.0.794.tar.gz
- Upload date:
- Size: 995.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d80c4e7eb61b52ff2ccaa54b3724d63ba174178d60a5e28836619d64d00ec7fc |
|
MD5 | 691dbf64199ad9f510261c7d589cce96 |
|
BLAKE2b-256 | 1841699e8c0ac113047cdd5bba8c0f0d505a992e2155c298aaecacebdc161ce0 |
File details
Details for the file cdk_common-1.0.794-py3-none-any.whl
.
File metadata
- Download URL: cdk_common-1.0.794-py3-none-any.whl
- Upload date:
- Size: 994.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d27e7c7b9fd25c29b2db1c71913f93baa70ac47c1775ab06d16dda359a021af9 |
|
MD5 | 65cf12976b813c971c23a9942a980a61 |
|
BLAKE2b-256 | d8ccd44a19a16c7c94717cfe9451fd50d1345c5b0d2b03c10a9fb6f896a274c6 |