Skip to content

Commit e633dab

Browse files
committed
prefer configured aws profile
1 parent 38a0a2f commit e633dab

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

pkg/project/provider/aws.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ func (a *AwsProvider) Env() (map[string]string, error) {
6363

6464
func (a *AwsProvider) Init(app string, stage string, args map[string]interface{}) error {
6565
ctx := context.Background()
66-
if os.Getenv("SST_AWS_NO_PROFILE") != "" {
67-
delete(args, "profile")
66+
if value := os.Getenv("AWS_PROFILE"); value != "" {
67+
a.profile = value
6868
}
6969
if val, ok := args["profile"]; ok && val != "" {
7070
delete(args, "profile")
@@ -73,9 +73,6 @@ func (a *AwsProvider) Init(app string, stage string, args map[string]interface{}
7373
// so we wipe it from args and put it in env which is not saved to the state
7474
a.profile = val.(string)
7575
}
76-
if value := os.Getenv("AWS_PROFILE"); value != "" {
77-
a.profile = value
78-
}
7976

8077
cfg, err := config.LoadDefaultConfig(
8178
ctx,

0 commit comments

Comments
 (0)