1. 3
    Build and deploy a sample AWS Cloud Development Kit stack to AWS
    3m 11s

Build and deploy a sample AWS Cloud Development Kit stack to AWS

InstructorTomasz Łakomy

Share this video with your friends

Send Tweet

Now that our initial AWS CDK project has been created, it's time to deploy it!

In this quick lesson we're going to learn:

  • where do we define an AWS CDK stack
  • what is a CDK construct (you can read more about CDK construct here )
  • how to use cdk diff command in order to see the difference between our currently deployed stack and the stack we're about to deploy
  • how to use cdk deploy in order to deploy a CDK stack to AWS
Todor
~ 4 years ago

Running cdk diff error with:

"Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment"

I assume we need to configure an account as a prerequisite?

Todor
~ 4 years ago

Yes, I followed this AWS tutorial:

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html

  1. Install AWS locally (from your terminal)
  2. Register and create a new administrator IAM user with access keys and then run.
  3. Run "aws configure" (from your terminal)
  4. Done, now "cdk diff/deploy" should work
Quang Le
~ 3 years ago

Hi Tomasz,

It would be great if you can break down some major steps in the CDK deployment? For example, it compiles the cdk code, generates the cloudformation template, packages it in a zip file, creates S3 bucket and loads code there, runs the cloudformation command to create cloudformation stack, deploys the lambda function (if it is for aws lambda project) etc.

I would also want to learn what are the minimum permissions (or policies) needed to do the cdk deployment? Like write access to S3 for cloudformation stack, create stack permission etc. The cdk bootstrap seems providing too broad power, it goes against the best practice of AWS least privilege.

Thank you