AwsEcrImageModule
Hierarchy
- AModule<AwsEcrImageModuleSchema, AwsEcrImage>
- AwsEcrImageModule
Index
Constructors
Properties
Methods
Resources
Constructors
constructor
Parameters
moduleId: string
The ID this module is loaded under.
Returns AwsEcrImageModule
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 image in the account of its regions, and registers one ECR repository per AWS region it is used in.
Parameters
inputs: AwsEcrImageModuleSchema
Returns Promise<AwsEcrImage>
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 the image sits in, and the distinct AWS regions an ECR repository is needed in.
Parameters
inputs: AwsEcrImageModuleSchema
Returns Promise<{ account: Account; uniqueImageRepositories: { awsAccountId: string; awsRegionId: string }[] }>
AwsEcrImageModulecreates the ECR repositories a container image is pushed to, one in each of itsregions, keeping the newestimageTagsToKeepversions.It creates the repositories and nothing else - the versions inside them are published by the
AwsEcrImageTagModule, one module per version.ECR bills about $0.10 per GB-month of images stored; pulling within the same region is free.
imageTagsToKeepbounds the bill by deleting all but the newest tags.None for a change to
imageTagsToKeep. A replacement deletes the repository with every image in it.TypeScript
Modules/Image/AwsEcrImage
A tag is immutable: a version is never overwritten, only deleted and published again. Images are not scanned for vulnerabilities.
Deleting the module, or a change that replaces the repository, deletes every image in it, even one a running service still uses. An image octo publishes can be built again from its Dockerfile, while the code it was built from still exists.
Changing
imageFamilyorimageNamereplaces the repositories. Adding a region toregionscreates a repository there, and removing one deletes that repository with its images.imageTagsToKeepchanges in place.Imagemodel.