Skip to content

Commit

Permalink
Merge branch 'main' into dapr-state-store-clickhouse
Browse files Browse the repository at this point in the history
  • Loading branch information
middt authored Dec 10, 2024
2 parents d541fda + 026ae76 commit 3e2b6b0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions common/authentication/postgresql/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ func (m *PostgresAuthMetadata) InitWithMetadata(meta map[string]string, opts Ini

func (m *PostgresAuthMetadata) BuildAwsIamOptions(logger logger.Logger, properties map[string]string) (*aws.Options, error) {
awsRegion, _ := metadata.GetMetadataProperty(m.awsEnv.Metadata, "AWSRegion")
if awsRegion == "" {
return nil, errors.New("metadata property AWSRegion is missing")
region, _ := metadata.GetMetadataProperty(m.awsEnv.Metadata, "region")
if region == "" {
region = awsRegion
}
if region == "" {
return nil, errors.New("metadata properties 'region' or 'AWSRegion' is missing")
}

// Note: access key and secret keys can be optional
Expand All @@ -114,7 +118,7 @@ func (m *PostgresAuthMetadata) BuildAwsIamOptions(logger logger.Logger, properti
sessionName = "DaprDefaultSession"
}
return &aws.Options{
Region: awsRegion,
Region: region,
AccessKey: awsAccessKey,
SecretKey: awsSecretKey,
SessionToken: sessionToken,
Expand Down

0 comments on commit 3e2b6b0

Please sign in to comment.