
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@aws-serverless-tools/nest
Advanced tools
A collection of tools to make building and deploying AWS serverless Nest applications AWESOME.
In alpha mode. Maybe pre-alpha. Docs coming soon.
If you did not use the init
process from the @aws-serverless-tools/cli
package, the tools package can be installed directly:
npm install --save @aws-serverless-tools/cli
This module simplifies the following:
/apidocs
by default).First, import the module into your AppModule.
// app.module.ts
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AwsServerlessToolsModule } from 'nest-aws-serverless-tools';
@Module({
imports: [
AwsServerlessToolsModule,
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
Once imported, update the main.ts
file to retrieve the ApiGatewayOpenApi
service and start the document server.
With this approach, every build will update the OpenAPI specification file and generate an Angular client.
// main.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ApiGatewayOpenApi } from 'nest-aws-serverless-tools';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const openApi = await app.get(ApiGatewayOpenApi)
.setNestAppContext(app)
.enableDocumentationWebServer();
await openApi.generateOpenApiFile();
await openApi.generateAngularClient();
await app.listen(3000);
}
bootstrap();
npm run openapi
)This is the recommended option. This will generate the OpenAPI specification file and Angular client but only when --openapi-generate is passed to the command.
// main.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ApiGatewayOpenApi } from 'nest-aws-serverless-tools';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const openApi = await app.get(ApiGatewayOpenApi)
.setNestAppContext(app)
.enableDocumentationWebServer();
if (!(await openApi.handleGenerateCommand(true, true))) {
await app.listen(3000);
}
}
bootstrap();
In package.json
, there are the following configuration options pre-enabled:
{
"openApi": {
"filePath": "./cfn/openapi.yaml",
"clientOutputFolderPath": "./angular-client/",
"clientAdditionalProperties": "apiModulePrefix=KerryTest,fileNaming=kebab-case,stringEnums=true,taggedUnions=true"
}
}
${clientModulePrefix}ApiModule
.When running your Lambda in AWS, you'll likely environment variables for configuration. However, maintaining these variables in process.env
can be cumbersome.
CloudFormationLambdaParametersConfig
is a loader for the @nestjs/config
package to look at your CloudFormation file, cross-reference your Lambda environment variables to a specified parameters file, and make them available via the nestjs/config
ConfigService.
Note that since this uses @nestjs/config
, you are free to use .env
files or any other configuration you see fit for secrets or other configuration options not managed via parameters.
Add the @nestjs/config
ConfigModule to your AppModule imports.
// main.ts
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AwsServerlessToolsModule, CloudFormationLambdaParametersConfig } from 'nest-aws-serverless-tools';
@Module({
imports: [
AwsServerlessToolsModule,
ConfigModule.forRoot({
load: [CloudFormationLambdaParametersConfig],
isGlobal: true,
}),
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
Nest is MIT licensed.
FAQs
A collection of tools to make building and deploying AWS serverless Nest applications AWESOME.
We found that @aws-serverless-tools/nest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.