# AWS CDK (Cloud Development Kit) Sample

This page demonstrates how [InfViz](https://infviz.io) can help you visualize AWS CDK script files. In this example we will use AWS CDK example (<https://github.com/aws-samples/aws-cdk-examples>).

### 1. Getting CDK sample files

Download the sample files from github (<https://github.com/aws-samples/aws-cdk-examples>)

### 2. Run setup instructions of the sample application

```
npm install -g aws-cdk
cd typescript/my-widget-service
npm install
npm run build
```

### 3. Generate a cloudformation file

Windows

```
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf7'
cdk synth | out-file test.yaml
```

Mac Linux

```
cdk synth > test.yaml
```

### 4. Upload and view in InfViz Studio

![](/files/-LfiI7_7kgUxiQmKQxgU)

In InfViz studio

1. Log in to InfViz Studio (<https://studio.infviz.io>)
2. Browse to 'AWS Import'
3. Click 'Choose Files'
4. Select 'test.yaml' file generated in step 3
5. Click 'Upload'

![Generated diagram from AWS CDK code](/files/-LfiIow48LqEUrSzAoJo)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infviz.io/samples/aws-cdk-sample.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
