Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Try passing values on the command line.
Browse files Browse the repository at this point in the history
Can we pass env vars as part of an Exec call?
  • Loading branch information
jadudm committed Mar 5, 2024
1 parent 4cb823b commit c6f9380
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/pipes/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package pipes

import (
"fmt"
"os"
"strings"

"github.com/bitfield/script"
Expand All @@ -16,12 +15,15 @@ func S3(in_pipe *script.Pipe,
prefix string,
source_db string,
schema string, table string, debug bool) *script.Pipe {
os.Setenv("AWS_ACCESS_KEY_ID", up.AccessKeyId)
os.Setenv("AWS_SECRET_ACCESS_KEY", up.SecretAccessKey)
os.Setenv("AWS_DEFAULT_REGION", up.Region)
// 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{
fmt.Sprintf("AWS_ACCESS_KEY_ID='%s'", up.AccessKeyId),
fmt.Sprintf("AWS_SECRET_ACCESS_KEY='%s'", up.SecretAccessKey),
fmt.Sprintf("AWS_DEFAULT_REGION='%s'", up.Region),
"aws",
"s3",
"cp",
Expand Down

0 comments on commit c6f9380

Please sign in to comment.