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

🍀 Proposal: S3 Backend #485

Closed
algobot76 opened this issue May 14, 2022 · 1 comment · Fixed by #546 or #548
Closed

🍀 Proposal: S3 Backend #485

algobot76 opened this issue May 14, 2022 · 1 comment · Fixed by #546 or #548
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@algobot76
Copy link
Contributor

algobot76 commented May 14, 2022

Proposal: S3 Backend

Description

Implement an S3 backend so that we can store the state file in S3.

Assumptions

  • Use aws-sdk-go-v2 for interactions with AWS apis.
  • Credentials stored in `~/.aws/credentials
  • Use mocks for unit testing.

Design

S3Backend

type S3Backend struct {
    file *S3File
}
func NewS3Backend(bucket, region, key string) *S3Backend
func (b *S3Backend) Read() (byte[], error)
func (b *S3Backend) Write(data byte[]) error

S3File

type S3File struct {
    Bucket string
    Region string
    Key string
    ctx context.Context
    client *s3.Client
}
func NewS3File(ctx context.Context, bucket, region, key string, client *s3.Client) (*S3File, error)
func (f *S3File) Put(data []byte) error
func (f *S3File) Download() ([]byte error)

Has the Feature been Requested Before?

#378

@algobot76 algobot76 mentioned this issue May 15, 2022
2 tasks
@daniel-hutao daniel-hutao added the enhancement New feature or request label May 16, 2022
@daniel-hutao daniel-hutao changed the title Proposal: S3 Backend 🍀 Proposal: S3 Backend May 17, 2022
@daniel-hutao daniel-hutao linked a pull request May 17, 2022 that will close this issue
2 tasks
@daniel-hutao daniel-hutao removed a link to a pull request May 17, 2022
2 tasks
@daniel-hutao daniel-hutao added this to the dtm-v0.6.0 milestone May 17, 2022
@IronCore864
Copy link
Member

Related to #378.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants