More Tools - CDK Examples



We need more CDK examples

In this github repo we focus on examples for every day work. While there are some nice examples for the fancy stuff like fargate, ecs and so on in aws-cdk-examples/typescript at master · aws-samples/aws-cdk-examples · GitHub, i felt that basic examples where missing.

So we created GitHub - tecracer/cdk-templates: Templates for aws cdk

Working with the CDK (Cloud Development Kit) for a few month, one thing becomes clear:

You need examples and code snippets to get startet. So wee collected examples from our projects.

We have updated our github Repo for CDK examples to Version 1.5, no 1.6, no 1.7.

Funny thing is right when i was working with the cdk, the 1.5 update made its way through the pipeline and i could see while is was upgrading npm dependencies:

  • first only some modules were updated, that gave strange error messages
  • The documentation had about 10 minutes delay to the update of the modules

Right after that i updated the tecRacer CDK example repository.

And these are the working templates we have right now (growing):

Application Load Balancer alb-update

We tuned the ´Application Load Balancer example with userdata and an ssm role.

cdk-templates/alb-update at master · tecracer/cdk-templates · GitHub

Code Pipeline

A Code Pipeline example, which creates a static hugo website.

cdk-templates/codepipeline at master · tecracer/cdk-templates · GitHub

Lambda with simple API-Gateway

Like the standard serverless.com example. cdk-templates/lambda-apigw at master · tecracer/cdk-templates · GitHub

Lambda schedule

Added another rule target to the lambda-cron example.

cdk-templates/lambda-schedule at master · tecracer/cdk-templates · GitHub

Lambda simple

The most simple example with Lambda. Just to get you started. cdk-templates/lambda-simple at master · tecracer/cdk-templates · GitHub

Ops-Center Role

IAM example of an role specifically for the ops center, see AWS OpsCenter - Ticket as a Service | tecRacer Amazon AWS Blog (german)

VPC-Bastion

An vpc with an EC2 bastion host instance. This is meant to work with Systems Manager session manager, so no security groups here…

cdk-templates/vpc-bastion at master · tecracer/cdk-templates · GitHub

Jenkins Test Instance which is automatically turned off

An instance where Jenkins is installed together with a rule to stop it at a certain time.

cdk-templates/ec2-autostop at master · tecracer/cdk-templates · GitHub

Have fun

So, have fun with GitHub - tecracer/cdk-templates: Templates for aws cdk

Please contact me (Gernot) on twitter: @megaproaktiv

Photo by Fleur on Unsplash

Similar Posts You Might Enjoy

Getting around circular CloudFormation Dependencies: S3-Event-Lambda-Role

Getting around circular CloudFormation dependencies Several posts complain about the inability of CloudFormation to apply a Lambda event function to an S3 Bucket with an dynamically generated name. The standard UseCase is an S3 Bucket with a Lambda event notification. In this special case the Bucket has a dynamically generated name. This cannot be done by pure CloudFormation! How to work around this circular depency? Let me show you an easy way: - by Gernot Glawe

tRick: simple network 1 - Abstraktion und LoC

Vergleich Infrastructure as Code (IaC) Frameworks - tRick Ein Toolvergleich für Infrastructure as Code. Um effektiv AWS oder generell Cloud Ressourcen zu erzeugen, verwendet man zur Erhöhung des Automatisierungsgrades “Infrastracture as Code”, d.h. die Server, Datenbanken usw. werden in einer Sprache kodiert. Dieser Vorgang wird sinvollerweise über ein Framework, welches Tools dafür zur Verfügung stellt unterstützt. Aber für welches Tool/Framework entscheidet man sich? Hier werden wir mit Dimensionen für den tRick Benchmark Entscheidungshilfen geben. - by Gernot Glawe

Große Wolken - CloudFormation Makros

How to: CloudFormation Makro CloudFormation vermisst gegenüber Terraform einige Funktionen, die das Erstellen von Infrastruktur vereinfachen können. Das ist grundsätzlich korrekt, allerdings gibt es in CloudFormation die Möglichkeit, sich selber um den Einbau solcher Funktionen zu kümmern. Das geht mithilfe sogenannter CloudFormation Makros. CloudFormation Makros sind Funktionen, die wir per CloudFormation erstellen können und dann in weiteren CloudFormation Templates einbauen und verwenden können. Wir zeigen dies am Beispiel einer Count Funktion. - by David Schellenburg , André Reinecke