New upload target: AWS S3

Uploads an artifact to an S£ bucket and returns a presigned URL to allow
the user to download the file.

Although it uses a lot of common code with the AWS AMI upload target,
it's treated as a completely separate target.
This commit is contained in:
Achilleas Koutsou 2021-05-27 14:52:32 +02:00 committed by Tom Gundersen
parent 14aea30bcd
commit e5b28c0bb3
8 changed files with 185 additions and 51 deletions

View file

@ -26,3 +26,28 @@ func (AWSTargetResultOptions) isTargetResultOptions() {}
func NewAWSTargetResult(options *AWSTargetResultOptions) *TargetResult {
return newTargetResult("org.osbuild.aws", options)
}
type AWSS3TargetOptions struct {
Filename string `json:"filename"`
Region string `json:"region"`
AccessKeyID string `json:"accessKeyID"`
SecretAccessKey string `json:"secretAccessKey"`
Bucket string `json:"bucket"`
Key string `json:"key"`
}
func (AWSS3TargetOptions) isTargetOptions() {}
func NewAWSS3Target(options *AWSS3TargetOptions) *Target {
return newTarget("org.osbuild.aws.s3", options)
}
type AWSS3TargetResultOptions struct {
URL string `json:"url"`
}
func (AWSS3TargetResultOptions) isTargetResultOptions() {}
func NewAWSS3TargetResult(options *AWSS3TargetResultOptions) *TargetResult {
return newTargetResult("org.osbuild.aws.s3", options)
}