Skip to content

Commit

Permalink
AT-9829: update code small
Browse files Browse the repository at this point in the history
  • Loading branch information
rddimon committed Jun 20, 2023
1 parent e51643d commit f600496
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/globals.ts
Expand Up @@ -9,6 +9,8 @@ export default class Globals {
public static options: ServerlessOptions;
public static v3Utils: ServerlessUtils;

public static V2Enabled = true;

public static currentRegion: string;
public static credentials: any;

Expand Down
12 changes: 7 additions & 5 deletions src/index.ts
Expand Up @@ -83,12 +83,14 @@ class ServerlessCustomDomain {
this.validateDomainConfigs();
// setup AWS resources

// start of the legacy AWS SDK V2 creds support
// TODO: remove it in case serverless will add V3 support
Globals.credentials = this.serverless.providers.aws.getCredentials();
// end of the legacy AWS SDK V2 creds support
if (Globals.V2Enabled) {
// start of the legacy AWS SDK V2 creds support
// TODO: remove it in case serverless will add V3 support
Globals.credentials = this.serverless.providers.aws.getCredentials();
} else {
await this.initSLSCredentials();
}

// await this.initSLSCredentials();
await this.initAWSRegion();
await this.initAWSResources();

Expand Down

0 comments on commit f600496

Please sign in to comment.