DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

Deploy bootstrapped EC2 with CDK

4 years ago towardsaws.com
Deploy bootstrapped EC2 with CDK

Summary: This is a summary of an article originally published by the source. Read the full original article here →

In this guide I use CDK with typescript to deploy an EC2 instance that is ready to go with an application, domain joining as well as custom configuration.

I have done this in the past using Cloudformation, but it took me a long time before I bothered to investigate how to do this using CDK.

In this example we are creating a standalone volume for the D drive that is encrypted with kms that exists in a centralized account.

I discovered in this case however that cfn-signal.exe was never sent back to the stack because my configuration of the instance has a reboot in it and the way UserData works is that it’s not persistent, meaning that it runs only the first time the instance is started.

When you see the success signal in this file you will see it as an event in the Cloudformation stack in the AWS console.

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com