AwsDynamoDBServiceModule
Hierarchy
- AModule<AwsDynamoDBServiceModuleSchema, AwsDynamoDBService>
- AwsDynamoDBServiceModule
Index
Constructors
Properties
Methods
Resources
Constructors
constructor
Parameters
moduleId: string
The ID this module is loaded under.
Returns AwsDynamoDBServiceModule
Properties
readonlyinheritedmoduleId
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
The package the module is registered under, set by Module.
staticreadonlyinheritedMODULE_SCHEMA
The schema of the module's inputs, set by Module.
Methods
onInit
Creates the DynamoDB table service, and anchors its table name for other modules to find.
Parameters
inputs: AwsDynamoDBServiceModuleSchema
Returns Promise<AwsDynamoDBService>
inheritedregisterHooks
To hook custom behavior into Octo's lifecycle for the duration of this module. Override it to return the callbacks you want run.
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[]
registerMetadata
Resolves the account and region this table is created in. The region may be networked or serverless; the table only needs its AWS region ID.
Parameters
inputs: AwsDynamoDBServiceModuleSchema
Returns Promise<{ awsAccountId: string; awsRegionId: string }>
AwsDynamoDBServiceModulecreates one DynamoDB table with its key schema, secondary indexes, streams, billing mode, TTL, point-in-time recovery and deletion protection; a server is granted access to it throughAwsServerModule.With
billingModePAY_PER_REQUEST, DynamoDB bills each read and write (about $0.125 per million reads and $0.625 per million writes in us-east-1), so an idle table costs only its storage. WithPROVISIONED, it bills the capacity reserved every hour, used or not. Storage is about $0.25 per GB-month, point-in-time recovery adds about $0.20 per GB-month, and a stream is free to write.None for a change made in place: the table keeps serving while a new global secondary index fills. A replacement deletes the table and creates an empty one.
TypeScript
Modules/Service/AwsDynamoDBService
One global secondary index is added per run, and an existing one never changes: remove it in one run and add its successor in the next. AWS allows 20 global and 5 local secondary indexes on a table.
An item holds at most 400 KB. Neither a join nor a query across tables exists: an app that needs them wants a relational database, which this module is not.
DeletionProtectionEnabledchanges in a run that changes nothing else about the table.The table class is
STANDARD;STANDARD_INFREQUENT_ACCESScannot be set.Deleting the module, or a change that replaces the table, deletes every item, which octo cannot put back. With
DeletionProtectionEnabled, AWS refuses the deletion until protection is turned off in a run of its own. WithPointInTimeRecoveryEnabled, AWS keeps a backup of a deleted table for 35 days.Changing
TableName,KeySchema,LocalSecondaryIndexesorregionreplaces the table, because DynamoDB fixes them when the table is created. Every other input changes it in place.Servicemodel.