I am referring to the following function in the aws-go SDK : https://docs.aws.amazon.com/sdk-for-go/api/aws/client/#New
I am new to aws / go SDK for aws ( more like a weekend project )
I want to create a client on my localhost machine such that it can login on my AWS account and give me a list of all instances running on the aws account.
Right now , i am just trying to log in to the account
source code :
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
)
func main() {
param1:=aws.Config{Region: aws.String("us-east-1") }
param2:=metadata.ClientInfo{}
param3:=request.Handlers{}
awsClient :=client.New(param1,param2,param3)
fmt.Print(awsClient)
fmt.Println(awsClient.ClientInfo)
}
output:
&{{3 0s 0s 0s 0s} { } {<nil> <nil> <nil> <nil> <nil> 0xc0000133a0 <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> <nil> } {{[] <nil>} {[] <nil>} {[] <nil>} {[] <nil>} {[] <nil>} {[] <nil>} {[] <nil>} {[] <nil>} {[] <nil>} {[] <nil>} {[] <nil>} {[] <nil>} {[] <nil>} {[] <nil>}}}{ }
i have my .aws/credentials file correctly set up
I can also login via cli and view all my sub accounts.
Again, i am just trying to login to my account on aws.
Please help me in following: 1) Am i using the correct API / documentation ?
2) What i understand from this output is that , the client can not communicate with aws. Am i correct ?
3) please help me resolve this issue
Thanks in advance.