@lafken/main
v0.6.4
Published
Core entry point for Lafken applications, orchestrating infrastructure creation and resolver registration
Maintainers
Readme
@lafken/main
This is the core entry point of an Lafken application. Internally, it initializes the @cdktf/provider-aws, allowing you to register resolvers, modules, and global configuration. It orchestrates the creation of all the infrastructure required for a fully serverless application.
Installation
npm install @lafken/mainFeatures
createApp
This is the main entry point of the application. It allows you to register the resolvers required for processing your infrastructure, as well as define global configuration.
Creating an application is straightforward.
createApp({
name: 'awesome',
modules: [],
resolvers: [],
globalConfig: {
tags: {
'global-tag': 'awesome-tag',
},
},
extend() {
// extend your application
},
});Just give your application a name, import your resolvers—such as ApiResolver or BucketResolver—add your modules, and you’re ready to go.
createModule
Each module contains one or more resources. With a module, you can import your classes and define the resources that will be processed by a resolver.
Additionally, you can apply global configuration to all resources managed by the module.
createModule({
name: 'awesome-module',
resources: [/** API, QUEUE, SCHEDULE */],
globalConfig: {
lambda: {
services: ['cloudwatch', 's3', 'sqs', 'dynamodb'],
},
},
});This allows you to group related functionality, organize your infrastructure, and apply shared settings across multiple resources.
