Skip to main content

AwsServerlessRegionModule

AwsServerlessRegionModule declares an AWS region (regionId) with no network of its own, for what runs without a VPC: Lambda functions, buckets, tables and distributions.

It creates no resources: no VPC, no subnets, no gateways. The region exists so that what lives in it is drawn where it lives.

@cost

Nothing: it creates no resources.

@downtime

None: it creates no resources.

@example

TypeScript

import { type Account, stub } from '@quadnix/octo';
import { AwsServerlessRegionModule } from '@quadnix/octo-aws-cdk/modules/region/aws-serverless-region';
import { AwsServerlessRegionId } from '@quadnix/octo-aws-cdk/modules/region/aws-serverless-region/schema';

octo.loadModule(AwsServerlessRegionModule, 'my-region-module', {
account: stub<Account>('${{my-account-module.model.account}}'),
name: 'my-region',
regionId: AwsServerlessRegionId.AWS_US_EAST_1,
});
@group

Modules/Region/AwsServerlessRegion

@limit

It has no network, so nothing that needs a VPC can sit in it: no ECS server, no EFS filesystem, no load balancer. Those take AwsSingleAzRegionModule or AwsMultiAzRegionModule.

@losesData

Nothing.

@replaces

Nothing: it creates no resources. Changing regionId moves what lives in it, through each of their own modules.

@see

Hierarchy

Index

Constructors

constructor

  • Parameters

    • moduleId: string

      The ID this module is loaded under.

    Returns AwsServerlessRegionModule

Properties

readonlyinheritedmoduleId

moduleId: string

The ID this module was loaded under. It scopes everything the module produces, so the same module class can be loaded more than once.

staticreadonlyinheritedMODULE_PACKAGE

MODULE_PACKAGE: string

The package the module is registered under, set by Module.

staticreadonlyinheritedMODULE_SCHEMA

MODULE_SCHEMA: any

The schema of the module's inputs, set by Module.

Methods

onInit

  • Creates the region under the account, and anchors its AWS region ID for other modules to find.


    Parameters

    Returns Promise<AwsServerlessRegion>

inheritedregisterHooks

  • registerHooks(): { postCommitHooks?: PostHookSignature[]; postModelActionHooks?: PostHookSignature[]; postResourceActionHooks?: PostHookSignature[]; preCommitHooks?: PreHookSignature[]; preModelActionHooks?: PreHookSignature[]; preResourceActionHooks?: PreHookSignature[] }
  • To hook custom behavior into Octo's lifecycle for the duration of this module. Override it to return the callbacks you want run.

    @see

    Techniques for Hooks.


    Returns { postCommitHooks?: PostHookSignature[]; postModelActionHooks?: PostHookSignature[]; postResourceActionHooks?: PostHookSignature[]; preCommitHooks?: PreHookSignature[]; preModelActionHooks?: PreHookSignature[]; preResourceActionHooks?: PreHookSignature[] }

    • optionalpostCommitHooks?: PostHookSignature[]
    • optionalpostModelActionHooks?: PostHookSignature[]
    • optionalpostResourceActionHooks?: PostHookSignature[]
    • optionalpreCommitHooks?: PreHookSignature[]
    • optionalpreModelActionHooks?: PreHookSignature[]
    • optionalpreResourceActionHooks?: PreHookSignature[]

inheritedregisterMetadata

  • To derive values that both AModule.onInit and this module's actions need - typically facts resolved from another module's anchors, such as an account ID or a region's availability zones. Override it, and the returned object is handed to every action of this module as actionInputs.metadata.


    Parameters

    Returns Promise<Record<string, unknown>>