Skip to main content

Depot CDK Intro

Let's discover Depot CDK in less than 5 minutes.

Getting Started

Get started by installing the depot-cdk package. This assumes you already have an existing CDK project, or have created one using the AWS CDK cdk init app command.

npm install @stage-tech/depot-cdk@latest

Create a Depot Environment

Add the Depot Environment and CDK Aws imports to your CDK typescript file:

import { Environment } from "@stage-tech/depot-cdk";
import { Aws } from 'aws-cdk-lib';

Define a new Depot Environment using the Environment Construct:

new Environment(this, "ExampleEnvironment", {
account: { name: "dev", id: Aws.ACCOUNT_ID },
name: "example",
idPrefix: "example-",
useSharedVpc: true // set to true if deploying to a dev account.
});
info

Use an optional environment id prefix to your environment with the idPrefix property. This will be prefixed with your unique environment ID. Limited to 10 alphanumeric lowercase characters with dashes only.

Test your change

Run cdk diff to check your change:

cdk diff

You should see the proposed Environment to be created.

New environment

Deploy it with

cd deploy
note

The Depot CLI includes commands to quickly setup ready-to-go sample projects which include starter Depot CDK code. See the Depot CLI topic for more info.