Back to home

blog/

aws-cdk

Version: 0.7.1

Last Updated: Unknown


Basic Lift Template

Use this tempalate to generate new lift projects.

Required

VariableData TypeInfo
namestringName of the blog post

Module files

1---
2basedir: content/blog
3---
4---
5date: "<%= name.split('-').filter((_data, index) => index < 3).join("-") %>"
6image: https://cdn.dennisokeeffe.com/assets/<%= name %>/main-image.png
7title: <%= _.startCase(name.split('-').filter((_data, index) => index >= 3)) %>
8description: <%= description %>
9tags: "aws,aws-cdk,typescript"
10icons: "dok,aws,aws-cdk,ts"
11series:
12 - "Working with the TypeScript AWS CDK": 1
13---
14
15This post will demonstrate how we can ...
16
17The final code can be found on my GitHub repo [`okeeffed/<%= name.split('-').filter((_data, index) => index >= 3).join("-") %>`](https://github.com/okeeffed/<%= name.split('-').filter((_data, index) => index >= 3).join("-") %>).
18## Prerequisites
19
201. Basic familiarity with [AWS CDK for TypeScript](https://docs.aws.amazon.com/cdk/latest/guide/work-with-cdk-typescript.html).
21
22## Getting started
23
24We will clone the template repo to get started:
25
26```s
27$ git clone https://github.com/okeeffed/using-the-aws-cdk-with-localstack-and-aws-cdk-local <%= name.split('-').filter((_data, index) => index >= 3).join("-") %>
28$ cd <%= name.split('-').filter((_data, index) => index >= 3).join("-") %>
29$ npm i
30# if install fails, remove the lockfile and try again
31```
32
33At this stage, we will have the app in a basic working state.
34
35In order to create the CDN stack, we will require the following AWS CDK libraries:
36
37```s
38@aws-cdk/core
39@aws-cdk/aws-ec2
40@aws-cdk/aws-ecs
41@aws-cdk/aws-ecs-patterns
42```
43
44We can install these prior to doing any work:
45
46```s
47npm i @aws-cdk/core @aws-cdk/aws-ec2 @aws-cdk/aws-ecs @aws-cdk/aws-ecs-patterns
48```
49
50The repository that we cloned already has a `upgrade` script supplied. We can use this to ensure our CDK packages are at parity:
51
52```s
53npm run upgrade
54```
55
56We are now at a stage add a pattern construct to a stack.
57
58## ...
59
60...
61
62## Summary
63
64Today's post demonstrated how to ...
65
66## Resources and further reading
67
681. [AWS CDK for TypeScript](https://docs.aws.amazon.com/cdk/latest/guide/work-with-cdk-typescript.html)
692. [`okeeffed/<%= name.split('-').filter((_data, index) => index >= 3).join("-") %>`](https://github.com/okeeffed/<%= name.split('-').filter((_data, index) => index >= 3).join("-") %>)
70
71_Photo credit: [`user`](https://unsplash.com/@user)_

Install


Lift generate


Repository

https://github.com/okeeffed/pkg-lift-blog

Sections