Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpengau committed Jan 12, 2024
1 parent 5f2e472 commit 3f64a58
Show file tree
Hide file tree
Showing 11 changed files with 7,602 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.js
!jest.config.js
*.d.ts
node_modules

# CDK asset staging directory
.cdk.staging
cdk.out
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.ts
!*.d.ts

# CDK asset staging directory
.cdk.staging
cdk.out
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
# cdk-lib-cfn-diff-issue-20240112
Sample AWS CDK Construct Library to test issue around exporting @aws-cdk/cloudformation-diff
# Welcome to your CDK TypeScript Construct Library project

You should explore the contents of this project. It demonstrates a CDK Construct Library that includes a construct (`CdkLibCfnDiffIssue20240112`)
which contains an Amazon SQS queue that is subscribed to an Amazon SNS topic.

The construct defines an interface (`CdkLibCfnDiffIssue20240112Props`) to configure the visibility timeout of the queue.

## Useful commands

* `npm run build` compile typescript to js
* `npm run watch` watch for changes and compile
* `npm run test` perform the jest unit tests

## Other

Check list of `cdk init` options:
```
cdk init --list
```

Create Custom AWS Construct Library:
```
cdk init lib --language typescript
```

## Reproduce issue
```
npm install
npm run build
```
8 changes: 8 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
testEnvironment: 'node',
roots: ['<rootDir>/test'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.tsx?$': 'ts-jest'
}
};
1 change: 1 addition & 0 deletions lib/exports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * as cfndiff from "@aws-cdk/cloudformation-diff"
21 changes: 21 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
// import * as sqs from 'aws-cdk-lib/aws-sqs';

export interface CdkLibCfnDiffIssue20240112Props {
// Define construct properties here
}

export class CdkLibCfnDiffIssue20240112 extends Construct {

constructor(scope: Construct, id: string, props: CdkLibCfnDiffIssue20240112Props = {}) {
super(scope, id);

// Define construct contents here

// example resource
// const queue = new sqs.Queue(this, 'CdkLibCfnDiffIssue20240112Queue', {
// visibilityTimeout: cdk.Duration.seconds(300)
// });
}
}
5 changes: 5 additions & 0 deletions output-error.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

> cdk-lib-cfn-diff-issue-20240112@0.1.0 build
> tsc

node_modules/@aws-cdk/cloudformation-diff/lib/diff-template.d.ts(1,32): error TS2307: Cannot find module 'aws-sdk' or its corresponding type declarations.
Loading

0 comments on commit 3f64a58

Please sign in to comment.