Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s3: storage class for files in result storage bucket #402

Merged
merged 3 commits into from
Oct 12, 2023

Conversation

f100024
Copy link
Contributor

@f100024 f100024 commented Oct 10, 2023

More about Storage Class:
https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html

Briefly from aws-sdk-go:

By default, Amazon S3 uses the STANDARD Storage Class to store newly created
objects. The STANDARD storage class provides high durability and high availability.
Depending on performance needs, you can specify a different Storage Class.
Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For more information,
see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) 
in the Amazon S3 User Guide.

@f100024 f100024 force-pushed the add-s3-storage-class branch from 9a8400d to ec43b63 Compare October 10, 2023 12:45

func WithFileStorageClass(storageClass string) Option {
return func(h *S3Storage) {
switch storageClass {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems clearer and simpler keeping the string as it is?
i.e. REDUCED_REDUNDANCY, STANDARD_IA etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -90,6 +91,8 @@ func WithAWS(fs *flag.FlagSet, cb func() (*zap.Logger, bool)) imagor.Option {
"Upload ACL for S3 Result Storage")
s3ResultStorageExpiration = fs.Duration("s3-result-storage-expiration", 0,
"S3 Result Storage expiration duration e.g. 24h. Default no expiration")
s3FileStorageClass = fs.String("s3-file-storage-class", "STANDARD",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better rename to s3StorageClass, s3-storage-class? As file storage would result confusion with file system storage.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add test case around https://github.com/cshum/imagor/blob/master/config/awsconfig/awsconfig_test.go

  • default should expect STANDARD
  • a valid setting e.g. REDUCED_REDUNDANCY

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Owner

@cshum cshum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cshum cshum merged commit 410b6c8 into cshum:master Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants