Skip to content

Instantly share code, notes, and snippets.



Created Jan 15, 2020
What would you like to do?
barebones golang client application for AWS
package main
import (
func main() {
var profile string
var region string
flag.StringVar(&profile, "p", "default", "profile for creds")
flag.StringVar(&region, "r", "us-east-1", "region for creds")
sessProfile := session.Must(session.NewSessionWithOptions(session.Options{
Config: aws.Config{Region: &region},
Profile: profile,
client := organizations.New(sessProfile)
input := organizations.ListPoliciesInput{
Filter: aws.String("SERVICE_CONTROL_POLICY"),
result, err := client.ListPolicies(&input)
if err != nil { panic(err)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment