diff --git a/config/elasticache/config.go b/config/elasticache/config.go index 9929179dd2..d4d79721e2 100644 --- a/config/elasticache/config.go +++ b/config/elasticache/config.go @@ -27,6 +27,14 @@ func Configure(p *config.Provider) { //nolint:gocyclo r.References["parameter_group_name"] = config.Reference{ TerraformName: "aws_elasticache_parameter_group", } + r.Sensitive.AdditionalConnectionDetailsFn = func(attr map[string]any) (map[string][]byte, error) { + conn := map[string][]byte{} + // This only works for memcached clusters + if a, ok := attr["cluster_address"].(string); ok { + conn["cluster_address"] = []byte(a) + } + return conn, nil + } // log_delivery_configuration.destination can point to either // a CloudWatch Logs LogGroup or Kinesis Data Firehose resource. delete(r.References, "log_delivery_configuration.destination") diff --git a/examples/elasticache/v1beta1/cluster.yaml b/examples/elasticache/v1beta1/cluster.yaml index fb6250240e..3ad90953ee 100644 --- a/examples/elasticache/v1beta1/cluster.yaml +++ b/examples/elasticache/v1beta1/cluster.yaml @@ -26,6 +26,9 @@ spec: subnetGroupNameSelector: matchLabels: testing.upbound.io/example-name: example + writeConnectionSecretToRef: + name: sample-cluster + namespace: default ---