Skip to content

Commit

Permalink
Merge pull request #1157 from haarchri/feature/ec2-ebs-kms-ref-selector
Browse files Browse the repository at this point in the history
feat(ec2): add kmsKeyID Ref & Selector in ec2-instance ebs dbm
  • Loading branch information
haarchri committed Mar 8, 2022
2 parents f1fbca2 + 410704d commit 4651608
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apis/ec2/manualv1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/ec2/types"
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

awsclients "github.com/crossplane/provider-aws/pkg/clients"
Expand Down Expand Up @@ -178,8 +179,19 @@ type EBSBlockDevice struct {
// RunInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html),
// RequestSpotFleet (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html),
// and RequestSpotInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html).
// +crossplane:generate:reference:type=github.com/crossplane/provider-aws/apis/kms/v1alpha1.Key
// +crossplane:generate:reference:refFieldName=KMSKeyIDRef
// +crossplane:generate:reference:selectorFieldName=KMSKeyIDSelector
KmsKeyID *string `json:"kmsKeyId,omitempty"`

// KMSKeyIDRef is a reference to a KMS Key used to set KMSKeyID.
// +optional
KMSKeyIDRef *xpv1.Reference `json:"kmsKeyIdRef,omitempty"`

// KMSKeyIDSelector selects a reference to a KMS Key used to set KMSKeyID.
// +optional
KMSKeyIDSelector *xpv1.Selector `json:"kmsKeyIdSelector,omitempty"`

// The ID of the snapshot.
SnapshotID *string `json:"snapshotId,omitempty"`

Expand Down
10 changes: 10 additions & 0 deletions apis/ec2/manualv1alpha1/zz_generated.deepcopy.go

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

21 changes: 21 additions & 0 deletions apis/ec2/manualv1alpha1/zz_generated.resolvers.go

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

26 changes: 26 additions & 0 deletions package/crds/ec2.aws.crossplane.io_instances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,32 @@ spec:
RequestSpotFleet (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html),
and RequestSpotInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html)."
type: string
kmsKeyIdRef:
description: KMSKeyIDRef is a reference to a KMS Key
used to set KMSKeyID.
properties:
name:
description: Name of the referenced object.
type: string
required:
- name
type: object
kmsKeyIdSelector:
description: KMSKeyIDSelector selects a reference to
a KMS Key used to set KMSKeyID.
properties:
matchControllerRef:
description: MatchControllerRef ensures an object
with the same controller reference as the selecting
object is selected.
type: boolean
matchLabels:
additionalProperties:
type: string
description: MatchLabels ensures an object with
matching labels is selected.
type: object
type: object
snapshotId:
description: The ID of the snapshot.
type: string
Expand Down

0 comments on commit 4651608

Please sign in to comment.