Skip to main content

Getting Started

This guide will help you get started with CDK Power Constructs.

Prerequisites

  • AWS CDK v2.x installed
  • Node.js 18+ (for TypeScript/JavaScript)
  • Your preferred language runtime

Installation

Choose your language and install the package:

npm install cdk-power-constructs aws-cdk-lib constructs

Your First Construct

Let's create a Glue resource policy statement for cross-account access:

import { GlueResourcePolicyStatement } from 'cdk-power-constructs/glue/glue-resource-policy';
import { Stack, App } from 'aws-cdk-lib';
import * as iam from 'aws-cdk-lib/aws-iam';

const app = new App();
const stack = new Stack(app, 'MyStack');

new GlueResourcePolicyStatement(stack, 'CrossAccountAccess', {
sid: 'AllowCrossAccountAccess',
statement: new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
principals: [new iam.AccountPrincipal('123456789012')],
actions: ['glue:GetDatabase', 'glue:GetTable'],
resources: ['*'],
}),
});

Deploy

Deploy your stack:

cdk deploy

Next Steps