Skip to content

Commit

Permalink
Setting all the env.
Browse files Browse the repository at this point in the history
And, getting the `-` correct.
  • Loading branch information
jadudm committed Mar 4, 2024
1 parent faeda59 commit 2b8c314
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/pipes/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ import (

// https://bitfieldconsulting.com/golang/scripting
func S3(in_pipe *script.Pipe, up *vcap.CredentialsS3, prefix string, source_db string) *script.Pipe {
os.Setenv("ACCESS_KEY_ID", up.AccessKeyId)
os.Setenv("SECRET_ACCESS_KEY", up.SecretAccessKey)
os.Setenv("AWS_ACCESS_KEY_ID", up.AccessKeyId)
os.Setenv("AWS_SECRET_ACCESS_KEY", up.SecretAccessKey)
os.Setenv("AWS_DEFAULT_REGION", up.Region)

// https://serverfault.com/questions/886562/streaming-postgresql-pg-dump-to-s3
cmd := []string{
"aws",
"s3",
"cp",
"-",
fmt.Sprintf("s3://%s/backups/%s-%s.dump",
up.Bucket,
prefix,
source_db),
"-",
}

// Combine the slice for printing and execution.
Expand Down

0 comments on commit 2b8c314

Please sign in to comment.