-
Notifications
You must be signed in to change notification settings - Fork 121
/
config.go
51 lines (46 loc) · 1.55 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
50
51
/*
Copyright 2021 Upbound Inc.
*/
package elasticache
import (
"github.com/crossplane/upjet/pkg/config"
)
// Configure adds configurations for the elasticache group.
func Configure(p *config.Provider) {
p.AddResourceConfigurator("aws_elasticache_cluster", func(r *config.Resource) {
r.References["parameter_group_name"] = config.Reference{
TerraformName: "aws_elasticache_parameter_group",
}
// log_delivery_configuration.destination can point to either
// a CloudWatch Logs LogGroup or Kinesis Data Firehose resource.
delete(r.References, "log_delivery_configuration.destination")
})
p.AddResourceConfigurator("aws_elasticache_replication_group", func(r *config.Resource) {
r.References["subnet_group_name"] = config.Reference{
Type: "SubnetGroup",
}
r.References["kms_key_id"] = config.Reference{
Type: "github.com/upbound/provider-aws/apis/kms/v1beta1.Key",
}
r.LateInitializer = config.LateInitializer{
// Conflicting configuration arguments: "number_cache_clusters": conflicts with cluster_mode.0.num_node_groups
IgnoredFields: []string{
"cluster_mode",
"num_node_groups",
"num_cache_clusters",
"number_cache_clusters",
"replication_group_description",
"description",
},
}
delete(r.References, "log_delivery_configuration.destination")
r.UseAsync = true
})
p.AddResourceConfigurator("aws_elasticache_user_group", func(r *config.Resource) {
r.References["user_ids"] = config.Reference{
Type: "User",
RefFieldName: "UserIDRefs",
SelectorFieldName: "UserIDSelector",
}
})
}