diff --git a/src/pkg/cli/client/byoc/aws/byoc.go b/src/pkg/cli/client/byoc/aws/byoc.go index a3ee6daba..180a2be34 100644 --- a/src/pkg/cli/client/byoc/aws/byoc.go +++ b/src/pkg/cli/client/byoc/aws/byoc.go @@ -74,6 +74,18 @@ func (e ErrMissingAwsCreds) Unwrap() error { return e.err } +type ErrMissingAwsRegion struct { + err error +} + +func (e ErrMissingAwsRegion) Error() string { + return "missing AWS region: set AWS_REGION or edit your AWS profile (https://docs.defang.io/docs/providers/aws#region)" +} + +func (e ErrMissingAwsRegion) Unwrap() error { + return e.err +} + func AnnotateAwsError(err error) error { if err == nil { return nil @@ -82,6 +94,9 @@ func AnnotateAwsError(err error) error { if strings.Contains(err.Error(), "get credentials:") { return connect.NewError(connect.CodeUnauthenticated, ErrMissingAwsCreds{err}) } + if strings.Contains(err.Error(), "missing AWS region:") { + return connect.NewError(connect.CodeUnauthenticated, ErrMissingAwsRegion{err}) + } if cerr := new(aws.ErrNoSuchKey); errors.As(err, &cerr) { return connect.NewError(connect.CodeNotFound, err) } diff --git a/src/protos/io/defang/v1/fabric.pb.go b/src/protos/io/defang/v1/fabric.pb.go index 1bdfc3a49..220ab13f1 100644 --- a/src/protos/io/defang/v1/fabric.pb.go +++ b/src/protos/io/defang/v1/fabric.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.35.1 +// protoc-gen-go v1.35.2 // protoc (unknown) // source: io/defang/v1/fabric.proto