Last active
January 25, 2018 06:26
-
-
Save appleboy/13675272f43185c40f341059fafd17c6 to your computer and use it in GitHub Desktop.
minio sdk with AWS iam Role
This file contains hidden or 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
package main | |
import ( | |
"log" | |
"github.com/minio/minio-go" | |
"github.com/minio/minio-go/pkg/credentials" | |
) | |
func main() { | |
iam := credentials.NewIAM("") | |
minioClient, err := minio.NewWithCredentials("s3.amazonaws.com", iam, true, "") | |
if err != nil { | |
log.Fatalln(err) | |
} | |
err = minioClient.MakeBucket("mtk.appleboy46", "ap-southeast-1") | |
if err != nil { | |
log.Fatalln(err) | |
return | |
} | |
log.Println("Successfully created mybucket.") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment