mirror of
https://github.com/aljazceru/ThunderCloud.git
synced 2025-12-17 06:14:20 +01:00
Initial commit
This commit is contained in:
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
*.js
|
||||||
|
!jest.config.js
|
||||||
|
*.d.ts
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# CDK asset staging directory
|
||||||
|
.cdk.staging
|
||||||
|
cdk.out
|
||||||
6
.npmignore
Normal file
6
.npmignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
*.ts
|
||||||
|
!*.d.ts
|
||||||
|
|
||||||
|
# CDK asset staging directory
|
||||||
|
.cdk.staging
|
||||||
|
cdk.out
|
||||||
14
README.md
Normal file
14
README.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Welcome to your CDK TypeScript project!
|
||||||
|
|
||||||
|
This is a blank project for TypeScript development with CDK.
|
||||||
|
|
||||||
|
The `cdk.json` file tells the CDK Toolkit how to execute your app.
|
||||||
|
|
||||||
|
## 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
|
||||||
|
* `cdk deploy` deploy this stack to your default AWS account/region
|
||||||
|
* `cdk diff` compare deployed stack with current state
|
||||||
|
* `cdk synth` emits the synthesized CloudFormation template
|
||||||
21
bin/thundercloud.ts
Normal file
21
bin/thundercloud.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
import 'source-map-support/register';
|
||||||
|
import * as cdk from '@aws-cdk/core';
|
||||||
|
import { ThundercloudStack } from '../lib/thundercloud-stack';
|
||||||
|
|
||||||
|
const app = new cdk.App();
|
||||||
|
new ThundercloudStack(app, 'ThundercloudStack', {
|
||||||
|
/* If you don't specify 'env', this stack will be environment-agnostic.
|
||||||
|
* Account/Region-dependent features and context lookups will not work,
|
||||||
|
* but a single synthesized template can be deployed anywhere. */
|
||||||
|
|
||||||
|
/* Uncomment the next line to specialize this stack for the AWS Account
|
||||||
|
* and Region that are implied by the current CLI configuration. */
|
||||||
|
// env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION },
|
||||||
|
|
||||||
|
/* Uncomment the next line if you know exactly what Account and Region you
|
||||||
|
* want to deploy the stack to. */
|
||||||
|
// env: { account: '123456789012', region: 'us-east-1' },
|
||||||
|
|
||||||
|
/* For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html */
|
||||||
|
});
|
||||||
18
cdk.json
Normal file
18
cdk.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"app": "npx ts-node --prefer-ts-exts bin/thundercloud.ts",
|
||||||
|
"context": {
|
||||||
|
"@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
|
||||||
|
"@aws-cdk/core:enableStackNameDuplicates": "true",
|
||||||
|
"aws-cdk:enableDiffNoFail": "true",
|
||||||
|
"@aws-cdk/core:stackRelativeExports": "true",
|
||||||
|
"@aws-cdk/aws-ecr-assets:dockerIgnoreSupport": true,
|
||||||
|
"@aws-cdk/aws-secretsmanager:parseOwnedSecretName": true,
|
||||||
|
"@aws-cdk/aws-kms:defaultKeyPolicies": true,
|
||||||
|
"@aws-cdk/aws-s3:grantWriteWithoutAcl": true,
|
||||||
|
"@aws-cdk/aws-ecs-patterns:removeDefaultDesiredCount": true,
|
||||||
|
"@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
|
||||||
|
"@aws-cdk/aws-efs:defaultEncryptionAtRest": true,
|
||||||
|
"@aws-cdk/aws-lambda:recognizeVersionProps": true,
|
||||||
|
"@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": true
|
||||||
|
}
|
||||||
|
}
|
||||||
8
jest.config.js
Normal file
8
jest.config.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
module.exports = {
|
||||||
|
testEnvironment: 'node',
|
||||||
|
roots: ['<rootDir>/test'],
|
||||||
|
testMatch: ['**/*.test.ts'],
|
||||||
|
transform: {
|
||||||
|
'^.+\\.tsx?$': 'ts-jest'
|
||||||
|
}
|
||||||
|
};
|
||||||
9
lib/thundercloud-stack.ts
Normal file
9
lib/thundercloud-stack.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import * as cdk from '@aws-cdk/core';
|
||||||
|
|
||||||
|
export class ThundercloudStack extends cdk.Stack {
|
||||||
|
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
|
||||||
|
super(scope, id, props);
|
||||||
|
|
||||||
|
// The code that defines your stack goes here
|
||||||
|
}
|
||||||
|
}
|
||||||
27
package.json
Normal file
27
package.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"name": "thundercloud",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"bin": {
|
||||||
|
"thundercloud": "bin/thundercloud.js"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc",
|
||||||
|
"watch": "tsc -w",
|
||||||
|
"test": "jest",
|
||||||
|
"cdk": "cdk"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@aws-cdk/assert": "1.120.0",
|
||||||
|
"@types/jest": "^26.0.10",
|
||||||
|
"@types/node": "10.17.27",
|
||||||
|
"jest": "^26.4.2",
|
||||||
|
"ts-jest": "^26.2.0",
|
||||||
|
"aws-cdk": "1.120.0",
|
||||||
|
"ts-node": "^9.0.0",
|
||||||
|
"typescript": "~3.9.7"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@aws-cdk/core": "1.120.0",
|
||||||
|
"source-map-support": "^0.5.16"
|
||||||
|
}
|
||||||
|
}
|
||||||
13
test/thundercloud.test.ts
Normal file
13
test/thundercloud.test.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { expect as expectCDK, matchTemplate, MatchStyle } from '@aws-cdk/assert';
|
||||||
|
import * as cdk from '@aws-cdk/core';
|
||||||
|
import * as Thundercloud from '../lib/thundercloud-stack';
|
||||||
|
|
||||||
|
test('Empty Stack', () => {
|
||||||
|
const app = new cdk.App();
|
||||||
|
// WHEN
|
||||||
|
const stack = new Thundercloud.ThundercloudStack(app, 'MyTestStack');
|
||||||
|
// THEN
|
||||||
|
expectCDK(stack).to(matchTemplate({
|
||||||
|
"Resources": {}
|
||||||
|
}, MatchStyle.EXACT))
|
||||||
|
});
|
||||||
30
tsconfig.json
Normal file
30
tsconfig.json
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2018",
|
||||||
|
"module": "commonjs",
|
||||||
|
"lib": [
|
||||||
|
"es2018"
|
||||||
|
],
|
||||||
|
"declaration": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"strictNullChecks": true,
|
||||||
|
"noImplicitThis": true,
|
||||||
|
"alwaysStrict": true,
|
||||||
|
"noUnusedLocals": false,
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": false,
|
||||||
|
"inlineSourceMap": true,
|
||||||
|
"inlineSources": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"strictPropertyInitialization": false,
|
||||||
|
"typeRoots": [
|
||||||
|
"./node_modules/@types"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"cdk.out"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user