-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make LoadAWSConfig a shared function
- Loading branch information
1 parent
6c48550
commit 86d56c5
Showing
4 changed files
with
24 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package backend | ||
|
||
import ( | ||
"context" | ||
"github.com/aws/aws-sdk-go-v2/aws" | ||
"github.com/aws/aws-sdk-go-v2/config" | ||
"log" | ||
) | ||
|
||
var region = "eu-central-1" | ||
|
||
// LoadAWSConfig loads the Shared AWS Configuration (~/.aws/config) | ||
func LoadAWSConfig() (cfg aws.Config) { | ||
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion(region)) | ||
if err != nil { | ||
log.Fatalf("failed to load configuration, %v\n", err) | ||
} | ||
return cfg | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
package main | ||
|
||
import ( | ||
"zobot/backend" | ||
) | ||
import "zobot/backend" | ||
|
||
func main() { | ||
// placeholder | ||
|