worker: Define new jobs to handle copying and resharing of images

The copy job copies from one region to another. It does not preserve the
sharing on the ami and it's snapshot, that needs to be queued
separately.
This commit is contained in:
Sanne Raymaekers 2022-06-30 11:46:24 +02:00 committed by Ondřej Budai
parent 5e9ecd3ae4
commit 099b34b301
5 changed files with 405 additions and 42 deletions

View file

@ -256,6 +256,33 @@ type ContainerResolveJobResult struct {
JobResult
}
type AWSEC2ShareJob struct {
Ami string `json:"ami"`
Region string `json:"region"`
ShareWithAccounts []string `json:"shareWithAccounts"`
}
type AWSEC2ShareJobResult struct {
JobResult
Ami string `json:"ami"`
Region string `json:"region"`
}
type AWSEC2CopyJob struct {
Ami string `json:"ami"`
SourceRegion string `json:"source_region"`
TargetRegion string `json:"target_region"`
TargetName string `json:"target_name"`
}
type AWSEC2CopyJobResult struct {
JobResult
Ami string `json:"ami"`
Region string `json:"region"`
}
//
// JSON-serializable types for the client
//