AWSSDKforGo是Go语言版本的AWSSDK,是亚马逊Web服务API的客户端开发包,支持所有AWS服务。
示例代码:
import "github.com/awslabs/aws-sdk-go/aws"import "github.com/awslabs/aws-sdk-go/gen/ec2"creds := aws.Creds(accessKey, secretKey, "")cli := ec2.New(creds, "us-west-2", nil)resp, err := cli.DescribeInstances(nil)if err != nil { panic(err)}fmt.Println(resp.Reservations)支持的服务包括:
AutoScaling
CloudFormation
CloudFront
CloudHSM
CloudSearch
CloudSearchdomain
CloudTrail
CloudWatchMetrics
CloudWatchLogs
CodeDeploy
CognitoIdentity
CognitoSync
Config
DataPipeline
DirectConnect
DynamoDB
EC2
EC2ContainerService
Elasticache
ElasticBeanstalk
ElasticTranscoder
ELB
EMR
Glacier
IAM
Import/Export
Kinesis
KeyManagementService
Lambda
OpsWorks
RDS
RedShift
Route53
Route53Domains
S3
SimpleDB
SimpleEmailService
SNS
SQS
StorageGateway
STS
Support
SWF
评论