Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ryparker/aws-cdk-sample-import-with-sdk

A sample CDK project that uses the SDK to retrieve existing resources before synth.
https://github.com/ryparker/aws-cdk-sample-import-with-sdk

Last synced: about 2 months ago
JSON representation

A sample CDK project that uses the SDK to retrieve existing resources before synth.

Awesome Lists containing this project

README

        

# AWS CDK (v2) Sample Import with AWS SDK

This is a sample CDK project that uses the AWS SDK to import resources from another stack.

## :rocket: Quick Start

_Prerequisite: Have [CDK credentials exported in shell env](https://docs.aws.amazon.com/cdk/latest/guide/environments.html) or replace values in `./src/constants.ts`_

**1. Install dependencies with Yarn v1**

```shell
yarn install
```

**2. Create the [bootstrap stack](https://docs.aws.amazon.com/cdk/latest/guide/bootstrapping.html) in your AWS account**
_This only needs to be ran once per account/region._

```shell
yarn bootstrap
```

**3. Build Cloudformation files**

```shell
yarn build StackA
```

**4. Deploy Stack A**

```shell
yarn deploy StackA
```

**5. Uncomment StackB code in `./src/index.ts`, then build and deploy**

```shell
yarn build StackB
yarn deploy StackB
```