Skip to content

Commit

Permalink
Merge pull request #1440 from aiell0/connection-details-elasticache
Browse files Browse the repository at this point in the history
feat(elasticache): connection details for elasticache (memcached only)
  • Loading branch information
turkenf committed Aug 6, 2024
2 parents 779097a + 79e6dc8 commit 704510f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/elasticache/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions examples/elasticache/v1beta1/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ spec:
subnetGroupNameSelector:
matchLabels:
testing.upbound.io/example-name: example
writeConnectionSecretToRef:
name: sample-cluster
namespace: default

---

Expand Down

0 comments on commit 704510f

Please sign in to comment.