-
Notifications
You must be signed in to change notification settings - Fork 0
/
kms.go
31 lines (25 loc) · 875 Bytes
/
kms.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
package kms
import (
"context"
"github.com/observeinc/aws-snapshot/pkg/api"
"github.com/observeinc/aws-snapshot/pkg/service"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/kms"
)
func init() {
service.Register("kms", api.ServiceFunc(New))
}
// API documents the subset of AWS API we actually call
type API interface {
ListKeysPagesWithContext(context.Context, *kms.ListKeysInput, func(*kms.ListKeysOutput, bool) bool, ...request.Option) error
DescribeKeyWithContext(context.Context, *kms.DescribeKeyInput, ...request.Option) (*kms.DescribeKeyOutput, error)
}
// New implements api.ServiceFunc
func New(p client.ConfigProvider, opts ...*aws.Config) api.Endpoint {
kmsapi := kms.New(p, opts...)
return api.Endpoint{
"DescribeKey": &DescribeKey{kmsapi},
}
}