-
Notifications
You must be signed in to change notification settings - Fork 121
/
config.go
49 lines (41 loc) · 1.14 KB
/
config.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
41
42
43
44
45
46
47
48
49
/*
Copyright 2022 Upbound Inc.
*/
package kms
import (
"github.com/upbound/upjet/pkg/config"
"github.com/upbound/provider-aws/config/common"
)
// Configure adds configurations for kms group.
func Configure(p *config.Provider) {
p.AddResourceConfigurator("aws_kms_alias", func(r *config.Resource) {
r.References["target_key_id"] = config.Reference{
Type: "Key",
}
r.UseAsync = true
})
p.AddResourceConfigurator("aws_kms_ciphertext", func(r *config.Resource) {
r.References["key_id"] = config.Reference{
Type: "Key",
}
r.UseAsync = true
})
p.AddResourceConfigurator("aws_kms_grant", func(r *config.Resource) {
r.References["key_id"] = config.Reference{
Type: "Key",
Extractor: common.PathARNExtractor,
}
})
p.AddResourceConfigurator("aws_kms_replica_key", func(r *config.Resource) {
r.References["primary_key_arn"] = config.Reference{
Type: "Key",
Extractor: common.PathARNExtractor,
}
})
p.AddResourceConfigurator("aws_kms_replica_external_key", func(r *config.Resource) {
r.References["primary_key_arn"] = config.Reference{
Type: "ExternalKey",
Extractor: common.PathARNExtractor,
}
})
}