forked from aws-samples/aws-dynamodb-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdescribeLimits.go
40 lines (32 loc) · 930 Bytes
/
describeLimits.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/dynamodb"
"fmt"
)
var awsRegion = "us-west-2"
func getSession() (*session.Session) {
sess := session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
// Provide SDK Config options, such as Region and Endpoint
Config: aws.Config{
Region: aws.String(awsRegion),
},
}))
return sess
}
func describeLimits() error {
dynamoDBClient := dynamodb.New(getSession())
response, err := dynamoDBClient.DescribeLimits(&dynamodb.DescribeLimitsInput{})
if err != nil {
return err
}
fmt.Println("Table Limits ...", response)
return nil
}
func main() {
fmt.Println("Describing DynamoDB Limits ...")
describeLimits()
fmt.Println("Finished ...")
}