Skip to content

Commit

Permalink
Merge pull request #138 from Ilhasoft/dynamo-region-config
Browse files Browse the repository at this point in the history
add dynamodb aws region config
  • Loading branch information
paulobernardoaf authored Feb 6, 2025
2 parents a20f3c9 + aeecb31 commit b44d654
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mailroom.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (mr *Mailroom) Start() error {
}

// setup DynamoDB
mr.rt.Dynamo, err = dynamo.NewService(c.AWSAccessKeyID, c.AWSSecretAccessKey, c.AWSRegion, c.DynamoEndpoint, c.DynamoTablePrefix)
mr.rt.Dynamo, err = dynamo.NewService(c.AWSAccessKeyID, c.AWSSecretAccessKey, c.DynamoRegion, c.DynamoEndpoint, c.DynamoTablePrefix)
if err != nil {
return err
}
Expand Down
2 changes: 2 additions & 0 deletions runtime/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type Config struct {

DynamoEndpoint string `help:"DynamoDB service endpoint, e.g. https://dynamodb.us-east-1.amazonaws.com"`
DynamoTablePrefix string `help:"prefix to use for DynamoDB tables"`
DynamoRegion string `help:"DynamoDB aws region, e.g. us-east-1"`

S3Endpoint string `help:"S3 service endpoint, e.g. https://s3.amazonaws.com"`
S3AttachmentsBucket string `help:"S3 bucket to write attachments to"`
Expand Down Expand Up @@ -127,6 +128,7 @@ func NewDefaultConfig() *Config {

DynamoEndpoint: "", // let library generate it
DynamoTablePrefix: "Temba",
DynamoRegion: "us-east-1",

S3Endpoint: "https://s3.amazonaws.com",
S3AttachmentsBucket: "temba-attachments",
Expand Down
2 changes: 1 addition & 1 deletion testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func Runtime() (context.Context, *runtime.Runtime) {
cfg.DynamoEndpoint = "http://localhost:6000"
cfg.DynamoTablePrefix = "Test"

dyna, err := dynamo.NewService(cfg.AWSAccessKeyID, cfg.AWSSecretAccessKey, cfg.AWSRegion, cfg.DynamoEndpoint, cfg.DynamoTablePrefix)
dyna, err := dynamo.NewService(cfg.AWSAccessKeyID, cfg.AWSSecretAccessKey, cfg.DynamoRegion, cfg.DynamoEndpoint, cfg.DynamoTablePrefix)
noError(err)

s3svc, err := s3x.NewService(cfg.AWSAccessKeyID, cfg.AWSSecretAccessKey, cfg.AWSRegion, cfg.S3Endpoint, cfg.S3Minio)
Expand Down

0 comments on commit b44d654

Please sign in to comment.