-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cb1e47
commit c63fc45
Showing
28 changed files
with
131 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { NxDeployItBaseOptions } from '../base.adapter.model'; | ||
import { DeploymentType } from '../../utils/application-type'; | ||
|
||
export interface NestJSOptions extends NxDeployItBaseOptions { | ||
deploymentType: DeploymentType; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...eploy-it/src/schematics/init/files/aws/nestjs-kubernetes/__rootDir__/main.aws.ts.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Logger } from '@nestjs/common'; | ||
import { NestFactory } from '@nestjs/core'; | ||
|
||
import { <%= getRootModuleName() %> } from './<%= getRootModulePath() %>'; | ||
|
||
export async function bootstrap() { | ||
const app = await NestFactory.create(<%= getRootModuleName() %>); | ||
const port = process.env.PORT || 3333; | ||
await app.listen(port, () => { | ||
Logger.log('Listening at http://localhost:' + port); | ||
}); | ||
} |
1 change: 1 addition & 0 deletions
1
...loy-it/src/schematics/init/files/aws/nestjs-kubernetes/infrastructure/.gitignore.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
buildcache |
7 changes: 7 additions & 0 deletions
7
...loy-it/src/schematics/init/files/aws/nestjs-kubernetes/infrastructure/Dockerfile.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM node:10-alpine | ||
WORKDIR /usr/src/app | ||
|
||
COPY functions/dist/main . | ||
|
||
EXPOSE 3000 | ||
CMD ["node", "index.js"] |
3 changes: 3 additions & 0 deletions
3
...hematics/init/files/aws/nestjs-kubernetes/infrastructure/functions/main/index.ts.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { bootstrap } from '../../../<%= getRootDirectory() %>/main.aws'; | ||
|
||
bootstrap(); |
35 changes: 35 additions & 0 deletions
35
...eploy-it/src/schematics/init/files/aws/nestjs-kubernetes/infrastructure/index.ts.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as aws from '@pulumi/aws'; | ||
import * as awsx from '@pulumi/awsx'; | ||
import * as eks from '@pulumi/eks'; | ||
import * as pulumi from '@pulumi/pulumi'; | ||
|
||
const stackConfig = new pulumi.Config(); | ||
const config = { | ||
// ===== DONT'T TOUCH THIS -> CONFIG REQUIRED BY nx-deploy-it ====== | ||
projectName: stackConfig.get('projectName') | ||
// ===== END ====== | ||
}; | ||
const projectName = config.projectName; | ||
const stageName = pulumi.getStack().split('-')[0]; | ||
const region = aws.config.requireRegion(); | ||
|
||
// Create a VPC for our cluster. | ||
const vpc = new awsx.ec2.Vpc(`${projectName}-vpc`, { | ||
numberOfAvailabilityZones: 2 | ||
}); | ||
|
||
// Create the EKS cluster itself and a deployment of the Kubernetes dashboard. | ||
const cluster = new eks.Cluster(`${projectName}-cluster`, { | ||
vpcId: vpc.id, | ||
subnetIds: vpc.publicSubnetIds, | ||
instanceType: 't3.micro', | ||
desiredCapacity: 1, | ||
minSize: 1, | ||
maxSize: 1, | ||
deployDashboard: true | ||
}); | ||
|
||
// Export the cluster's kubeconfig. | ||
export const kubeconfig = cluster.kubeconfig; | ||
|
||
// exports.endpoint = pulumi.interpolate`${deployment.invokeUrl}${stageName}`; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
...-it/src/schematics/init/files/gcp/nestjs-serverless/infrastructure/tsconfig.json.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../tsconfig.app.json", | ||
"compilerOptions": { | ||
"target": "es2015", | ||
"moduleResolution": "node", | ||
"module": "commonjs" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters