Skip to content

Commit

Permalink
Switch from S3 to GCS in production.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Leduc-Hamel committed Mar 11, 2021
1 parent 9dea51f commit 82e31c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/app/trieugene.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ func NewTrieugeneStore(cfg *config.Config, kind string, key string, value string

func (t *trieugene) Run(ctx context.Context) error {
store := store.NewS3(&store.S3Params{
AccessKey: t.cfg.S3AccessKey(),
SecretKey: t.cfg.S3SecretKey(),
URL: t.cfg.S3URL(),
AccessKey: t.cfg.GCSAccessKey(),
SecretKey: t.cfg.GCSAccessSecret(),
URL: t.cfg.GCSURL(),
Bucket: t.cfg.S3Bucket(),
Region: t.cfg.S3Region(),
})
Expand Down
10 changes: 9 additions & 1 deletion pkg/config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ func (c *Config) GCSURL() string {
return GetEnv("TRIEUGENE_GCS_URL", "trieugene.myshopify.io:4443")
}

func (c *Config) GCSAccessKey() string {
return GetEnv("TRIEUGENE_GCS_ACCESS_KEY", "")
}

func (c *Config) GCSAccessSecret() string {
return GetEnv("TRIEUGENE_GCS_ACCESS_SECRET", "")
}

func (c *Config) HTTPPort() int {
return c.httpPort
}
Expand Down Expand Up @@ -86,7 +94,7 @@ func (c *Config) S3URL() string {
}

func (c *Config) S3Region() string {
return GetEnv("TRIEUGENE_S3_REGION", "us-east-1")
return GetEnv("TRIEUGENE_S3_REGION", "auto")
}

func (c *Config) StatsdURL() string {
Expand Down

0 comments on commit 82e31c0

Please sign in to comment.