Skip to content

Commit

Permalink
Merge pull request #1533 from turkenf/issue-1523
Browse files Browse the repository at this point in the history
Add PathARNExtractor for kms_key_id to rds cluster
  • Loading branch information
turkenf authored Oct 22, 2024
2 parents 5c35bab + 511bac1 commit 8ef9eff
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 4 deletions.
2 changes: 2 additions & 0 deletions apis/rds/v1beta1/zz_cluster_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions apis/rds/v1beta1/zz_generated.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions apis/rds/v1beta2/zz_cluster_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions apis/rds/v1beta2/zz_generated.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions config/rds/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ func Configure(p *config.Provider) { //nolint:gocyclo
r.References["db_instance_parameter_group_name"] = config.Reference{
TerraformName: "aws_db_parameter_group",
}
r.References["kms_key_id"] = config.Reference{
TerraformName: "aws_kms_key",
Extractor: common.PathARNExtractor,
}
r.UseAsync = true
r.Sensitive.AdditionalConnectionDetailsFn = func(attr map[string]any) (map[string][]byte, error) {
conn := map[string][]byte{}
Expand Down
42 changes: 42 additions & 0 deletions examples/rds/v1beta1/cluster-with-kmskey.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-FileCopyrightText: 2024 The Crossplane Authors <https://crossplane.io>
#
# SPDX-License-Identifier: CC0-1.0

apiVersion: rds.aws.upbound.io/v1beta1
kind: Cluster
metadata:
annotations:
meta.upbound.io/example-id: rds/v1beta1/clusterendpoint
labels:
testing.upbound.io/example-name: default-ce
name: kms-test
spec:
forProvider:
engine: aurora-postgresql
autoGeneratePassword: true
masterPasswordSecretRef:
key: password
name: sample-cluster-password
namespace: upbound-system
masterUsername: cpadmin
region: us-west-1
skipFinalSnapshot: true
storageEncrypted: true
kmsKeyIdSelector:
matchLabels:
testing.upbound.io/example-name: sample-key
writeConnectionSecretToRef:
name: sample-rds-cluster-secret
namespace: upbound-system
---
apiVersion: kms.aws.upbound.io/v1beta1
kind: Key
metadata:
labels:
testing.upbound.io/example-name: sample-key
name: sample-key
spec:
forProvider:
deletionWindowInDays: 7
description: Created with Crossplane
region: us-west-1

0 comments on commit 8ef9eff

Please sign in to comment.