From 0a225755d5ba4ae716d1277c121d18a0fe53dfc7 Mon Sep 17 00:00:00 2001 From: nilan3 Date: Wed, 27 Nov 2024 12:14:42 +0000 Subject: [PATCH 1/5] add dataplex aspect type resource Signed-off-by: nilan3 --- .../v1beta1/zz_aspecttype_terraformed.go | 129 +++++ apis/dataplex/v1beta1/zz_aspecttype_types.go | 188 ++++++++ .../v1beta1/zz_generated.conversion_hubs.go | 10 + .../dataplex/v1beta1/zz_generated.deepcopy.go | 339 ++++++++++++++ apis/dataplex/v1beta1/zz_generated.managed.go | 60 +++ .../v1beta1/zz_generated.managedlist.go | 9 + config/externalname.go | 2 + config/externalnamenottested.go | 6 + config/generated.lst | 2 +- .../dataplex/v1beta1/aspecttype.yaml | 38 ++ examples/dataplex/v1beta1/aspecttype.yaml | 37 ++ .../dataplex/aspecttype/zz_controller.go | 91 ++++ internal/controller/zz_dataplex_setup.go | 2 + internal/controller/zz_monolith_setup.go | 2 + .../dataplex.gcp.upbound.io_aspecttypes.yaml | 439 ++++++++++++++++++ 15 files changed, 1353 insertions(+), 1 deletion(-) create mode 100755 apis/dataplex/v1beta1/zz_aspecttype_terraformed.go create mode 100755 apis/dataplex/v1beta1/zz_aspecttype_types.go create mode 100755 apis/dataplex/v1beta1/zz_generated.conversion_hubs.go create mode 100644 examples-generated/dataplex/v1beta1/aspecttype.yaml create mode 100644 examples/dataplex/v1beta1/aspecttype.yaml create mode 100755 internal/controller/dataplex/aspecttype/zz_controller.go create mode 100644 package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml diff --git a/apis/dataplex/v1beta1/zz_aspecttype_terraformed.go b/apis/dataplex/v1beta1/zz_aspecttype_terraformed.go new file mode 100755 index 000000000..d7bc6ba9e --- /dev/null +++ b/apis/dataplex/v1beta1/zz_aspecttype_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this AspectType +func (mg *AspectType) GetTerraformResourceType() string { + return "google_dataplex_aspect_type" +} + +// GetConnectionDetailsMapping for this AspectType +func (tr *AspectType) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this AspectType +func (tr *AspectType) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this AspectType +func (tr *AspectType) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this AspectType +func (tr *AspectType) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this AspectType +func (tr *AspectType) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this AspectType +func (tr *AspectType) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this AspectType +func (tr *AspectType) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this AspectType +func (tr *AspectType) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this AspectType using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *AspectType) LateInitialize(attrs []byte) (bool, error) { + params := &AspectTypeParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *AspectType) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/dataplex/v1beta1/zz_aspecttype_types.go b/apis/dataplex/v1beta1/zz_aspecttype_types.go new file mode 100755 index 000000000..04fb69b65 --- /dev/null +++ b/apis/dataplex/v1beta1/zz_aspecttype_types.go @@ -0,0 +1,188 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type AspectTypeInitParameters struct { + + // The aspect type id of the aspect type. + AspectTypeID *string `json:"aspectTypeId,omitempty" tf:"aspect_type_id,omitempty"` + + // Description of the AspectType. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // User friendly display name. + DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` + + // User-defined labels for the AspectType. + // +mapType=granular + Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` + + // The location where aspect type will be created in. + Location *string `json:"location,omitempty" tf:"location,omitempty"` + + // MetadataTemplate of the Aspect. + MetadataTemplate *string `json:"metadataTemplate,omitempty" tf:"metadata_template,omitempty"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + Project *string `json:"project,omitempty" tf:"project,omitempty"` +} + +type AspectTypeObservation struct { + + // The aspect type id of the aspect type. + AspectTypeID *string `json:"aspectTypeId,omitempty" tf:"aspect_type_id,omitempty"` + + // The time when the AspectType was created. + CreateTime *string `json:"createTime,omitempty" tf:"create_time,omitempty"` + + // Description of the AspectType. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // User friendly display name. + DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` + + // for all of the labels present on the resource. + // +mapType=granular + EffectiveLabels map[string]*string `json:"effectiveLabels,omitempty" tf:"effective_labels,omitempty"` + + // an identifier for the resource with format projects/{{project}}/locations/{{location}}/aspectTypes/{{aspect_type_id}} + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // User-defined labels for the AspectType. + // +mapType=granular + Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` + + // The location where aspect type will be created in. + Location *string `json:"location,omitempty" tf:"location,omitempty"` + + // MetadataTemplate of the Aspect. + MetadataTemplate *string `json:"metadataTemplate,omitempty" tf:"metadata_template,omitempty"` + + // The relative resource name of the AspectType, of the form: projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id} + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // The combination of labels configured directly on the resource + // and default labels configured on the provider. + // +mapType=granular + TerraformLabels map[string]*string `json:"terraformLabels,omitempty" tf:"terraform_labels,omitempty"` + + // Denotes the transfer status of the Aspect Type. It is unspecified + // for Aspect Type created from Dataplex API. + TransferStatus *string `json:"transferStatus,omitempty" tf:"transfer_status,omitempty"` + + // System generated globally unique ID for the AspectType. This ID will be different if the AspectType is deleted and re-created with the same name. + UID *string `json:"uid,omitempty" tf:"uid,omitempty"` + + // The time when the AspectType was last updated. + UpdateTime *string `json:"updateTime,omitempty" tf:"update_time,omitempty"` +} + +type AspectTypeParameters struct { + + // The aspect type id of the aspect type. + // +kubebuilder:validation:Optional + AspectTypeID *string `json:"aspectTypeId,omitempty" tf:"aspect_type_id,omitempty"` + + // Description of the AspectType. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // User friendly display name. + // +kubebuilder:validation:Optional + DisplayName *string `json:"displayName,omitempty" tf:"display_name,omitempty"` + + // User-defined labels for the AspectType. + // +kubebuilder:validation:Optional + // +mapType=granular + Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` + + // The location where aspect type will be created in. + // +kubebuilder:validation:Optional + Location *string `json:"location,omitempty" tf:"location,omitempty"` + + // MetadataTemplate of the Aspect. + // +kubebuilder:validation:Optional + MetadataTemplate *string `json:"metadataTemplate,omitempty" tf:"metadata_template,omitempty"` + + // The ID of the project in which the resource belongs. + // If it is not provided, the provider project is used. + // +kubebuilder:validation:Optional + Project *string `json:"project,omitempty" tf:"project,omitempty"` +} + +// AspectTypeSpec defines the desired state of AspectType +type AspectTypeSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider AspectTypeParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider AspectTypeInitParameters `json:"initProvider,omitempty"` +} + +// AspectTypeStatus defines the observed state of AspectType. +type AspectTypeStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider AspectTypeObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// AspectType is the Schema for the AspectTypes API. An Aspect Type is a template for creating Aspects. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,gcp} +type AspectType struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec AspectTypeSpec `json:"spec"` + Status AspectTypeStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AspectTypeList contains a list of AspectTypes +type AspectTypeList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AspectType `json:"items"` +} + +// Repository type metadata. +var ( + AspectType_Kind = "AspectType" + AspectType_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: AspectType_Kind}.String() + AspectType_KindAPIVersion = AspectType_Kind + "." + CRDGroupVersion.String() + AspectType_GroupVersionKind = CRDGroupVersion.WithKind(AspectType_Kind) +) + +func init() { + SchemeBuilder.Register(&AspectType{}, &AspectTypeList{}) +} diff --git a/apis/dataplex/v1beta1/zz_generated.conversion_hubs.go b/apis/dataplex/v1beta1/zz_generated.conversion_hubs.go new file mode 100755 index 000000000..a6d8d8adf --- /dev/null +++ b/apis/dataplex/v1beta1/zz_generated.conversion_hubs.go @@ -0,0 +1,10 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1beta1 + +// Hub marks this type as a conversion hub. +func (tr *AspectType) Hub() {} diff --git a/apis/dataplex/v1beta1/zz_generated.deepcopy.go b/apis/dataplex/v1beta1/zz_generated.deepcopy.go index 2eb33a0d5..8da932f35 100644 --- a/apis/dataplex/v1beta1/zz_generated.deepcopy.go +++ b/apis/dataplex/v1beta1/zz_generated.deepcopy.go @@ -13,6 +13,345 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AspectType) DeepCopyInto(out *AspectType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AspectType. +func (in *AspectType) DeepCopy() *AspectType { + if in == nil { + return nil + } + out := new(AspectType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AspectType) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AspectTypeInitParameters) DeepCopyInto(out *AspectTypeInitParameters) { + *out = *in + if in.AspectTypeID != nil { + in, out := &in.AspectTypeID, &out.AspectTypeID + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MetadataTemplate != nil { + in, out := &in.MetadataTemplate, &out.MetadataTemplate + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AspectTypeInitParameters. +func (in *AspectTypeInitParameters) DeepCopy() *AspectTypeInitParameters { + if in == nil { + return nil + } + out := new(AspectTypeInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AspectTypeList) DeepCopyInto(out *AspectTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AspectType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AspectTypeList. +func (in *AspectTypeList) DeepCopy() *AspectTypeList { + if in == nil { + return nil + } + out := new(AspectTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AspectTypeList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AspectTypeObservation) DeepCopyInto(out *AspectTypeObservation) { + *out = *in + if in.AspectTypeID != nil { + in, out := &in.AspectTypeID, &out.AspectTypeID + *out = new(string) + **out = **in + } + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.EffectiveLabels != nil { + in, out := &in.EffectiveLabels, &out.EffectiveLabels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MetadataTemplate != nil { + in, out := &in.MetadataTemplate, &out.MetadataTemplate + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.TerraformLabels != nil { + in, out := &in.TerraformLabels, &out.TerraformLabels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.TransferStatus != nil { + in, out := &in.TransferStatus, &out.TransferStatus + *out = new(string) + **out = **in + } + if in.UID != nil { + in, out := &in.UID, &out.UID + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AspectTypeObservation. +func (in *AspectTypeObservation) DeepCopy() *AspectTypeObservation { + if in == nil { + return nil + } + out := new(AspectTypeObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AspectTypeParameters) DeepCopyInto(out *AspectTypeParameters) { + *out = *in + if in.AspectTypeID != nil { + in, out := &in.AspectTypeID, &out.AspectTypeID + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MetadataTemplate != nil { + in, out := &in.MetadataTemplate, &out.MetadataTemplate + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AspectTypeParameters. +func (in *AspectTypeParameters) DeepCopy() *AspectTypeParameters { + if in == nil { + return nil + } + out := new(AspectTypeParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AspectTypeSpec) DeepCopyInto(out *AspectTypeSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AspectTypeSpec. +func (in *AspectTypeSpec) DeepCopy() *AspectTypeSpec { + if in == nil { + return nil + } + out := new(AspectTypeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AspectTypeStatus) DeepCopyInto(out *AspectTypeStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AspectTypeStatus. +func (in *AspectTypeStatus) DeepCopy() *AspectTypeStatus { + if in == nil { + return nil + } + out := new(AspectTypeStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Asset) DeepCopyInto(out *Asset) { *out = *in diff --git a/apis/dataplex/v1beta1/zz_generated.managed.go b/apis/dataplex/v1beta1/zz_generated.managed.go index d532125c5..c2a8fd2d8 100644 --- a/apis/dataplex/v1beta1/zz_generated.managed.go +++ b/apis/dataplex/v1beta1/zz_generated.managed.go @@ -7,6 +7,66 @@ package v1beta1 import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +// GetCondition of this AspectType. +func (mg *AspectType) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this AspectType. +func (mg *AspectType) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this AspectType. +func (mg *AspectType) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this AspectType. +func (mg *AspectType) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this AspectType. +func (mg *AspectType) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this AspectType. +func (mg *AspectType) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this AspectType. +func (mg *AspectType) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this AspectType. +func (mg *AspectType) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this AspectType. +func (mg *AspectType) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this AspectType. +func (mg *AspectType) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this AspectType. +func (mg *AspectType) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this AspectType. +func (mg *AspectType) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this Asset. func (mg *Asset) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/dataplex/v1beta1/zz_generated.managedlist.go b/apis/dataplex/v1beta1/zz_generated.managedlist.go index 890472953..c7c5b94f6 100644 --- a/apis/dataplex/v1beta1/zz_generated.managedlist.go +++ b/apis/dataplex/v1beta1/zz_generated.managedlist.go @@ -7,6 +7,15 @@ package v1beta1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" +// GetItems of this AspectTypeList. +func (l *AspectTypeList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this AssetList. func (l *AssetList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/config/externalname.go b/config/externalname.go index aa1e1e58f..fa447a157 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -430,6 +430,8 @@ var terraformPluginSDKExternalNameConfigs = map[string]config.ExternalName{ "google_dataplex_asset": config.TemplatedStringAsIdentifier("name", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/lakes/{{ .parameters.lake }}/zones/{{ .parameters.dataplex_zone }}/assets/{{ .external_name }}"), // Imported by using the following projects/{{project}}/locations/{{location}}/lakes/{{lake}}/zones/{{name}} "google_dataplex_zone": config.TemplatedStringAsIdentifier("name", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/lakes/{{ .parameters.lake }}/zones/{{ .external_name }}"), + // Imported by using the following projects/{{project}}/locations/{{location}}/aspectTypes/{{aspect_type_id}} + "google_dataplex_aspect_type": config.IdentifierFromProvider, // dns // diff --git a/config/externalnamenottested.go b/config/externalnamenottested.go index 85b23e9c4..43aa53520 100644 --- a/config/externalnamenottested.go +++ b/config/externalnamenottested.go @@ -145,6 +145,12 @@ var ExternalNameNotTestedConfigs = map[string]config.ExternalName{ // // Imported by using the following format: projects/{{project}}/locations/{{location}}/lakes/{{name}} "google_dataplex_lake": config.TemplatedStringAsIdentifier("name", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/lakes/{{ .external_name }}"), + // Imported by using the following format: projects/{{project}}/locations/{{location}}/aspectTypes/{{aspect_type_id}} + "google_dataplex_aspect_type_iam_binding": config.TemplatedStringAsIdentifier("name", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/aspectTypes/{{ .external_name }} {{ .parameters.role }}"), + // Imported by using the following format: projects/{{project}}/locations/{{location}}/aspectTypes/{{aspect_type_id}} + "google_dataplex_aspect_type_iam_member": config.TemplatedStringAsIdentifier("name", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/aspectTypes/{{ .external_name }} {{ .parameters.role }} {{ .parameters.member }}"), + // Imported by using the following format: projects/{{project}}/locations/{{location}}/aspectTypes/{{aspect_type_id}} + "google_dataplex_aspect_type_iam_policy": config.TemplatedStringAsIdentifier("name", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/aspectTypes/{{ .external_name }}"), // dataproc // diff --git a/config/generated.lst b/config/generated.lst index 65809bd9b..556d552f6 100644 --- a/config/generated.lst +++ b/config/generated.lst @@ -1 +1 @@ -["google_access_context_manager_access_level","google_access_context_manager_access_level_condition","google_access_context_manager_access_policy","google_access_context_manager_access_policy_iam_member","google_access_context_manager_service_perimeter","google_access_context_manager_service_perimeter_resource","google_active_directory_domain","google_alloydb_backup","google_alloydb_cluster","google_alloydb_instance","google_apigee_addons_config","google_apigee_endpoint_attachment","google_apigee_envgroup","google_apigee_envgroup_attachment","google_apigee_environment","google_apigee_environment_iam_member","google_apigee_instance","google_apigee_instance_attachment","google_apigee_nat_address","google_apigee_organization","google_apigee_sync_authorization","google_app_engine_application","google_app_engine_application_url_dispatch_rules","google_app_engine_firewall_rule","google_app_engine_service_network_settings","google_app_engine_standard_app_version","google_artifact_registry_repository","google_artifact_registry_repository_iam_member","google_beyondcorp_app_connection","google_beyondcorp_app_connector","google_beyondcorp_app_gateway","google_bigquery_analytics_hub_data_exchange","google_bigquery_analytics_hub_data_exchange_iam_member","google_bigquery_analytics_hub_listing","google_bigquery_connection","google_bigquery_data_transfer_config","google_bigquery_dataset","google_bigquery_dataset_access","google_bigquery_dataset_iam_binding","google_bigquery_dataset_iam_member","google_bigquery_dataset_iam_policy","google_bigquery_job","google_bigquery_reservation","google_bigquery_reservation_assignment","google_bigquery_routine","google_bigquery_table","google_bigquery_table_iam_binding","google_bigquery_table_iam_member","google_bigquery_table_iam_policy","google_bigtable_app_profile","google_bigtable_gc_policy","google_bigtable_instance","google_bigtable_instance_iam_binding","google_bigtable_instance_iam_member","google_bigtable_instance_iam_policy","google_bigtable_table","google_bigtable_table_iam_binding","google_bigtable_table_iam_member","google_bigtable_table_iam_policy","google_binary_authorization_attestor","google_binary_authorization_policy","google_certificate_manager_certificate","google_certificate_manager_certificate_map","google_certificate_manager_certificate_map_entry","google_certificate_manager_dns_authorization","google_certificate_manager_trust_config","google_cloud_ids_endpoint","google_cloud_run_domain_mapping","google_cloud_run_service","google_cloud_run_service_iam_member","google_cloud_run_v2_job","google_cloud_run_v2_service","google_cloud_scheduler_job","google_cloud_tasks_queue","google_cloudbuild_trigger","google_cloudbuild_worker_pool","google_cloudfunctions2_function","google_cloudfunctions_function","google_cloudfunctions_function_iam_member","google_composer_environment","google_compute_address","google_compute_attached_disk","google_compute_autoscaler","google_compute_backend_bucket","google_compute_backend_bucket_signed_url_key","google_compute_backend_service","google_compute_backend_service_signed_url_key","google_compute_disk","google_compute_disk_iam_member","google_compute_disk_resource_policy_attachment","google_compute_external_vpn_gateway","google_compute_firewall","google_compute_firewall_policy","google_compute_firewall_policy_association","google_compute_firewall_policy_rule","google_compute_forwarding_rule","google_compute_global_address","google_compute_global_forwarding_rule","google_compute_global_network_endpoint","google_compute_global_network_endpoint_group","google_compute_ha_vpn_gateway","google_compute_health_check","google_compute_http_health_check","google_compute_https_health_check","google_compute_image","google_compute_image_iam_member","google_compute_instance","google_compute_instance_from_template","google_compute_instance_group","google_compute_instance_group_manager","google_compute_instance_group_named_port","google_compute_instance_iam_member","google_compute_instance_template","google_compute_interconnect_attachment","google_compute_managed_ssl_certificate","google_compute_network","google_compute_network_endpoint","google_compute_network_endpoint_group","google_compute_network_firewall_policy","google_compute_network_firewall_policy_association","google_compute_network_peering","google_compute_network_peering_routes_config","google_compute_node_group","google_compute_node_template","google_compute_packet_mirroring","google_compute_per_instance_config","google_compute_project_default_network_tier","google_compute_project_metadata","google_compute_project_metadata_item","google_compute_region_autoscaler","google_compute_region_backend_service","google_compute_region_disk","google_compute_region_disk_iam_member","google_compute_region_disk_resource_policy_attachment","google_compute_region_health_check","google_compute_region_instance_group_manager","google_compute_region_network_endpoint","google_compute_region_network_endpoint_group","google_compute_region_network_firewall_policy","google_compute_region_network_firewall_policy_association","google_compute_region_per_instance_config","google_compute_region_ssl_certificate","google_compute_region_target_http_proxy","google_compute_region_target_https_proxy","google_compute_region_target_tcp_proxy","google_compute_region_url_map","google_compute_reservation","google_compute_resource_policy","google_compute_route","google_compute_router","google_compute_router_interface","google_compute_router_nat","google_compute_router_peer","google_compute_security_policy","google_compute_service_attachment","google_compute_shared_vpc_host_project","google_compute_shared_vpc_service_project","google_compute_snapshot","google_compute_snapshot_iam_member","google_compute_ssl_certificate","google_compute_ssl_policy","google_compute_subnetwork","google_compute_subnetwork_iam_member","google_compute_target_grpc_proxy","google_compute_target_http_proxy","google_compute_target_https_proxy","google_compute_target_instance","google_compute_target_pool","google_compute_target_ssl_proxy","google_compute_target_tcp_proxy","google_compute_url_map","google_compute_vpn_gateway","google_compute_vpn_tunnel","google_container_analysis_note","google_container_attached_cluster","google_container_aws_cluster","google_container_aws_node_pool","google_container_azure_client","google_container_azure_cluster","google_container_azure_node_pool","google_container_cluster","google_container_node_pool","google_container_registry","google_data_catalog_entry","google_data_catalog_entry_group","google_data_catalog_policy_tag","google_data_catalog_tag","google_data_catalog_tag_template","google_data_catalog_taxonomy","google_data_fusion_instance","google_data_loss_prevention_deidentify_template","google_data_loss_prevention_inspect_template","google_data_loss_prevention_job_trigger","google_data_loss_prevention_stored_info_type","google_dataflow_job","google_dataplex_asset","google_dataplex_lake","google_dataplex_zone","google_dataproc_autoscaling_policy","google_dataproc_cluster","google_dataproc_job","google_dataproc_metastore_service","google_dataproc_workflow_template","google_datastore_index","google_datastream_connection_profile","google_datastream_private_connection","google_dialogflow_cx_agent","google_dialogflow_cx_entity_type","google_dialogflow_cx_environment","google_dialogflow_cx_flow","google_dialogflow_cx_intent","google_dialogflow_cx_page","google_dialogflow_cx_version","google_dialogflow_cx_webhook","google_dns_managed_zone","google_dns_managed_zone_iam_member","google_dns_policy","google_dns_record_set","google_dns_response_policy","google_dns_response_policy_rule","google_document_ai_processor","google_essential_contacts_contact","google_eventarc_channel","google_eventarc_google_channel_config","google_eventarc_trigger","google_filestore_backup","google_filestore_instance","google_filestore_snapshot","google_firebaserules_release","google_firebaserules_ruleset","google_folder","google_folder_iam_member","google_gke_backup_backup_plan","google_gke_hub_membership","google_gke_hub_membership_iam_member","google_healthcare_consent_store","google_healthcare_dataset","google_healthcare_dataset_iam_member","google_iam_workload_identity_pool","google_iam_workload_identity_pool_provider","google_iap_app_engine_service_iam_member","google_iap_app_engine_version_iam_member","google_iap_tunnel_iam_member","google_iap_web_backend_service_iam_member","google_iap_web_iam_member","google_iap_web_type_app_engine_iam_member","google_iap_web_type_compute_iam_member","google_identity_platform_default_supported_idp_config","google_identity_platform_inbound_saml_config","google_identity_platform_oauth_idp_config","google_identity_platform_project_default_config","google_identity_platform_tenant","google_identity_platform_tenant_default_supported_idp_config","google_identity_platform_tenant_inbound_saml_config","google_identity_platform_tenant_oauth_idp_config","google_kms_crypto_key","google_kms_crypto_key_iam_member","google_kms_crypto_key_version","google_kms_key_ring","google_kms_key_ring_iam_member","google_kms_key_ring_import_job","google_kms_secret_ciphertext","google_logging_folder_bucket_config","google_logging_folder_exclusion","google_logging_folder_sink","google_logging_log_view","google_logging_metric","google_logging_project_bucket_config","google_logging_project_exclusion","google_logging_project_sink","google_memcache_instance","google_ml_engine_model","google_monitoring_alert_policy","google_monitoring_custom_service","google_monitoring_dashboard","google_monitoring_group","google_monitoring_metric_descriptor","google_monitoring_notification_channel","google_monitoring_service","google_monitoring_slo","google_monitoring_uptime_check_config","google_network_connectivity_hub","google_network_connectivity_service_connection_policy","google_network_connectivity_spoke","google_network_management_connectivity_test","google_notebooks_environment","google_notebooks_instance","google_notebooks_instance_iam_member","google_notebooks_runtime","google_notebooks_runtime_iam_member","google_org_policy_policy","google_organization_iam_audit_config","google_organization_iam_custom_role","google_organization_iam_member","google_os_config_os_policy_assignment","google_os_config_patch_deployment","google_os_login_ssh_public_key","google_privateca_ca_pool","google_privateca_ca_pool_iam_member","google_privateca_certificate","google_privateca_certificate_authority","google_privateca_certificate_template","google_privateca_certificate_template_iam_member","google_project","google_project_default_service_accounts","google_project_iam_audit_config","google_project_iam_custom_role","google_project_iam_member","google_project_service","google_project_usage_export_bucket","google_pubsub_lite_reservation","google_pubsub_lite_subscription","google_pubsub_lite_topic","google_pubsub_schema","google_pubsub_subscription","google_pubsub_subscription_iam_member","google_pubsub_topic","google_pubsub_topic_iam_member","google_redis_cluster","google_redis_instance","google_secret_manager_secret","google_secret_manager_secret_iam_member","google_secret_manager_secret_version","google_service_account","google_service_account_iam_member","google_service_account_key","google_service_networking_connection","google_service_networking_peered_dns_domain","google_sourcerepo_repository","google_sourcerepo_repository_iam_member","google_spanner_database","google_spanner_database_iam_member","google_spanner_instance","google_spanner_instance_iam_member","google_sql_database","google_sql_database_instance","google_sql_source_representation_instance","google_sql_ssl_cert","google_sql_user","google_storage_bucket","google_storage_bucket_access_control","google_storage_bucket_acl","google_storage_bucket_iam_member","google_storage_bucket_object","google_storage_default_object_access_control","google_storage_default_object_acl","google_storage_hmac_key","google_storage_notification","google_storage_object_access_control","google_storage_object_acl","google_storage_transfer_agent_pool","google_tags_tag_binding","google_tags_tag_key","google_tags_tag_value","google_tpu_node","google_vertex_ai_dataset","google_vertex_ai_featurestore","google_vertex_ai_featurestore_entitytype","google_vertex_ai_tensorboard","google_vpc_access_connector","google_workflows_workflow"] \ No newline at end of file +["google_access_context_manager_access_level","google_access_context_manager_access_level_condition","google_access_context_manager_access_policy","google_access_context_manager_access_policy_iam_member","google_access_context_manager_service_perimeter","google_access_context_manager_service_perimeter_resource","google_active_directory_domain","google_alloydb_backup","google_alloydb_cluster","google_alloydb_instance","google_apigee_addons_config","google_apigee_endpoint_attachment","google_apigee_envgroup","google_apigee_envgroup_attachment","google_apigee_environment","google_apigee_environment_iam_member","google_apigee_instance","google_apigee_instance_attachment","google_apigee_nat_address","google_apigee_organization","google_apigee_sync_authorization","google_app_engine_application","google_app_engine_application_url_dispatch_rules","google_app_engine_firewall_rule","google_app_engine_service_network_settings","google_app_engine_standard_app_version","google_artifact_registry_repository","google_artifact_registry_repository_iam_member","google_beyondcorp_app_connection","google_beyondcorp_app_connector","google_beyondcorp_app_gateway","google_bigquery_analytics_hub_data_exchange","google_bigquery_analytics_hub_data_exchange_iam_member","google_bigquery_analytics_hub_listing","google_bigquery_connection","google_bigquery_data_transfer_config","google_bigquery_dataset","google_bigquery_dataset_access","google_bigquery_dataset_iam_binding","google_bigquery_dataset_iam_member","google_bigquery_dataset_iam_policy","google_bigquery_job","google_bigquery_reservation","google_bigquery_reservation_assignment","google_bigquery_routine","google_bigquery_table","google_bigquery_table_iam_binding","google_bigquery_table_iam_member","google_bigquery_table_iam_policy","google_bigtable_app_profile","google_bigtable_gc_policy","google_bigtable_instance","google_bigtable_instance_iam_binding","google_bigtable_instance_iam_member","google_bigtable_instance_iam_policy","google_bigtable_table","google_bigtable_table_iam_binding","google_bigtable_table_iam_member","google_bigtable_table_iam_policy","google_binary_authorization_attestor","google_binary_authorization_policy","google_certificate_manager_certificate","google_certificate_manager_certificate_map","google_certificate_manager_certificate_map_entry","google_certificate_manager_dns_authorization","google_certificate_manager_trust_config","google_cloud_ids_endpoint","google_cloud_run_domain_mapping","google_cloud_run_service","google_cloud_run_service_iam_member","google_cloud_run_v2_job","google_cloud_run_v2_service","google_cloud_scheduler_job","google_cloud_tasks_queue","google_cloudbuild_trigger","google_cloudbuild_worker_pool","google_cloudfunctions2_function","google_cloudfunctions_function","google_cloudfunctions_function_iam_member","google_composer_environment","google_compute_address","google_compute_attached_disk","google_compute_autoscaler","google_compute_backend_bucket","google_compute_backend_bucket_signed_url_key","google_compute_backend_service","google_compute_backend_service_signed_url_key","google_compute_disk","google_compute_disk_iam_member","google_compute_disk_resource_policy_attachment","google_compute_external_vpn_gateway","google_compute_firewall","google_compute_firewall_policy","google_compute_firewall_policy_association","google_compute_firewall_policy_rule","google_compute_forwarding_rule","google_compute_global_address","google_compute_global_forwarding_rule","google_compute_global_network_endpoint","google_compute_global_network_endpoint_group","google_compute_ha_vpn_gateway","google_compute_health_check","google_compute_http_health_check","google_compute_https_health_check","google_compute_image","google_compute_image_iam_member","google_compute_instance","google_compute_instance_from_template","google_compute_instance_group","google_compute_instance_group_manager","google_compute_instance_group_named_port","google_compute_instance_iam_member","google_compute_instance_template","google_compute_interconnect_attachment","google_compute_managed_ssl_certificate","google_compute_network","google_compute_network_endpoint","google_compute_network_endpoint_group","google_compute_network_firewall_policy","google_compute_network_firewall_policy_association","google_compute_network_peering","google_compute_network_peering_routes_config","google_compute_node_group","google_compute_node_template","google_compute_packet_mirroring","google_compute_per_instance_config","google_compute_project_default_network_tier","google_compute_project_metadata","google_compute_project_metadata_item","google_compute_region_autoscaler","google_compute_region_backend_service","google_compute_region_disk","google_compute_region_disk_iam_member","google_compute_region_disk_resource_policy_attachment","google_compute_region_health_check","google_compute_region_instance_group_manager","google_compute_region_network_endpoint","google_compute_region_network_endpoint_group","google_compute_region_network_firewall_policy","google_compute_region_network_firewall_policy_association","google_compute_region_per_instance_config","google_compute_region_ssl_certificate","google_compute_region_target_http_proxy","google_compute_region_target_https_proxy","google_compute_region_target_tcp_proxy","google_compute_region_url_map","google_compute_reservation","google_compute_resource_policy","google_compute_route","google_compute_router","google_compute_router_interface","google_compute_router_nat","google_compute_router_peer","google_compute_security_policy","google_compute_service_attachment","google_compute_shared_vpc_host_project","google_compute_shared_vpc_service_project","google_compute_snapshot","google_compute_snapshot_iam_member","google_compute_ssl_certificate","google_compute_ssl_policy","google_compute_subnetwork","google_compute_subnetwork_iam_member","google_compute_target_grpc_proxy","google_compute_target_http_proxy","google_compute_target_https_proxy","google_compute_target_instance","google_compute_target_pool","google_compute_target_ssl_proxy","google_compute_target_tcp_proxy","google_compute_url_map","google_compute_vpn_gateway","google_compute_vpn_tunnel","google_container_analysis_note","google_container_attached_cluster","google_container_aws_cluster","google_container_aws_node_pool","google_container_azure_client","google_container_azure_cluster","google_container_azure_node_pool","google_container_cluster","google_container_node_pool","google_container_registry","google_data_catalog_entry","google_data_catalog_entry_group","google_data_catalog_policy_tag","google_data_catalog_tag","google_data_catalog_tag_template","google_data_catalog_taxonomy","google_data_fusion_instance","google_data_loss_prevention_deidentify_template","google_data_loss_prevention_inspect_template","google_data_loss_prevention_job_trigger","google_data_loss_prevention_stored_info_type","google_dataflow_job","google_dataplex_aspect_type","google_dataplex_asset","google_dataplex_lake","google_dataplex_zone","google_dataproc_autoscaling_policy","google_dataproc_cluster","google_dataproc_job","google_dataproc_metastore_service","google_dataproc_workflow_template","google_datastore_index","google_datastream_connection_profile","google_datastream_private_connection","google_dialogflow_cx_agent","google_dialogflow_cx_entity_type","google_dialogflow_cx_environment","google_dialogflow_cx_flow","google_dialogflow_cx_intent","google_dialogflow_cx_page","google_dialogflow_cx_version","google_dialogflow_cx_webhook","google_dns_managed_zone","google_dns_managed_zone_iam_member","google_dns_policy","google_dns_record_set","google_dns_response_policy","google_dns_response_policy_rule","google_document_ai_processor","google_essential_contacts_contact","google_eventarc_channel","google_eventarc_google_channel_config","google_eventarc_trigger","google_filestore_backup","google_filestore_instance","google_filestore_snapshot","google_firebaserules_release","google_firebaserules_ruleset","google_folder","google_folder_iam_member","google_gke_backup_backup_plan","google_gke_hub_membership","google_gke_hub_membership_iam_member","google_healthcare_consent_store","google_healthcare_dataset","google_healthcare_dataset_iam_member","google_iam_workload_identity_pool","google_iam_workload_identity_pool_provider","google_iap_app_engine_service_iam_member","google_iap_app_engine_version_iam_member","google_iap_tunnel_iam_member","google_iap_web_backend_service_iam_member","google_iap_web_iam_member","google_iap_web_type_app_engine_iam_member","google_iap_web_type_compute_iam_member","google_identity_platform_default_supported_idp_config","google_identity_platform_inbound_saml_config","google_identity_platform_oauth_idp_config","google_identity_platform_project_default_config","google_identity_platform_tenant","google_identity_platform_tenant_default_supported_idp_config","google_identity_platform_tenant_inbound_saml_config","google_identity_platform_tenant_oauth_idp_config","google_kms_crypto_key","google_kms_crypto_key_iam_member","google_kms_crypto_key_version","google_kms_key_ring","google_kms_key_ring_iam_member","google_kms_key_ring_import_job","google_kms_secret_ciphertext","google_logging_folder_bucket_config","google_logging_folder_exclusion","google_logging_folder_sink","google_logging_log_view","google_logging_metric","google_logging_project_bucket_config","google_logging_project_exclusion","google_logging_project_sink","google_memcache_instance","google_ml_engine_model","google_monitoring_alert_policy","google_monitoring_custom_service","google_monitoring_dashboard","google_monitoring_group","google_monitoring_metric_descriptor","google_monitoring_notification_channel","google_monitoring_service","google_monitoring_slo","google_monitoring_uptime_check_config","google_network_connectivity_hub","google_network_connectivity_service_connection_policy","google_network_connectivity_spoke","google_network_management_connectivity_test","google_notebooks_environment","google_notebooks_instance","google_notebooks_instance_iam_member","google_notebooks_runtime","google_notebooks_runtime_iam_member","google_org_policy_policy","google_organization_iam_audit_config","google_organization_iam_custom_role","google_organization_iam_member","google_os_config_os_policy_assignment","google_os_config_patch_deployment","google_os_login_ssh_public_key","google_privateca_ca_pool","google_privateca_ca_pool_iam_member","google_privateca_certificate","google_privateca_certificate_authority","google_privateca_certificate_template","google_privateca_certificate_template_iam_member","google_project","google_project_default_service_accounts","google_project_iam_audit_config","google_project_iam_custom_role","google_project_iam_member","google_project_service","google_project_usage_export_bucket","google_pubsub_lite_reservation","google_pubsub_lite_subscription","google_pubsub_lite_topic","google_pubsub_schema","google_pubsub_subscription","google_pubsub_subscription_iam_member","google_pubsub_topic","google_pubsub_topic_iam_member","google_redis_cluster","google_redis_instance","google_secret_manager_secret","google_secret_manager_secret_iam_member","google_secret_manager_secret_version","google_service_account","google_service_account_iam_member","google_service_account_key","google_service_networking_connection","google_service_networking_peered_dns_domain","google_sourcerepo_repository","google_sourcerepo_repository_iam_member","google_spanner_database","google_spanner_database_iam_member","google_spanner_instance","google_spanner_instance_iam_member","google_sql_database","google_sql_database_instance","google_sql_source_representation_instance","google_sql_ssl_cert","google_sql_user","google_storage_bucket","google_storage_bucket_access_control","google_storage_bucket_acl","google_storage_bucket_iam_member","google_storage_bucket_object","google_storage_default_object_access_control","google_storage_default_object_acl","google_storage_hmac_key","google_storage_notification","google_storage_object_access_control","google_storage_object_acl","google_storage_transfer_agent_pool","google_tags_tag_binding","google_tags_tag_key","google_tags_tag_value","google_tpu_node","google_vertex_ai_dataset","google_vertex_ai_featurestore","google_vertex_ai_featurestore_entitytype","google_vertex_ai_tensorboard","google_vpc_access_connector","google_workflows_workflow"] \ No newline at end of file diff --git a/examples-generated/dataplex/v1beta1/aspecttype.yaml b/examples-generated/dataplex/v1beta1/aspecttype.yaml new file mode 100644 index 000000000..724ddd922 --- /dev/null +++ b/examples-generated/dataplex/v1beta1/aspecttype.yaml @@ -0,0 +1,38 @@ +apiVersion: dataplex.gcp.upbound.io/v1beta1 +kind: AspectType +metadata: + annotations: + meta.upbound.io/example-id: dataplex/v1beta1/aspecttype + labels: + testing.upbound.io/example-name: test_aspect_type_basic + name: test-aspect-type-basic +spec: + forProvider: + aspectTypeId: aspect-type-basic + location: us-central1 + metadataTemplate: | + { + "name": "tf-test-template", + "type": "record", + "recordFields": [ + { + "name": "type", + "type": "enum", + "annotations": { + "displayName": "Type", + "description": "Specifies the type of view represented by the entry." + }, + "index": 1, + "constraints": { + "required": true + }, + "enumValues": [ + { + "name": "VIEW", + "index": 1 + } + ] + } + ] + } + project: my-project-name diff --git a/examples/dataplex/v1beta1/aspecttype.yaml b/examples/dataplex/v1beta1/aspecttype.yaml new file mode 100644 index 000000000..01d0aee40 --- /dev/null +++ b/examples/dataplex/v1beta1/aspecttype.yaml @@ -0,0 +1,37 @@ +apiVersion: dataplex.gcp.upbound.io/v1beta1 +kind: AspectType +metadata: + annotations: + meta.upbound.io/example-id: dataplex/v1beta1/aspecttype + labels: + testing.upbound.io/example-name: test_aspect_type_basic + name: test-aspect-type-basic +spec: + forProvider: + aspectTypeId: aspect-type-basic + location: us-central1 + metadataTemplate: | + { + "name": "tf-test-template", + "type": "record", + "recordFields": [ + { + "name": "type", + "type": "enum", + "annotations": { + "displayName": "Type", + "description": "Specifies the type of view represented by the entry." + }, + "index": 1, + "constraints": { + "required": true + }, + "enumValues": [ + { + "name": "VIEW", + "index": 1 + } + ] + } + ] + } diff --git a/internal/controller/dataplex/aspecttype/zz_controller.go b/internal/controller/dataplex/aspecttype/zz_controller.go new file mode 100755 index 000000000..96bc390f8 --- /dev/null +++ b/internal/controller/dataplex/aspecttype/zz_controller.go @@ -0,0 +1,91 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package aspecttype + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/upbound/provider-gcp/apis/dataplex/v1beta1" + features "github.com/upbound/provider-gcp/internal/features" +) + +// Setup adds a controller that reconciles AspectType managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.AspectType_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.AspectType_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.AspectType_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["google_dataplex_aspect_type"], + tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.AspectType_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1beta1.AspectType + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1beta1.AspectType{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.AspectType") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1beta1.AspectTypeList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1beta1.AspectTypeList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.AspectType_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1beta1.AspectType{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_dataplex_setup.go b/internal/controller/zz_dataplex_setup.go index e7bad41e4..d8b5b1ff8 100755 --- a/internal/controller/zz_dataplex_setup.go +++ b/internal/controller/zz_dataplex_setup.go @@ -9,6 +9,7 @@ import ( "github.com/crossplane/upjet/pkg/controller" + aspecttype "github.com/upbound/provider-gcp/internal/controller/dataplex/aspecttype" asset "github.com/upbound/provider-gcp/internal/controller/dataplex/asset" lake "github.com/upbound/provider-gcp/internal/controller/dataplex/lake" zone "github.com/upbound/provider-gcp/internal/controller/dataplex/zone" @@ -18,6 +19,7 @@ import ( // the supplied manager. func Setup_dataplex(mgr ctrl.Manager, o controller.Options) error { for _, setup := range []func(ctrl.Manager, controller.Options) error{ + aspecttype.Setup, asset.Setup, lake.Setup, zone.Setup, diff --git a/internal/controller/zz_monolith_setup.go b/internal/controller/zz_monolith_setup.go index 6f5ab29a6..8d8068985 100755 --- a/internal/controller/zz_monolith_setup.go +++ b/internal/controller/zz_monolith_setup.go @@ -220,6 +220,7 @@ import ( inspecttemplate "github.com/upbound/provider-gcp/internal/controller/datalossprevention/inspecttemplate" jobtrigger "github.com/upbound/provider-gcp/internal/controller/datalossprevention/jobtrigger" storedinfotype "github.com/upbound/provider-gcp/internal/controller/datalossprevention/storedinfotype" + aspecttype "github.com/upbound/provider-gcp/internal/controller/dataplex/aspecttype" asset "github.com/upbound/provider-gcp/internal/controller/dataplex/asset" lake "github.com/upbound/provider-gcp/internal/controller/dataplex/lake" zone "github.com/upbound/provider-gcp/internal/controller/dataplex/zone" @@ -588,6 +589,7 @@ func Setup_monolith(mgr ctrl.Manager, o controller.Options) error { inspecttemplate.Setup, jobtrigger.Setup, storedinfotype.Setup, + aspecttype.Setup, asset.Setup, lake.Setup, zone.Setup, diff --git a/package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml b/package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml new file mode 100644 index 000000000..c4b4fb1d4 --- /dev/null +++ b/package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml @@ -0,0 +1,439 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: aspecttypes.dataplex.gcp.upbound.io +spec: + group: dataplex.gcp.upbound.io + names: + categories: + - crossplane + - managed + - gcp + kind: AspectType + listKind: AspectTypeList + plural: aspecttypes + singular: aspecttype + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: AspectType is the Schema for the AspectTypes API. An Aspect Type + is a template for creating Aspects. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: AspectTypeSpec defines the desired state of AspectType + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + aspectTypeId: + description: The aspect type id of the aspect type. + type: string + description: + description: Description of the AspectType. + type: string + displayName: + description: User friendly display name. + type: string + labels: + additionalProperties: + type: string + description: User-defined labels for the AspectType. + type: object + x-kubernetes-map-type: granular + location: + description: The location where aspect type will be created in. + type: string + metadataTemplate: + description: MetadataTemplate of the Aspect. + type: string + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + aspectTypeId: + description: The aspect type id of the aspect type. + type: string + description: + description: Description of the AspectType. + type: string + displayName: + description: User friendly display name. + type: string + labels: + additionalProperties: + type: string + description: User-defined labels for the AspectType. + type: object + x-kubernetes-map-type: granular + location: + description: The location where aspect type will be created in. + type: string + metadataTemplate: + description: MetadataTemplate of the Aspect. + type: string + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: AspectTypeStatus defines the observed state of AspectType. + properties: + atProvider: + properties: + aspectTypeId: + description: The aspect type id of the aspect type. + type: string + createTime: + description: The time when the AspectType was created. + type: string + description: + description: Description of the AspectType. + type: string + displayName: + description: User friendly display name. + type: string + effectiveLabels: + additionalProperties: + type: string + description: for all of the labels present on the resource. + type: object + x-kubernetes-map-type: granular + id: + description: an identifier for the resource with format projects/{{project}}/locations/{{location}}/aspectTypes/{{aspect_type_id}} + type: string + labels: + additionalProperties: + type: string + description: User-defined labels for the AspectType. + type: object + x-kubernetes-map-type: granular + location: + description: The location where aspect type will be created in. + type: string + metadataTemplate: + description: MetadataTemplate of the Aspect. + type: string + name: + description: 'The relative resource name of the AspectType, of + the form: projects/{project_number}/locations/{location_id}/aspectTypes/{aspect_type_id}' + type: string + project: + description: |- + The ID of the project in which the resource belongs. + If it is not provided, the provider project is used. + type: string + terraformLabels: + additionalProperties: + type: string + description: |- + The combination of labels configured directly on the resource + and default labels configured on the provider. + type: object + x-kubernetes-map-type: granular + transferStatus: + description: |- + Denotes the transfer status of the Aspect Type. It is unspecified + for Aspect Type created from Dataplex API. + type: string + uid: + description: System generated globally unique ID for the AspectType. + This ID will be different if the AspectType is deleted and re-created + with the same name. + type: string + updateTime: + description: The time when the AspectType was last updated. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} From e518f0d1cb9b4f103ef89aa765f7756f8e491694 Mon Sep 17 00:00:00 2001 From: nilan3 Date: Tue, 3 Dec 2024 11:01:56 +0000 Subject: [PATCH 2/5] update external name to use TemplatedStringAsIdentifier Signed-off-by: nilan3 --- apis/dataplex/v1beta1/zz_aspecttype_types.go | 13 ------------ .../dataplex/v1beta1/zz_generated.deepcopy.go | 20 ------------------- config/dataplex/config.go | 17 ++++++++++++++++ config/externalname.go | 2 +- .../dataplex/v1beta1/aspecttype.yaml | 1 - go.mod | 2 +- go.sum | 3 +-- .../dataplex/aspecttype/zz_controller.go | 1 + .../dataplex.gcp.upbound.io_aspecttypes.yaml | 12 ----------- 9 files changed, 21 insertions(+), 50 deletions(-) create mode 100644 config/dataplex/config.go diff --git a/apis/dataplex/v1beta1/zz_aspecttype_types.go b/apis/dataplex/v1beta1/zz_aspecttype_types.go index 04fb69b65..34251d7a3 100755 --- a/apis/dataplex/v1beta1/zz_aspecttype_types.go +++ b/apis/dataplex/v1beta1/zz_aspecttype_types.go @@ -15,9 +15,6 @@ import ( type AspectTypeInitParameters struct { - // The aspect type id of the aspect type. - AspectTypeID *string `json:"aspectTypeId,omitempty" tf:"aspect_type_id,omitempty"` - // Description of the AspectType. Description *string `json:"description,omitempty" tf:"description,omitempty"` @@ -28,9 +25,6 @@ type AspectTypeInitParameters struct { // +mapType=granular Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` - // The location where aspect type will be created in. - Location *string `json:"location,omitempty" tf:"location,omitempty"` - // MetadataTemplate of the Aspect. MetadataTemplate *string `json:"metadataTemplate,omitempty" tf:"metadata_template,omitempty"` @@ -41,9 +35,6 @@ type AspectTypeInitParameters struct { type AspectTypeObservation struct { - // The aspect type id of the aspect type. - AspectTypeID *string `json:"aspectTypeId,omitempty" tf:"aspect_type_id,omitempty"` - // The time when the AspectType was created. CreateTime *string `json:"createTime,omitempty" tf:"create_time,omitempty"` @@ -95,10 +86,6 @@ type AspectTypeObservation struct { type AspectTypeParameters struct { - // The aspect type id of the aspect type. - // +kubebuilder:validation:Optional - AspectTypeID *string `json:"aspectTypeId,omitempty" tf:"aspect_type_id,omitempty"` - // Description of the AspectType. // +kubebuilder:validation:Optional Description *string `json:"description,omitempty" tf:"description,omitempty"` diff --git a/apis/dataplex/v1beta1/zz_generated.deepcopy.go b/apis/dataplex/v1beta1/zz_generated.deepcopy.go index 8da932f35..251e29be7 100644 --- a/apis/dataplex/v1beta1/zz_generated.deepcopy.go +++ b/apis/dataplex/v1beta1/zz_generated.deepcopy.go @@ -43,11 +43,6 @@ func (in *AspectType) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AspectTypeInitParameters) DeepCopyInto(out *AspectTypeInitParameters) { *out = *in - if in.AspectTypeID != nil { - in, out := &in.AspectTypeID, &out.AspectTypeID - *out = new(string) - **out = **in - } if in.Description != nil { in, out := &in.Description, &out.Description *out = new(string) @@ -74,11 +69,6 @@ func (in *AspectTypeInitParameters) DeepCopyInto(out *AspectTypeInitParameters) (*out)[key] = outVal } } - if in.Location != nil { - in, out := &in.Location, &out.Location - *out = new(string) - **out = **in - } if in.MetadataTemplate != nil { in, out := &in.MetadataTemplate, &out.MetadataTemplate *out = new(string) @@ -136,11 +126,6 @@ func (in *AspectTypeList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AspectTypeObservation) DeepCopyInto(out *AspectTypeObservation) { *out = *in - if in.AspectTypeID != nil { - in, out := &in.AspectTypeID, &out.AspectTypeID - *out = new(string) - **out = **in - } if in.CreateTime != nil { in, out := &in.CreateTime, &out.CreateTime *out = new(string) @@ -259,11 +244,6 @@ func (in *AspectTypeObservation) DeepCopy() *AspectTypeObservation { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AspectTypeParameters) DeepCopyInto(out *AspectTypeParameters) { *out = *in - if in.AspectTypeID != nil { - in, out := &in.AspectTypeID, &out.AspectTypeID - *out = new(string) - **out = **in - } if in.Description != nil { in, out := &in.Description, &out.Description *out = new(string) diff --git a/config/dataplex/config.go b/config/dataplex/config.go new file mode 100644 index 000000000..64fdad79d --- /dev/null +++ b/config/dataplex/config.go @@ -0,0 +1,17 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: CC0-1.0 + +package dataplex + +import ( + "github.com/crossplane/upjet/pkg/config" +) + +// Configure configures individual resources by adding custom +// ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("google_dataplex_aspect_type", func(r *config.Resource) { + r.MarkAsRequired("location") + }) +} diff --git a/config/externalname.go b/config/externalname.go index fa447a157..474391cc2 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -431,7 +431,7 @@ var terraformPluginSDKExternalNameConfigs = map[string]config.ExternalName{ // Imported by using the following projects/{{project}}/locations/{{location}}/lakes/{{lake}}/zones/{{name}} "google_dataplex_zone": config.TemplatedStringAsIdentifier("name", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/lakes/{{ .parameters.lake }}/zones/{{ .external_name }}"), // Imported by using the following projects/{{project}}/locations/{{location}}/aspectTypes/{{aspect_type_id}} - "google_dataplex_aspect_type": config.IdentifierFromProvider, + "google_dataplex_aspect_type": config.TemplatedStringAsIdentifier("aspect_type_id", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/aspectTypes/{{ .external_name }}"), // dns // diff --git a/examples-generated/dataplex/v1beta1/aspecttype.yaml b/examples-generated/dataplex/v1beta1/aspecttype.yaml index 724ddd922..507deb7c2 100644 --- a/examples-generated/dataplex/v1beta1/aspecttype.yaml +++ b/examples-generated/dataplex/v1beta1/aspecttype.yaml @@ -8,7 +8,6 @@ metadata: name: test-aspect-type-basic spec: forProvider: - aspectTypeId: aspect-type-basic location: us-central1 metadataTemplate: | { diff --git a/go.mod b/go.mod index 2597f7239..19d52cc50 100644 --- a/go.mod +++ b/go.mod @@ -84,7 +84,7 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect diff --git a/go.sum b/go.sum index 6105e5f60..6407908c7 100644 --- a/go.sum +++ b/go.sum @@ -208,9 +208,8 @@ github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDP github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= diff --git a/internal/controller/dataplex/aspecttype/zz_controller.go b/internal/controller/dataplex/aspecttype/zz_controller.go index 96bc390f8..f14e276c5 100755 --- a/internal/controller/dataplex/aspecttype/zz_controller.go +++ b/internal/controller/dataplex/aspecttype/zz_controller.go @@ -29,6 +29,7 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1beta1.AspectType_GroupVersionKind.String()) var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) diff --git a/package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml b/package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml index c4b4fb1d4..51a74afa1 100644 --- a/package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml +++ b/package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml @@ -73,9 +73,6 @@ spec: type: string forProvider: properties: - aspectTypeId: - description: The aspect type id of the aspect type. - type: string description: description: Description of the AspectType. type: string @@ -113,9 +110,6 @@ spec: for example because of an external controller is managing them, like an autoscaler. properties: - aspectTypeId: - description: The aspect type id of the aspect type. - type: string description: description: Description of the AspectType. type: string @@ -128,9 +122,6 @@ spec: description: User-defined labels for the AspectType. type: object x-kubernetes-map-type: granular - location: - description: The location where aspect type will be created in. - type: string metadataTemplate: description: MetadataTemplate of the Aspect. type: string @@ -312,9 +303,6 @@ spec: properties: atProvider: properties: - aspectTypeId: - description: The aspect type id of the aspect type. - type: string createTime: description: The time when the AspectType was created. type: string From 8ae7ed6f76de13ecbf6b4dfdde7375639285bc24 Mon Sep 17 00:00:00 2001 From: nilan3 Date: Tue, 3 Dec 2024 11:49:09 +0000 Subject: [PATCH 3/5] clean up example Signed-off-by: nilan3 --- examples/dataplex/v1beta1/aspecttype.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/dataplex/v1beta1/aspecttype.yaml b/examples/dataplex/v1beta1/aspecttype.yaml index 01d0aee40..02aab733f 100644 --- a/examples/dataplex/v1beta1/aspecttype.yaml +++ b/examples/dataplex/v1beta1/aspecttype.yaml @@ -8,7 +8,6 @@ metadata: name: test-aspect-type-basic spec: forProvider: - aspectTypeId: aspect-type-basic location: us-central1 metadataTemplate: | { From 85313205dbcedeffc9b7775ad7c5f98b522238b4 Mon Sep 17 00:00:00 2001 From: nilan3 Date: Thu, 5 Dec 2024 10:38:41 +0000 Subject: [PATCH 4/5] add dataplex provider configuration Signed-off-by: nilan3 --- apis/dataplex/v1beta1/zz_aspecttype_types.go | 22 ++- .../dataplex/v1beta1/zz_generated.deepcopy.go | 20 +++ .../v1beta1/zz_generated.resolvers.go | 56 ++++++- config/dataplex/config.go | 4 + config/provider.go | 2 + .../dataplex/v1beta1/aspecttype.yaml | 4 +- .../dataplex.gcp.upbound.io_aspecttypes.yaml | 154 ++++++++++++++++++ 7 files changed, 256 insertions(+), 6 deletions(-) diff --git a/apis/dataplex/v1beta1/zz_aspecttype_types.go b/apis/dataplex/v1beta1/zz_aspecttype_types.go index 34251d7a3..055da095c 100755 --- a/apis/dataplex/v1beta1/zz_aspecttype_types.go +++ b/apis/dataplex/v1beta1/zz_aspecttype_types.go @@ -30,7 +30,16 @@ type AspectTypeInitParameters struct { // The ID of the project in which the resource belongs. // If it is not provided, the provider project is used. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/cloudplatform/v1beta1.Project Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Reference to a Project in cloudplatform to populate project. + // +kubebuilder:validation:Optional + ProjectRef *v1.Reference `json:"projectRef,omitempty" tf:"-"` + + // Selector for a Project in cloudplatform to populate project. + // +kubebuilder:validation:Optional + ProjectSelector *v1.Selector `json:"projectSelector,omitempty" tf:"-"` } type AspectTypeObservation struct { @@ -100,8 +109,8 @@ type AspectTypeParameters struct { Labels map[string]*string `json:"labels,omitempty" tf:"labels,omitempty"` // The location where aspect type will be created in. - // +kubebuilder:validation:Optional - Location *string `json:"location,omitempty" tf:"location,omitempty"` + // +kubebuilder:validation:Required + Location *string `json:"location" tf:"location,omitempty"` // MetadataTemplate of the Aspect. // +kubebuilder:validation:Optional @@ -109,8 +118,17 @@ type AspectTypeParameters struct { // The ID of the project in which the resource belongs. // If it is not provided, the provider project is used. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/cloudplatform/v1beta1.Project // +kubebuilder:validation:Optional Project *string `json:"project,omitempty" tf:"project,omitempty"` + + // Reference to a Project in cloudplatform to populate project. + // +kubebuilder:validation:Optional + ProjectRef *v1.Reference `json:"projectRef,omitempty" tf:"-"` + + // Selector for a Project in cloudplatform to populate project. + // +kubebuilder:validation:Optional + ProjectSelector *v1.Selector `json:"projectSelector,omitempty" tf:"-"` } // AspectTypeSpec defines the desired state of AspectType diff --git a/apis/dataplex/v1beta1/zz_generated.deepcopy.go b/apis/dataplex/v1beta1/zz_generated.deepcopy.go index 251e29be7..7e5181e23 100644 --- a/apis/dataplex/v1beta1/zz_generated.deepcopy.go +++ b/apis/dataplex/v1beta1/zz_generated.deepcopy.go @@ -79,6 +79,16 @@ func (in *AspectTypeInitParameters) DeepCopyInto(out *AspectTypeInitParameters) *out = new(string) **out = **in } + if in.ProjectRef != nil { + in, out := &in.ProjectRef, &out.ProjectRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ProjectSelector != nil { + in, out := &in.ProjectSelector, &out.ProjectSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AspectTypeInitParameters. @@ -285,6 +295,16 @@ func (in *AspectTypeParameters) DeepCopyInto(out *AspectTypeParameters) { *out = new(string) **out = **in } + if in.ProjectRef != nil { + in, out := &in.ProjectRef, &out.ProjectRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ProjectSelector != nil { + in, out := &in.ProjectSelector, &out.ProjectSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AspectTypeParameters. diff --git a/apis/dataplex/v1beta1/zz_generated.resolvers.go b/apis/dataplex/v1beta1/zz_generated.resolvers.go index 5bbfb91ae..7f52a70bd 100644 --- a/apis/dataplex/v1beta1/zz_generated.resolvers.go +++ b/apis/dataplex/v1beta1/zz_generated.resolvers.go @@ -9,14 +9,64 @@ package v1beta1 import ( "context" reference "github.com/crossplane/crossplane-runtime/pkg/reference" - xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" errors "github.com/pkg/errors" - client "sigs.k8s.io/controller-runtime/pkg/client" - // ResolveReferences of this Asset. + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" apisresolver "github.com/upbound/provider-gcp/internal/apis" + client "sigs.k8s.io/controller-runtime/pkg/client" ) +func (mg *AspectType) ResolveReferences( // ResolveReferences of this AspectType. + ctx context.Context, c client.Reader) error { + var m xpresource.Managed + var l xpresource.ManagedList + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + { + m, l, err = apisresolver.GetManagedResource("cloudplatform.gcp.upbound.io", "v1beta1", "Project", "ProjectList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Project), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.ProjectRef, + Selector: mg.Spec.ForProvider.ProjectSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Project") + } + mg.Spec.ForProvider.Project = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.ProjectRef = rsp.ResolvedReference + { + m, l, err = apisresolver.GetManagedResource("cloudplatform.gcp.upbound.io", "v1beta1", "Project", "ProjectList") + if err != nil { + return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") + } + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.Project), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.ProjectRef, + Selector: mg.Spec.InitProvider.ProjectSelector, + To: reference.To{List: l, Managed: m}, + }) + } + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Project") + } + mg.Spec.InitProvider.Project = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.ProjectRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this Asset. func (mg *Asset) ResolveReferences(ctx context.Context, c client.Reader) error { var m xpresource.Managed var l xpresource.ManagedList diff --git a/config/dataplex/config.go b/config/dataplex/config.go index 64fdad79d..fe1ebf13a 100644 --- a/config/dataplex/config.go +++ b/config/dataplex/config.go @@ -12,6 +12,10 @@ import ( // ResourceConfigurators. func Configure(p *config.Provider) { p.AddResourceConfigurator("google_dataplex_aspect_type", func(r *config.Resource) { + r.References["project"] = config.Reference{ + TerraformName: "google_project", + } + r.MarkAsRequired("aspect_type_id") r.MarkAsRequired("location") }) } diff --git a/config/provider.go b/config/provider.go index eba841bb2..de3f8eba1 100644 --- a/config/provider.go +++ b/config/provider.go @@ -23,6 +23,7 @@ import ( "github.com/upbound/provider-gcp/config/containeraws" "github.com/upbound/provider-gcp/config/containerazure" "github.com/upbound/provider-gcp/config/dataflow" + "github.com/upbound/provider-gcp/config/dataplex" "github.com/upbound/provider-gcp/config/dataproc" "github.com/upbound/provider-gcp/config/dns" "github.com/upbound/provider-gcp/config/endpoints" @@ -70,6 +71,7 @@ func init() { ProviderConfiguration.AddConfig(compute.Configure) ProviderConfiguration.AddConfig(container.Configure) ProviderConfiguration.AddConfig(dataflow.Configure) + ProviderConfiguration.AddConfig(dataplex.Configure) ProviderConfiguration.AddConfig(dataproc.Configure) ProviderConfiguration.AddConfig(dns.Configure) ProviderConfiguration.AddConfig(endpoints.Configure) diff --git a/examples-generated/dataplex/v1beta1/aspecttype.yaml b/examples-generated/dataplex/v1beta1/aspecttype.yaml index 507deb7c2..33684ec4a 100644 --- a/examples-generated/dataplex/v1beta1/aspecttype.yaml +++ b/examples-generated/dataplex/v1beta1/aspecttype.yaml @@ -34,4 +34,6 @@ spec: } ] } - project: my-project-name + projectSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml b/package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml index 51a74afa1..98b519bda 100644 --- a/package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml +++ b/package/crds/dataplex.gcp.upbound.io_aspecttypes.yaml @@ -96,6 +96,84 @@ spec: The ID of the project in which the resource belongs. If it is not provided, the provider project is used. type: string + projectRef: + description: Reference to a Project in cloudplatform to populate + project. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + projectSelector: + description: Selector for a Project in cloudplatform to populate + project. + 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 + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + required: + - location type: object initProvider: description: |- @@ -130,6 +208,82 @@ spec: The ID of the project in which the resource belongs. If it is not provided, the provider project is used. type: string + projectRef: + description: Reference to a Project in cloudplatform to populate + project. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + projectSelector: + description: Selector for a Project in cloudplatform to populate + project. + 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 + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object type: object managementPolicies: default: From c5495a6f8ee5c610bb1b646984846e92930c9e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20T=C3=BCrken?= Date: Thu, 5 Dec 2024 16:45:20 +0300 Subject: [PATCH 5/5] Remove aspect_type_id configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fatih Türken --- config/dataplex/config.go | 1 - 1 file changed, 1 deletion(-) diff --git a/config/dataplex/config.go b/config/dataplex/config.go index fe1ebf13a..13574c7a3 100644 --- a/config/dataplex/config.go +++ b/config/dataplex/config.go @@ -15,7 +15,6 @@ func Configure(p *config.Provider) { r.References["project"] = config.Reference{ TerraformName: "google_project", } - r.MarkAsRequired("aspect_type_id") r.MarkAsRequired("location") }) }