Skip to content

Instantly share code, notes, and snippets.

@apenney
Created July 11, 2018 00:59
Show Gist options
  • Save apenney/7c27b05697def4406fb620ffb7a83479 to your computer and use it in GitHub Desktop.
Save apenney/7c27b05697def4406fb620ffb7a83479 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/endpoints"
"github.com/aws/aws-sdk-go-v2/aws/external"
"github.com/aws/aws-sdk-go-v2/service/route53"
)
func main() {
// Using the SDK's default configuration, loading additional config
// and credentials values from the environment variables, shared
// credentials, and shared configuration files
cfg, err := external.LoadDefaultAWSConfig()
if err != nil {
panic("unable to load SDK config, " + err.Error())
}
// Set the AWS Region that the service clients should use
cfg.Region = endpoints.UsEast1RegionID
svc := route53.New(cfg)
// Build the request with its input parameters
req := svc.ListHostedZonesByNameRequest(&route53.ListHostedZonesByNameInput{MaxItems: aws.String("100")})
resp, err := req.Send()
if err == nil {
fmt.Println(resp)
}
fmt.Println("Response", resp)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment