AwsServerModule
Hierarchy
- AModule<AwsServerModuleSchema, AwsServer>
- AwsServerModule
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
moduleId: string
The ID this module is loaded under.
Returns AwsServerModule
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 server, and anchors what it may reach. Each bucket prefix, table and function it may reach is also joined to the server by a grant overlay, which creates nothing; an IAM statement names nothing in the graph, and is only anchored. A prefix or table granted more than once is granted once, with the access of all its grants.
Parameters
inputs: AwsServerModuleSchema
Returns Promise<(AwsServer | AwsServerDynamoDBAccessOverlay | AwsServerLambdaAccessOverlay | AwsServerS3AccessOverlay)[]>
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 the app this server belongs to.
Parameters
inputs: AwsServerModuleSchema
Returns Promise<{ account: Account; app: App }>
AwsServerModuledeclares a server's identity: what its code may reach, through grants to buckets (s3), tables (dynamodb), functions (lambda) or rawiamStatements, and itssecurityGroupRules.It creates nothing and knows nothing about where the code runs. The execution that runs the code, on ECS or on Lambda, reads the server and creates everything its runtime needs, including the IAM role holding these grants.
Nothing: it creates no resources. The execution running the server creates the IAM role holding its grants.
None: a changed grant updates the execution's IAM role in place, and the code gets it within seconds.
TypeScript
Modules/Server/AwsServer
A grant names a model octo builds, through
s3,dynamodbandlambda;iamStatementstakes raw statements for what octo does not build. Lambda ignoressecurityGroupRules, which only an ECS execution applies.A
lambdagrant reaches only a function of another app.An S3
allowWritegrant includes deleting objects: no grant lets a server put objects without deleting them.A DynamoDB grant covers the table and all its indexes, never one index.
Nothing.
Nothing of its own: changing
serverKeygives the code a new identity, and each execution running it a new IAM role.Servermodel.