Skip to content

Commit

Permalink
Merge pull request crossplane-contrib#793 from gadiener/feature/kms-k…
Browse files Browse the repository at this point in the history
…ey-id-arn

fix(efs): fixed kmsKeyId to use ARN instead of ID
  • Loading branch information
turkenf authored Jul 20, 2023
2 parents cb6873c + 439508b commit 8557210
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
1 change: 1 addition & 0 deletions apis/efs/v1beta1/zz_filesystem_types.go

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

3 changes: 2 additions & 1 deletion apis/efs/v1beta1/zz_generated.resolvers.go

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

13 changes: 12 additions & 1 deletion config/efs/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package efs

import "github.com/upbound/upjet/pkg/config"
import (
"github.com/upbound/upjet/pkg/config"

"github.com/upbound/provider-aws/config/common"
)

// Configure adds configurations for efs group.
func Configure(p *config.Provider) {
Expand Down Expand Up @@ -36,4 +40,11 @@ func Configure(p *config.Provider) {
Type: "FileSystem",
}
})

p.AddResourceConfigurator("aws_efs_file_system", func(r *config.Resource) {
r.References["kms_key_id"] = config.Reference{
Type: "github.com/upbound/provider-aws/apis/kms/v1beta1.Key",
Extractor: common.PathARNExtractor,
}
})
}
31 changes: 31 additions & 0 deletions examples/efs/filesystem-with-encrypted.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: efs.aws.upbound.io/v1beta1
kind: FileSystem
metadata:
name: example-efs-encrypted
annotations:
meta.upbound.io/example-id: efs/v1beta1/filesystem
labels:
testing.upbound.io/example-name: example-efs-encrypted
spec:
forProvider:
region: us-west-1
creationToken: my-product
encrypted: true
kmsKeyIdRef:
name: example-key
tags:
Name: MyProduct
---
apiVersion: kms.aws.upbound.io/v1beta1
kind: Key
metadata:
name: example-key
annotations:
meta.upbound.io/example-id: efs/v1beta1/filesystem
labels:
testing.upbound.io/example-name: example-key
spec:
forProvider:
region: us-west-1
description: Created with Crossplane
deletionWindowInDays: 7

0 comments on commit 8557210

Please sign in to comment.