diff --git a/charts/flyte-core/templates/admin/configmap.yaml b/charts/flyte-core/templates/admin/configmap.yaml index 53af659e8b..04e5cac6b3 100644 --- a/charts/flyte-core/templates/admin/configmap.yaml +++ b/charts/flyte-core/templates/admin/configmap.yaml @@ -48,6 +48,11 @@ data: notifications.yaml: | notifications: type: {{ .Values.workflow_notifications.config.notifications.type }} + {{- if not .Values.workflow_notifications.config.notifications.aws }} + {{- with .Values.workflow_notifications.config.notifications.region }} + region: {{ tpl . $ }} + {{- end }} + {{- end }} {{- if eq .Values.workflow_notifications.config.notifications.type "aws" }} {{- with .Values.workflow_notifications.config.notifications.aws }} aws: {{ tpl (toYaml .) $ | nindent 8 }} diff --git a/flyteadmin/pkg/async/notifications/factory.go b/flyteadmin/pkg/async/notifications/factory.go index 53e96f7e67..f94129a1d5 100644 --- a/flyteadmin/pkg/async/notifications/factory.go +++ b/flyteadmin/pkg/async/notifications/factory.go @@ -64,7 +64,11 @@ func GetEmailer(config runtimeInterfaces.NotificationsConfig, scope promutils.Sc switch config.Type { case common.AWS: - awsConfig := aws.NewConfig().WithRegion(config.Region).WithMaxRetries(maxRetries) + region := config.AWSConfig.Region + if region == "" { + region = config.Region + } + awsConfig := aws.NewConfig().WithRegion(region).WithMaxRetries(maxRetries) awsSession, err := session.NewSession(awsConfig) if err != nil { panic(err) @@ -98,7 +102,11 @@ func NewNotificationsProcessor(config runtimeInterfaces.NotificationsConfig, sco // However, the message body of SQS is the SNS message format which isn't Base64 encoded. ConsumeBase64: &enable64decoding, } - sqsConfig.Region = config.Region + if config.AWSConfig.Region != "" { + sqsConfig.Region = config.AWSConfig.Region + } else { + sqsConfig.Region = config.Region + } var err error err = async.Retry(reconnectAttempts, reconnectDelay, func() error { sub, err = gizmoAWS.NewSubscriber(sqsConfig)