Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neilkuan/cdk-common
This Constructs Library will collection of useful function and class for AWS CDK.
https://github.com/neilkuan/cdk-common
aws-cdk common
Last synced: about 2 months ago
JSON representation
This Constructs Library will collection of useful function and class for AWS CDK.
- Host: GitHub
- URL: https://github.com/neilkuan/cdk-common
- Owner: neilkuan
- License: apache-2.0
- Created: 2021-09-30T15:29:03.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T00:13:06.000Z (8 months ago)
- Last Synced: 2024-04-13T23:15:46.048Z (8 months ago)
- Topics: aws-cdk, common
- Language: TypeScript
- Homepage:
- Size: 6.44 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![NPM version](https://badge.fury.io/js/cdk-common.svg)](https://badge.fury.io/js/cdk-common)
[![PyPI version](https://badge.fury.io/py/cdk-common.svg)](https://badge.fury.io/py/cdk-common)
[![release](https://github.com/neilkuan/cdk-common/actions/workflows/release.yml/badge.svg)](https://github.com/neilkuan/cdk-common/actions/workflows/release.yml)![Downloads](https://img.shields.io/badge/-DOWNLOADS:-brightgreen?color=gray)
![npm](https://img.shields.io/npm/dt/cdk-common?label=npm&color=orange)
![PyPI](https://img.shields.io/pypi/dm/cdk-common?label=pypi&color=blue)# Welcome to `cdk-common`
This Constructs Library will collection of useful `function` and `class` for AWS CDK.## Install
```bash
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](https://github.com/neilkuan/cdk-common/tree/cdkv1#readme), if you are using aws-cdk v1.x.x version.💡💡💡
### AWS Managed Policies `enum`
```ts
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'));
}
}```