_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN
Let's talk

AWS CDK — Cloud Development Kit

18. 05. 2023 1 min read intermediate

Cloud Intermediate

AWS CDK — Cloud Development Kit

AWSCDKIaCTypeScript 5 min read

CDK constructs L1/L2/L3, stacks, aspects a testing.

Construct Levels

const bucket = new s3.Bucket(this, 'Images', {
  versioned: true,
  encryption: s3.BucketEncryption.S3_MANAGED,
  lifecycleRules: [{
    transitions: [{storageClass: s3.StorageClass.GLACIER, transitionAfter: cdk.Duration.days(90)}]
  }]
});
const fn = new lambda.Function(this, 'Processor', {
  runtime: lambda.Runtime.NODEJS_20_X,
  handler: 'index.handler',
  code: lambda.Code.fromAsset('lambda'),
});
bucket.grantRead(fn); // L2 magic — auto-generates IAM policy

Aspects

class TagChecker implements cdk.IAspect {
  visit(node) {
    if (cdk.TagManager.isTaggable(node)) {
      // enforce required tags
    }
  }
}
cdk.Aspects.of(app).add(new TagChecker());

Testing

const template = Template.fromStack(stack);
template.hasResourceProperties('AWS::S3::Bucket', {
  VersioningConfiguration: { Status: 'Enabled' }
});

Summary

CDK = nejlepší volba pro AWS-only týmy. L2/L3 constructs drasticky snižují boilerplate.

Need Help with Implementation?

Our team has experience designing and implementing modern architectures. We’re happy to help.

Free Consultation

Share:

CORE SYSTEMS tým

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.