-
Notifications
You must be signed in to change notification settings - Fork 76
/
config.go
39 lines (31 loc) · 1.09 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
package kms
import (
"github.com/upbound/provider-gcp/config/common"
"github.com/upbound/upjet/pkg/config"
)
// Configure configures individual resources by adding custom
// ResourceConfigurators.
func Configure(p *config.Provider) {
p.AddResourceConfigurator("google_kms_crypto_key_iam_member", func(r *config.Resource) {
r.References["crypto_key_id"] = config.Reference{
Type: "CryptoKey",
Extractor: common.ExtractResourceIDFuncPath,
}
})
p.AddResourceConfigurator("google_kms_key_ring_iam_member", func(r *config.Resource) {
r.References["key_ring_id"] = config.Reference{
Type: "KeyRing",
Extractor: common.ExtractResourceIDFuncPath,
}
})
p.AddResourceConfigurator("google_kms_key_ring_import_job", func(r *config.Resource) {
r.References["key_ring"] = config.Reference{
Type: "KeyRing",
Extractor: common.ExtractResourceIDFuncPath,
}
config.MoveToStatus(r.TerraformResource, "public_key")
})
p.AddResourceConfigurator("google_kms_secret_ciphertext", func(r *config.Resource) {
r.TerraformResource.Schema["plaintext"].Sensitive = false
})
}