
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@nodeboot/starter-aws
Advanced tools
The NodeBoot AWS Starter package provides seamless integration with AWS services using the AWS SDK v3. It enables dependency injection and auto-configuration for AWS clients such as DynamoDB, S3, Secrets Manager, SNS, and SQS.
npm install @nodeboot/starter-aws
@EnableAws decorator:import "reflect-metadata";
import {Container} from "typedi";
import {NodeBoot, NodeBootApp, NodeBootApplication, NodeBootAppView} from "@nodeboot/core";
import {ExpressServer} from "@nodeboot/express-server";
import {EnableDI} from "@nodeboot/di";
import {EnableComponentScan} from "@nodeboot/scan";
import {EnableAws} from "@nodeboot/starter-aws";
@EnableDI(Container)
@EnableAws()
@EnableComponentScan()
@NodeBootApplication()
export class FactsServiceApp implements NodeBootApp {
start(): Promise<NodeBootAppView> {
return NodeBoot.run(ExpressServer);
}
}
By doing this, the NodeBoot autoconfiguration mechanism will setup AWS clients depending on configurations under the "integrations.aws" config path. Clients are optional, so if configuration for a client is provided, the system will require the installation of the AWS client package in order to setup the integration. If integration is well configured, the client is created and added to the Dependency Injection container for later injection into services.
AWS SDK configuration can be done through environment variables, configuration files, or explicitly in the application " app-config.yaml" file.
app-config.yamlThe recommended way to provide configurations in Node-Boot is to use the application config file "app-config.yaml" where you can provide all sort of configs, including environment variables.
integrations:
aws:
credentials:
accessKeyId: "${AWS_ACCESS_KEY_ID}"
secretAccessKey: "${AWS_SECRET_ACCESS_KEY}"
Set the following environment variables to configure AWS SDK authentication:
export AWS_ACCESS_KEY_ID=your-access-key
export AWS_SECRET_ACCESS_KEY=your-secret-key
export AWS_SESSION_TOKEN=your-session-token # (Optional)
export AWS_REGION=us-east-1
AWS credentials can be stored in ~/.aws/credentials and the region in ~/.aws/config.
~/.aws/credentials:
[default]
aws_access_key_id=your-access-key
aws_secret_access_key=your-secret-key
~/.aws/config:
[default]
region=us-east-1
For more information regarding AWS SDK configuration options, please refer to Setting_AWS_Credentials
npm install @aws-sdk/client-dynamodb
Add the AWS region of your DynamoDB to the config path:
integrations:
aws:
dynamodb:
region: "eu-central-1"
@Service()
export class SampleService {
constructor(private readonly dynamoDBClient: DynamoDBClient) {}
async listTables(): Promise<void> {
const command = new ListTablesCommand({});
const response = await this.dynamoDBClient.send(command);
console.log("DynamoDB Tables:", response.TableNames);
}
}
npm install @aws-sdk/client-s3
Add the AWS region of your S3 bucket to the config path:
integrations:
aws:
s3:
region: "eu-central-1"
@Service()
export class SampleService {
constructor(private readonly s3Client: S3Client) {}
async listBuckets(): Promise<void> {
const command = new ListBucketsCommand({});
const response = await this.s3Client.send(command);
console.log("S3 Buckets:", response.Buckets);
}
}
npm install @aws-sdk/client-secrets-manager
Add the AWS region of your Secrets Manager to the config path:
integrations:
aws:
secrets:
region: "eu-central-1"
@Service()
export class SampleService {
constructor(private readonly secretsClient: SecretsManagerClient) {}
async getSecret(secretName: string): Promise<void> {
const command = new GetSecretValueCommand({SecretId: secretName});
const response = await this.secretsClient.send(command);
console.log("Secret Value:", response.SecretString);
}
}
npm install @aws-sdk/client-sns
Add the AWS region of your SNS topic to the config path:
integrations:
aws:
sns:
region: "eu-central-1"
@Service()
export class SampleService {
constructor(private readonly snsClient: SNSClient) {}
async publishMessage(topicArn: string, message: string): Promise<void> {
const command = new PublishCommand({TopicArn: topicArn, Message: message});
await this.snsClient.send(command);
console.log("Message sent to SNS");
}
}
npm install @aws-sdk/client-sqs
Add the AWS region of your SQS queue to the config path:
integrations:
aws:
sqs:
region: "eu-central-1"
@Service()
export class SampleService {
constructor(readonly sqsClient: SQSClient) {}
async sendMessage(queueUrl: string, messageBody: string): Promise<void> {
const command = new SendMessageCommand({QueueUrl: queueUrl, MessageBody: messageBody});
await this.sqsClient.send(command);
console.log("Message sent to SQS");
}
}
import {SqsListener, MessageEnvelop} from "@nodeboot/starter-aws";
@Service()
export class SampleService {
// Using SQS Queue URL hardcoded
@SqsListener("https://sqs.us-east-1.amazonaws.com/123456789012/my-queue")
async onMessage(message: MessageEnvelop): Promise<void> {
console.log("Message received from SQS");
}
}
@Component()
export class SampleComponent {
// Using SQS queue url with a config placeholder
@SqsListener("${com.example.aws.sqs.queue-url}")
async onMessage(message: MessageEnvelop): Promise<void> {
console.log("Message received from SQS");
}
}
In this last case you need provide the config path in your app-config.yaml file:
com:
example:
aws:
sqs:
queue-url: "https://sqs.us-east-1.amazonaws.com/123456789012/my-queue"
NodeBoot AWS Starter simplifies AWS client integration using dependency injection and dynamic configuration.
For further information, refer to the official AWS SDK documentation: AWS SDK v3.
FAQs
Node-Boot starter package for AWS services
The npm package @nodeboot/starter-aws receives a total of 60 weekly downloads. As such, @nodeboot/starter-aws popularity was classified as not popular.
We found that @nodeboot/starter-aws demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.