add manual credentials
This commit is contained in:
@ -10,9 +10,9 @@ import (
|
||||
"github.com/aws/aws-sdk-go-v2/service/ec2"
|
||||
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
|
||||
)
|
||||
func New_config(region string) aws.Config {
|
||||
func New_config(region string, credentials string) aws.Config {
|
||||
// Create a new AWS config
|
||||
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion(region))
|
||||
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithSharedConfigFiles([]string{credentials}), config.WithRegion(region))
|
||||
if err != nil {
|
||||
fmt.Println("Error creating config:", err)
|
||||
fmt.Println("Configure Credentials in line with the documentation found here: https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#specifying-credentials")
|
||||
|
Reference in New Issue
Block a user