diff --git a/apis/logging/v1beta1/zz_folderbucketconfig_types.go b/apis/logging/v1beta1/zz_folderbucketconfig_types.go new file mode 100755 index 000000000..b073e021d --- /dev/null +++ b/apis/logging/v1beta1/zz_folderbucketconfig_types.go @@ -0,0 +1,193 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// 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 CmekSettingsInitParameters struct { + + // The resource name of the bucket. For example: "folders/my-folder-id/locations/my-location/buckets/my-bucket-id" + KMSKeyName *string `json:"kmsKeyName,omitempty" tf:"kms_key_name,omitempty"` +} + +type CmekSettingsObservation struct { + + // The resource name of the bucket. For example: "folders/my-folder-id/locations/my-location/buckets/my-bucket-id" + KMSKeyName *string `json:"kmsKeyName,omitempty" tf:"kms_key_name,omitempty"` + + // The resource name of the bucket. For example: "folders/my-folder-id/locations/my-location/buckets/my-bucket-id" + KMSKeyVersionName *string `json:"kmsKeyVersionName,omitempty" tf:"kms_key_version_name,omitempty"` + + // The resource name of the bucket. For example: "folders/my-folder-id/locations/my-location/buckets/my-bucket-id" + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // an identifier for the resource with format folders/{{folder}}/locations/{{location}}/buckets/{{bucket_id}} + ServiceAccountID *string `json:"serviceAccountId,omitempty" tf:"service_account_id,omitempty"` +} + +type CmekSettingsParameters struct { + + // The resource name of the bucket. For example: "folders/my-folder-id/locations/my-location/buckets/my-bucket-id" + // +kubebuilder:validation:Optional + KMSKeyName *string `json:"kmsKeyName" tf:"kms_key_name,omitempty"` +} + +type FolderBucketConfigInitParameters struct { + CmekSettings []CmekSettingsInitParameters `json:"cmekSettings,omitempty" tf:"cmek_settings,omitempty"` + + // Describes this bucket. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used. Bucket retention can not be increased on buckets outside of projects. + RetentionDays *float64 `json:"retentionDays,omitempty" tf:"retention_days,omitempty"` +} + +type FolderBucketConfigObservation struct { + + // The name of the logging bucket. Logging automatically creates two log buckets: _Required and _Default. + BucketID *string `json:"bucketId,omitempty" tf:"bucket_id,omitempty"` + + CmekSettings []CmekSettingsObservation `json:"cmekSettings,omitempty" tf:"cmek_settings,omitempty"` + + // Describes this bucket. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The parent resource that contains the logging bucket. + Folder *string `json:"folder,omitempty" tf:"folder,omitempty"` + + // an identifier for the resource with format folders/{{folder}}/locations/{{location}}/buckets/{{bucket_id}} + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The bucket's lifecycle such as active or deleted. See LifecycleState. + LifecycleState *string `json:"lifecycleState,omitempty" tf:"lifecycle_state,omitempty"` + + // The location of the bucket. + Location *string `json:"location,omitempty" tf:"location,omitempty"` + + // The resource name of the bucket. For example: "folders/my-folder-id/locations/my-location/buckets/my-bucket-id" + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used. Bucket retention can not be increased on buckets outside of projects. + RetentionDays *float64 `json:"retentionDays,omitempty" tf:"retention_days,omitempty"` +} + +type FolderBucketConfigParameters struct { + + // The name of the logging bucket. Logging automatically creates two log buckets: _Required and _Default. + // +kubebuilder:validation:Required + BucketID *string `json:"bucketId" tf:"bucket_id,omitempty"` + + // +kubebuilder:validation:Optional + CmekSettings []CmekSettingsParameters `json:"cmekSettings,omitempty" tf:"cmek_settings,omitempty"` + + // Describes this bucket. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The parent resource that contains the logging bucket. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/cloudplatform/v1beta1.Folder + // +crossplane:generate:reference:extractor=github.com/upbound/provider-gcp/config/common.ExtractFolderID() + // +kubebuilder:validation:Optional + Folder *string `json:"folder,omitempty" tf:"folder,omitempty"` + + // Reference to a Folder in cloudplatform to populate folder. + // +kubebuilder:validation:Optional + FolderRef *v1.Reference `json:"folderRef,omitempty" tf:"-"` + + // Selector for a Folder in cloudplatform to populate folder. + // +kubebuilder:validation:Optional + FolderSelector *v1.Selector `json:"folderSelector,omitempty" tf:"-"` + + // The location of the bucket. + // +kubebuilder:validation:Required + Location *string `json:"location" tf:"location,omitempty"` + + // Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used. Bucket retention can not be increased on buckets outside of projects. + // +kubebuilder:validation:Optional + RetentionDays *float64 `json:"retentionDays,omitempty" tf:"retention_days,omitempty"` +} + +// FolderBucketConfigSpec defines the desired state of FolderBucketConfig +type FolderBucketConfigSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider FolderBucketConfigParameters `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 FolderBucketConfigInitParameters `json:"initProvider,omitempty"` +} + +// FolderBucketConfigStatus defines the observed state of FolderBucketConfig. +type FolderBucketConfigStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider FolderBucketConfigObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// FolderBucketConfig is the Schema for the FolderBucketConfigs API. Manages a folder-level logging bucket config. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,gcp} +type FolderBucketConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec FolderBucketConfigSpec `json:"spec"` + Status FolderBucketConfigStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// FolderBucketConfigList contains a list of FolderBucketConfigs +type FolderBucketConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []FolderBucketConfig `json:"items"` +} + +// Repository type metadata. +var ( + FolderBucketConfig_Kind = "FolderBucketConfig" + FolderBucketConfig_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: FolderBucketConfig_Kind}.String() + FolderBucketConfig_KindAPIVersion = FolderBucketConfig_Kind + "." + CRDGroupVersion.String() + FolderBucketConfig_GroupVersionKind = CRDGroupVersion.WithKind(FolderBucketConfig_Kind) +) + +func init() { + SchemeBuilder.Register(&FolderBucketConfig{}, &FolderBucketConfigList{}) +} diff --git a/apis/logging/v1beta1/zz_folderexclusion_types.go b/apis/logging/v1beta1/zz_folderexclusion_types.go new file mode 100755 index 000000000..50e2ca1b6 --- /dev/null +++ b/apis/logging/v1beta1/zz_folderexclusion_types.go @@ -0,0 +1,161 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// 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 FolderExclusionInitParameters struct { + + // A human-readable description. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Whether this exclusion rule should be disabled or not. This defaults to + // false. + Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` + + // The filter to apply when excluding logs. Only log entries that match the filter are excluded. + // See Advanced Log Filters for information on how to + // write a filter. + Filter *string `json:"filter,omitempty" tf:"filter,omitempty"` +} + +type FolderExclusionObservation struct { + + // A human-readable description. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Whether this exclusion rule should be disabled or not. This defaults to + // false. + Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` + + // The filter to apply when excluding logs. Only log entries that match the filter are excluded. + // See Advanced Log Filters for information on how to + // write a filter. + Filter *string `json:"filter,omitempty" tf:"filter,omitempty"` + + // The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is + // accepted. + Folder *string `json:"folder,omitempty" tf:"folder,omitempty"` + + // an identifier for the resource with format folders/{{folder}}/exclusions/{{name}} + ID *string `json:"id,omitempty" tf:"id,omitempty"` +} + +type FolderExclusionParameters struct { + + // A human-readable description. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Whether this exclusion rule should be disabled or not. This defaults to + // false. + // +kubebuilder:validation:Optional + Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` + + // The filter to apply when excluding logs. Only log entries that match the filter are excluded. + // See Advanced Log Filters for information on how to + // write a filter. + // +kubebuilder:validation:Optional + Filter *string `json:"filter,omitempty" tf:"filter,omitempty"` + + // The folder to be exported to the sink. Note that either [FOLDER_ID] or "folders/[FOLDER_ID]" is + // accepted. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/cloudplatform/v1beta1.Folder + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("name",true) + // +kubebuilder:validation:Optional + Folder *string `json:"folder,omitempty" tf:"folder,omitempty"` + + // Reference to a Folder in cloudplatform to populate folder. + // +kubebuilder:validation:Optional + FolderRef *v1.Reference `json:"folderRef,omitempty" tf:"-"` + + // Selector for a Folder in cloudplatform to populate folder. + // +kubebuilder:validation:Optional + FolderSelector *v1.Selector `json:"folderSelector,omitempty" tf:"-"` +} + +// FolderExclusionSpec defines the desired state of FolderExclusion +type FolderExclusionSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider FolderExclusionParameters `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 FolderExclusionInitParameters `json:"initProvider,omitempty"` +} + +// FolderExclusionStatus defines the observed state of FolderExclusion. +type FolderExclusionStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider FolderExclusionObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// FolderExclusion is the Schema for the FolderExclusions API. Manages a folder-level logging exclusion. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,gcp} +type FolderExclusion struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.filter) || (has(self.initProvider) && has(self.initProvider.filter))",message="spec.forProvider.filter is a required parameter" + Spec FolderExclusionSpec `json:"spec"` + Status FolderExclusionStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// FolderExclusionList contains a list of FolderExclusions +type FolderExclusionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []FolderExclusion `json:"items"` +} + +// Repository type metadata. +var ( + FolderExclusion_Kind = "FolderExclusion" + FolderExclusion_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: FolderExclusion_Kind}.String() + FolderExclusion_KindAPIVersion = FolderExclusion_Kind + "." + CRDGroupVersion.String() + FolderExclusion_GroupVersionKind = CRDGroupVersion.WithKind(FolderExclusion_Kind) +) + +func init() { + SchemeBuilder.Register(&FolderExclusion{}, &FolderExclusionList{}) +} diff --git a/apis/logging/v1beta1/zz_foldersink_types.go b/apis/logging/v1beta1/zz_foldersink_types.go new file mode 100755 index 000000000..ad8f1c153 --- /dev/null +++ b/apis/logging/v1beta1/zz_foldersink_types.go @@ -0,0 +1,288 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// 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 BigqueryOptionsInitParameters struct { + + // Whether to use BigQuery's partition tables. + // By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned + // tables, the date suffix is no longer present and special query syntax + // has to be used instead. In both cases, tables are sharded based on UTC timezone. + UsePartitionedTables *bool `json:"usePartitionedTables,omitempty" tf:"use_partitioned_tables,omitempty"` +} + +type BigqueryOptionsObservation struct { + + // Whether to use BigQuery's partition tables. + // By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned + // tables, the date suffix is no longer present and special query syntax + // has to be used instead. In both cases, tables are sharded based on UTC timezone. + UsePartitionedTables *bool `json:"usePartitionedTables,omitempty" tf:"use_partitioned_tables,omitempty"` +} + +type BigqueryOptionsParameters struct { + + // Whether to use BigQuery's partition tables. + // By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned + // tables, the date suffix is no longer present and special query syntax + // has to be used instead. In both cases, tables are sharded based on UTC timezone. + // +kubebuilder:validation:Optional + UsePartitionedTables *bool `json:"usePartitionedTables" tf:"use_partitioned_tables,omitempty"` +} + +type ExclusionsInitParameters struct { + + // A description of this exclusion. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // If set to True, then this exclusion is disabled and it does not exclude any log entries. + Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` + + // An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. See Advanced Log Filters for information on how to + // write a filter. + Filter *string `json:"filter,omitempty" tf:"filter,omitempty"` + + // A client-assigned identifier, such as load-balancer-exclusion. Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric. + Name *string `json:"name,omitempty" tf:"name,omitempty"` +} + +type ExclusionsObservation struct { + + // A description of this exclusion. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // If set to True, then this exclusion is disabled and it does not exclude any log entries. + Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` + + // An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. See Advanced Log Filters for information on how to + // write a filter. + Filter *string `json:"filter,omitempty" tf:"filter,omitempty"` + + // A client-assigned identifier, such as load-balancer-exclusion. Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric. + Name *string `json:"name,omitempty" tf:"name,omitempty"` +} + +type ExclusionsParameters struct { + + // A description of this exclusion. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // If set to True, then this exclusion is disabled and it does not exclude any log entries. + // +kubebuilder:validation:Optional + Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` + + // An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries. See Advanced Log Filters for information on how to + // write a filter. + // +kubebuilder:validation:Optional + Filter *string `json:"filter" tf:"filter,omitempty"` + + // A client-assigned identifier, such as load-balancer-exclusion. Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric. + // +kubebuilder:validation:Optional + Name *string `json:"name" tf:"name,omitempty"` +} + +type FolderSinkInitParameters struct { + + // Options that affect sinks exporting data to BigQuery. Structure documented below. + BigqueryOptions []BigqueryOptionsInitParameters `json:"bigqueryOptions,omitempty" tf:"bigquery_options,omitempty"` + + // A description of this sink. The maximum length of the description is 8000 characters. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The destination of the sink (or, in other words, where logs are written to). Can be a + // Cloud Storage bucket, a PubSub topic, a BigQuery dataset or a Cloud Logging bucket. Examples: + Destination *string `json:"destination,omitempty" tf:"destination,omitempty"` + + // If set to True, then this sink is disabled and it does not export any log entries. + Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` + + // Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below. + Exclusions []ExclusionsInitParameters `json:"exclusions,omitempty" tf:"exclusions,omitempty"` + + // The filter to apply when exporting logs. Only log entries that match the filter are exported. + // See Advanced Log Filters for information on how to + // write a filter. + Filter *string `json:"filter,omitempty" tf:"filter,omitempty"` + + // Whether or not to include children folders in the sink export. If true, logs + // associated with child projects are also exported; otherwise only logs relating to the provided folder are included. + IncludeChildren *bool `json:"includeChildren,omitempty" tf:"include_children,omitempty"` +} + +type FolderSinkObservation struct { + + // Options that affect sinks exporting data to BigQuery. Structure documented below. + BigqueryOptions []BigqueryOptionsObservation `json:"bigqueryOptions,omitempty" tf:"bigquery_options,omitempty"` + + // A description of this sink. The maximum length of the description is 8000 characters. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The destination of the sink (or, in other words, where logs are written to). Can be a + // Cloud Storage bucket, a PubSub topic, a BigQuery dataset or a Cloud Logging bucket. Examples: + Destination *string `json:"destination,omitempty" tf:"destination,omitempty"` + + // If set to True, then this sink is disabled and it does not export any log entries. + Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` + + // Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below. + Exclusions []ExclusionsObservation `json:"exclusions,omitempty" tf:"exclusions,omitempty"` + + // The filter to apply when exporting logs. Only log entries that match the filter are exported. + // See Advanced Log Filters for information on how to + // write a filter. + Filter *string `json:"filter,omitempty" tf:"filter,omitempty"` + + // The folder to be exported to the sink. Note that either [FOLDER_ID] or folders/[FOLDER_ID] is + // accepted. + Folder *string `json:"folder,omitempty" tf:"folder,omitempty"` + + // an identifier for the resource with format folders/{{folder_id}}/sinks/{{name}} + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Whether or not to include children folders in the sink export. If true, logs + // associated with child projects are also exported; otherwise only logs relating to the provided folder are included. + IncludeChildren *bool `json:"includeChildren,omitempty" tf:"include_children,omitempty"` + + // The identity associated with this sink. This identity must be granted write access to the + // configured destination. + WriterIdentity *string `json:"writerIdentity,omitempty" tf:"writer_identity,omitempty"` +} + +type FolderSinkParameters struct { + + // Options that affect sinks exporting data to BigQuery. Structure documented below. + // +kubebuilder:validation:Optional + BigqueryOptions []BigqueryOptionsParameters `json:"bigqueryOptions,omitempty" tf:"bigquery_options,omitempty"` + + // A description of this sink. The maximum length of the description is 8000 characters. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The destination of the sink (or, in other words, where logs are written to). Can be a + // Cloud Storage bucket, a PubSub topic, a BigQuery dataset or a Cloud Logging bucket. Examples: + // +kubebuilder:validation:Optional + Destination *string `json:"destination,omitempty" tf:"destination,omitempty"` + + // If set to True, then this sink is disabled and it does not export any log entries. + // +kubebuilder:validation:Optional + Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` + + // Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below. + // +kubebuilder:validation:Optional + Exclusions []ExclusionsParameters `json:"exclusions,omitempty" tf:"exclusions,omitempty"` + + // The filter to apply when exporting logs. Only log entries that match the filter are exported. + // See Advanced Log Filters for information on how to + // write a filter. + // +kubebuilder:validation:Optional + Filter *string `json:"filter,omitempty" tf:"filter,omitempty"` + + // The folder to be exported to the sink. Note that either [FOLDER_ID] or folders/[FOLDER_ID] is + // accepted. + // +crossplane:generate:reference:type=github.com/upbound/provider-gcp/apis/cloudplatform/v1beta1.Folder + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractParamPath("name",true) + // +kubebuilder:validation:Optional + Folder *string `json:"folder,omitempty" tf:"folder,omitempty"` + + // Reference to a Folder in cloudplatform to populate folder. + // +kubebuilder:validation:Optional + FolderRef *v1.Reference `json:"folderRef,omitempty" tf:"-"` + + // Selector for a Folder in cloudplatform to populate folder. + // +kubebuilder:validation:Optional + FolderSelector *v1.Selector `json:"folderSelector,omitempty" tf:"-"` + + // Whether or not to include children folders in the sink export. If true, logs + // associated with child projects are also exported; otherwise only logs relating to the provided folder are included. + // +kubebuilder:validation:Optional + IncludeChildren *bool `json:"includeChildren,omitempty" tf:"include_children,omitempty"` +} + +// FolderSinkSpec defines the desired state of FolderSink +type FolderSinkSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider FolderSinkParameters `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 FolderSinkInitParameters `json:"initProvider,omitempty"` +} + +// FolderSinkStatus defines the observed state of FolderSink. +type FolderSinkStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider FolderSinkObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// FolderSink is the Schema for the FolderSinks API. Manages a folder-level logging sink. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].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:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,gcp} +type FolderSink struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.destination) || (has(self.initProvider) && has(self.initProvider.destination))",message="spec.forProvider.destination is a required parameter" + Spec FolderSinkSpec `json:"spec"` + Status FolderSinkStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// FolderSinkList contains a list of FolderSinks +type FolderSinkList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []FolderSink `json:"items"` +} + +// Repository type metadata. +var ( + FolderSink_Kind = "FolderSink" + FolderSink_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: FolderSink_Kind}.String() + FolderSink_KindAPIVersion = FolderSink_Kind + "." + CRDGroupVersion.String() + FolderSink_GroupVersionKind = CRDGroupVersion.WithKind(FolderSink_Kind) +) + +func init() { + SchemeBuilder.Register(&FolderSink{}, &FolderSinkList{}) +} diff --git a/apis/logging/v1beta1/zz_generated.deepcopy.go b/apis/logging/v1beta1/zz_generated.deepcopy.go index 4af4d4fc3..90b0c6fd2 100644 --- a/apis/logging/v1beta1/zz_generated.deepcopy.go +++ b/apis/logging/v1beta1/zz_generated.deepcopy.go @@ -196,6 +196,11 @@ func (in *BucketOptionsParameters) DeepCopy() *BucketOptionsParameters { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CmekSettingsInitParameters) DeepCopyInto(out *CmekSettingsInitParameters) { *out = *in + if in.KMSKeyName != nil { + in, out := &in.KMSKeyName, &out.KMSKeyName + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CmekSettingsInitParameters. @@ -251,16 +256,6 @@ func (in *CmekSettingsParameters) DeepCopyInto(out *CmekSettingsParameters) { *out = new(string) **out = **in } - if in.KMSKeyNameRef != nil { - in, out := &in.KMSKeyNameRef, &out.KMSKeyNameRef - *out = new(v1.Reference) - (*in).DeepCopyInto(*out) - } - if in.KMSKeyNameSelector != nil { - in, out := &in.KMSKeyNameSelector, &out.KMSKeyNameSelector - *out = new(v1.Selector) - (*in).DeepCopyInto(*out) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CmekSettingsParameters. @@ -506,42 +501,782 @@ func (in *ExponentialBucketsObservation) DeepCopyInto(out *ExponentialBucketsObs } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExponentialBucketsObservation. -func (in *ExponentialBucketsObservation) DeepCopy() *ExponentialBucketsObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExponentialBucketsObservation. +func (in *ExponentialBucketsObservation) DeepCopy() *ExponentialBucketsObservation { + if in == nil { + return nil + } + out := new(ExponentialBucketsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExponentialBucketsParameters) DeepCopyInto(out *ExponentialBucketsParameters) { + *out = *in + if in.GrowthFactor != nil { + in, out := &in.GrowthFactor, &out.GrowthFactor + *out = new(float64) + **out = **in + } + if in.NumFiniteBuckets != nil { + in, out := &in.NumFiniteBuckets, &out.NumFiniteBuckets + *out = new(float64) + **out = **in + } + if in.Scale != nil { + in, out := &in.Scale, &out.Scale + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExponentialBucketsParameters. +func (in *ExponentialBucketsParameters) DeepCopy() *ExponentialBucketsParameters { + if in == nil { + return nil + } + out := new(ExponentialBucketsParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderBucketConfig) DeepCopyInto(out *FolderBucketConfig) { + *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 FolderBucketConfig. +func (in *FolderBucketConfig) DeepCopy() *FolderBucketConfig { + if in == nil { + return nil + } + out := new(FolderBucketConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FolderBucketConfig) 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 *FolderBucketConfigInitParameters) DeepCopyInto(out *FolderBucketConfigInitParameters) { + *out = *in + if in.CmekSettings != nil { + in, out := &in.CmekSettings, &out.CmekSettings + *out = make([]CmekSettingsInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.RetentionDays != nil { + in, out := &in.RetentionDays, &out.RetentionDays + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderBucketConfigInitParameters. +func (in *FolderBucketConfigInitParameters) DeepCopy() *FolderBucketConfigInitParameters { + if in == nil { + return nil + } + out := new(FolderBucketConfigInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderBucketConfigList) DeepCopyInto(out *FolderBucketConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FolderBucketConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderBucketConfigList. +func (in *FolderBucketConfigList) DeepCopy() *FolderBucketConfigList { + if in == nil { + return nil + } + out := new(FolderBucketConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FolderBucketConfigList) 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 *FolderBucketConfigObservation) DeepCopyInto(out *FolderBucketConfigObservation) { + *out = *in + if in.BucketID != nil { + in, out := &in.BucketID, &out.BucketID + *out = new(string) + **out = **in + } + if in.CmekSettings != nil { + in, out := &in.CmekSettings, &out.CmekSettings + *out = make([]CmekSettingsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Folder != nil { + in, out := &in.Folder, &out.Folder + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.LifecycleState != nil { + in, out := &in.LifecycleState, &out.LifecycleState + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RetentionDays != nil { + in, out := &in.RetentionDays, &out.RetentionDays + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderBucketConfigObservation. +func (in *FolderBucketConfigObservation) DeepCopy() *FolderBucketConfigObservation { + if in == nil { + return nil + } + out := new(FolderBucketConfigObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderBucketConfigParameters) DeepCopyInto(out *FolderBucketConfigParameters) { + *out = *in + if in.BucketID != nil { + in, out := &in.BucketID, &out.BucketID + *out = new(string) + **out = **in + } + if in.CmekSettings != nil { + in, out := &in.CmekSettings, &out.CmekSettings + *out = make([]CmekSettingsParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Folder != nil { + in, out := &in.Folder, &out.Folder + *out = new(string) + **out = **in + } + if in.FolderRef != nil { + in, out := &in.FolderRef, &out.FolderRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.FolderSelector != nil { + in, out := &in.FolderSelector, &out.FolderSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.RetentionDays != nil { + in, out := &in.RetentionDays, &out.RetentionDays + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderBucketConfigParameters. +func (in *FolderBucketConfigParameters) DeepCopy() *FolderBucketConfigParameters { + if in == nil { + return nil + } + out := new(FolderBucketConfigParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderBucketConfigSpec) DeepCopyInto(out *FolderBucketConfigSpec) { + *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 FolderBucketConfigSpec. +func (in *FolderBucketConfigSpec) DeepCopy() *FolderBucketConfigSpec { + if in == nil { + return nil + } + out := new(FolderBucketConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderBucketConfigStatus) DeepCopyInto(out *FolderBucketConfigStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderBucketConfigStatus. +func (in *FolderBucketConfigStatus) DeepCopy() *FolderBucketConfigStatus { + if in == nil { + return nil + } + out := new(FolderBucketConfigStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderExclusion) DeepCopyInto(out *FolderExclusion) { + *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 FolderExclusion. +func (in *FolderExclusion) DeepCopy() *FolderExclusion { + if in == nil { + return nil + } + out := new(FolderExclusion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FolderExclusion) 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 *FolderExclusionInitParameters) DeepCopyInto(out *FolderExclusionInitParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderExclusionInitParameters. +func (in *FolderExclusionInitParameters) DeepCopy() *FolderExclusionInitParameters { + if in == nil { + return nil + } + out := new(FolderExclusionInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderExclusionList) DeepCopyInto(out *FolderExclusionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FolderExclusion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderExclusionList. +func (in *FolderExclusionList) DeepCopy() *FolderExclusionList { + if in == nil { + return nil + } + out := new(FolderExclusionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FolderExclusionList) 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 *FolderExclusionObservation) DeepCopyInto(out *FolderExclusionObservation) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(string) + **out = **in + } + if in.Folder != nil { + in, out := &in.Folder, &out.Folder + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderExclusionObservation. +func (in *FolderExclusionObservation) DeepCopy() *FolderExclusionObservation { + if in == nil { + return nil + } + out := new(FolderExclusionObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderExclusionParameters) DeepCopyInto(out *FolderExclusionParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(string) + **out = **in + } + if in.Folder != nil { + in, out := &in.Folder, &out.Folder + *out = new(string) + **out = **in + } + if in.FolderRef != nil { + in, out := &in.FolderRef, &out.FolderRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.FolderSelector != nil { + in, out := &in.FolderSelector, &out.FolderSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderExclusionParameters. +func (in *FolderExclusionParameters) DeepCopy() *FolderExclusionParameters { + if in == nil { + return nil + } + out := new(FolderExclusionParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderExclusionSpec) DeepCopyInto(out *FolderExclusionSpec) { + *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 FolderExclusionSpec. +func (in *FolderExclusionSpec) DeepCopy() *FolderExclusionSpec { + if in == nil { + return nil + } + out := new(FolderExclusionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderExclusionStatus) DeepCopyInto(out *FolderExclusionStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderExclusionStatus. +func (in *FolderExclusionStatus) DeepCopy() *FolderExclusionStatus { + if in == nil { + return nil + } + out := new(FolderExclusionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderSink) DeepCopyInto(out *FolderSink) { + *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 FolderSink. +func (in *FolderSink) DeepCopy() *FolderSink { + if in == nil { + return nil + } + out := new(FolderSink) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FolderSink) 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 *FolderSinkInitParameters) DeepCopyInto(out *FolderSinkInitParameters) { + *out = *in + if in.BigqueryOptions != nil { + in, out := &in.BigqueryOptions, &out.BigqueryOptions + *out = make([]BigqueryOptionsInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(string) + **out = **in + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } + if in.Exclusions != nil { + in, out := &in.Exclusions, &out.Exclusions + *out = make([]ExclusionsInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(string) + **out = **in + } + if in.IncludeChildren != nil { + in, out := &in.IncludeChildren, &out.IncludeChildren + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderSinkInitParameters. +func (in *FolderSinkInitParameters) DeepCopy() *FolderSinkInitParameters { + if in == nil { + return nil + } + out := new(FolderSinkInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderSinkList) DeepCopyInto(out *FolderSinkList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FolderSink, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderSinkList. +func (in *FolderSinkList) DeepCopy() *FolderSinkList { + if in == nil { + return nil + } + out := new(FolderSinkList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FolderSinkList) 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 *FolderSinkObservation) DeepCopyInto(out *FolderSinkObservation) { + *out = *in + if in.BigqueryOptions != nil { + in, out := &in.BigqueryOptions, &out.BigqueryOptions + *out = make([]BigqueryOptionsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(string) + **out = **in + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } + if in.Exclusions != nil { + in, out := &in.Exclusions, &out.Exclusions + *out = make([]ExclusionsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(string) + **out = **in + } + if in.Folder != nil { + in, out := &in.Folder, &out.Folder + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.IncludeChildren != nil { + in, out := &in.IncludeChildren, &out.IncludeChildren + *out = new(bool) + **out = **in + } + if in.WriterIdentity != nil { + in, out := &in.WriterIdentity, &out.WriterIdentity + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderSinkObservation. +func (in *FolderSinkObservation) DeepCopy() *FolderSinkObservation { + if in == nil { + return nil + } + out := new(FolderSinkObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderSinkParameters) DeepCopyInto(out *FolderSinkParameters) { + *out = *in + if in.BigqueryOptions != nil { + in, out := &in.BigqueryOptions, &out.BigqueryOptions + *out = make([]BigqueryOptionsParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(string) + **out = **in + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } + if in.Exclusions != nil { + in, out := &in.Exclusions, &out.Exclusions + *out = make([]ExclusionsParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(string) + **out = **in + } + if in.Folder != nil { + in, out := &in.Folder, &out.Folder + *out = new(string) + **out = **in + } + if in.FolderRef != nil { + in, out := &in.FolderRef, &out.FolderRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.FolderSelector != nil { + in, out := &in.FolderSelector, &out.FolderSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.IncludeChildren != nil { + in, out := &in.IncludeChildren, &out.IncludeChildren + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderSinkParameters. +func (in *FolderSinkParameters) DeepCopy() *FolderSinkParameters { if in == nil { return nil } - out := new(ExponentialBucketsObservation) + out := new(FolderSinkParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExponentialBucketsParameters) DeepCopyInto(out *ExponentialBucketsParameters) { +func (in *FolderSinkSpec) DeepCopyInto(out *FolderSinkSpec) { *out = *in - if in.GrowthFactor != nil { - in, out := &in.GrowthFactor, &out.GrowthFactor - *out = new(float64) - **out = **in - } - if in.NumFiniteBuckets != nil { - in, out := &in.NumFiniteBuckets, &out.NumFiniteBuckets - *out = new(float64) - **out = **in - } - if in.Scale != nil { - in, out := &in.Scale, &out.Scale - *out = new(float64) - **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 FolderSinkSpec. +func (in *FolderSinkSpec) DeepCopy() *FolderSinkSpec { + if in == nil { + return nil } + out := new(FolderSinkSpec) + in.DeepCopyInto(out) + return out } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExponentialBucketsParameters. -func (in *ExponentialBucketsParameters) DeepCopy() *ExponentialBucketsParameters { +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FolderSinkStatus) DeepCopyInto(out *FolderSinkStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FolderSinkStatus. +func (in *FolderSinkStatus) DeepCopy() *FolderSinkStatus { if in == nil { return nil } - out := new(ExponentialBucketsParameters) + out := new(FolderSinkStatus) in.DeepCopyInto(out) return out } @@ -1432,12 +2167,92 @@ func (in *ProjectBucketConfig) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectBucketConfigCmekSettingsInitParameters) DeepCopyInto(out *ProjectBucketConfigCmekSettingsInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectBucketConfigCmekSettingsInitParameters. +func (in *ProjectBucketConfigCmekSettingsInitParameters) DeepCopy() *ProjectBucketConfigCmekSettingsInitParameters { + if in == nil { + return nil + } + out := new(ProjectBucketConfigCmekSettingsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectBucketConfigCmekSettingsObservation) DeepCopyInto(out *ProjectBucketConfigCmekSettingsObservation) { + *out = *in + if in.KMSKeyName != nil { + in, out := &in.KMSKeyName, &out.KMSKeyName + *out = new(string) + **out = **in + } + if in.KMSKeyVersionName != nil { + in, out := &in.KMSKeyVersionName, &out.KMSKeyVersionName + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.ServiceAccountID != nil { + in, out := &in.ServiceAccountID, &out.ServiceAccountID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectBucketConfigCmekSettingsObservation. +func (in *ProjectBucketConfigCmekSettingsObservation) DeepCopy() *ProjectBucketConfigCmekSettingsObservation { + if in == nil { + return nil + } + out := new(ProjectBucketConfigCmekSettingsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectBucketConfigCmekSettingsParameters) DeepCopyInto(out *ProjectBucketConfigCmekSettingsParameters) { + *out = *in + if in.KMSKeyName != nil { + in, out := &in.KMSKeyName, &out.KMSKeyName + *out = new(string) + **out = **in + } + if in.KMSKeyNameRef != nil { + in, out := &in.KMSKeyNameRef, &out.KMSKeyNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.KMSKeyNameSelector != nil { + in, out := &in.KMSKeyNameSelector, &out.KMSKeyNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectBucketConfigCmekSettingsParameters. +func (in *ProjectBucketConfigCmekSettingsParameters) DeepCopy() *ProjectBucketConfigCmekSettingsParameters { + if in == nil { + return nil + } + out := new(ProjectBucketConfigCmekSettingsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProjectBucketConfigInitParameters) DeepCopyInto(out *ProjectBucketConfigInitParameters) { *out = *in if in.CmekSettings != nil { in, out := &in.CmekSettings, &out.CmekSettings - *out = make([]CmekSettingsInitParameters, len(*in)) + *out = make([]ProjectBucketConfigCmekSettingsInitParameters, len(*in)) copy(*out, *in) } if in.Description != nil { @@ -1514,7 +2329,7 @@ func (in *ProjectBucketConfigObservation) DeepCopyInto(out *ProjectBucketConfigO } if in.CmekSettings != nil { in, out := &in.CmekSettings, &out.CmekSettings - *out = make([]CmekSettingsObservation, len(*in)) + *out = make([]ProjectBucketConfigCmekSettingsObservation, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -1586,7 +2401,7 @@ func (in *ProjectBucketConfigParameters) DeepCopyInto(out *ProjectBucketConfigPa } if in.CmekSettings != nil { in, out := &in.CmekSettings, &out.CmekSettings - *out = make([]CmekSettingsParameters, len(*in)) + *out = make([]ProjectBucketConfigCmekSettingsParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -1909,12 +2724,177 @@ func (in *ProjectSink) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectSinkBigqueryOptionsInitParameters) DeepCopyInto(out *ProjectSinkBigqueryOptionsInitParameters) { + *out = *in + if in.UsePartitionedTables != nil { + in, out := &in.UsePartitionedTables, &out.UsePartitionedTables + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectSinkBigqueryOptionsInitParameters. +func (in *ProjectSinkBigqueryOptionsInitParameters) DeepCopy() *ProjectSinkBigqueryOptionsInitParameters { + if in == nil { + return nil + } + out := new(ProjectSinkBigqueryOptionsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectSinkBigqueryOptionsObservation) DeepCopyInto(out *ProjectSinkBigqueryOptionsObservation) { + *out = *in + if in.UsePartitionedTables != nil { + in, out := &in.UsePartitionedTables, &out.UsePartitionedTables + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectSinkBigqueryOptionsObservation. +func (in *ProjectSinkBigqueryOptionsObservation) DeepCopy() *ProjectSinkBigqueryOptionsObservation { + if in == nil { + return nil + } + out := new(ProjectSinkBigqueryOptionsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectSinkBigqueryOptionsParameters) DeepCopyInto(out *ProjectSinkBigqueryOptionsParameters) { + *out = *in + if in.UsePartitionedTables != nil { + in, out := &in.UsePartitionedTables, &out.UsePartitionedTables + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectSinkBigqueryOptionsParameters. +func (in *ProjectSinkBigqueryOptionsParameters) DeepCopy() *ProjectSinkBigqueryOptionsParameters { + if in == nil { + return nil + } + out := new(ProjectSinkBigqueryOptionsParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectSinkExclusionsInitParameters) DeepCopyInto(out *ProjectSinkExclusionsInitParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectSinkExclusionsInitParameters. +func (in *ProjectSinkExclusionsInitParameters) DeepCopy() *ProjectSinkExclusionsInitParameters { + if in == nil { + return nil + } + out := new(ProjectSinkExclusionsInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectSinkExclusionsObservation) DeepCopyInto(out *ProjectSinkExclusionsObservation) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectSinkExclusionsObservation. +func (in *ProjectSinkExclusionsObservation) DeepCopy() *ProjectSinkExclusionsObservation { + if in == nil { + return nil + } + out := new(ProjectSinkExclusionsObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectSinkExclusionsParameters) DeepCopyInto(out *ProjectSinkExclusionsParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectSinkExclusionsParameters. +func (in *ProjectSinkExclusionsParameters) DeepCopy() *ProjectSinkExclusionsParameters { + if in == nil { + return nil + } + out := new(ProjectSinkExclusionsParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProjectSinkInitParameters) DeepCopyInto(out *ProjectSinkInitParameters) { *out = *in if in.BigqueryOptions != nil { in, out := &in.BigqueryOptions, &out.BigqueryOptions - *out = make([]BigqueryOptionsInitParameters, len(*in)) + *out = make([]ProjectSinkBigqueryOptionsInitParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -1936,7 +2916,7 @@ func (in *ProjectSinkInitParameters) DeepCopyInto(out *ProjectSinkInitParameters } if in.Exclusions != nil { in, out := &in.Exclusions, &out.Exclusions - *out = make([]ExclusionsInitParameters, len(*in)) + *out = make([]ProjectSinkExclusionsInitParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -2005,7 +2985,7 @@ func (in *ProjectSinkObservation) DeepCopyInto(out *ProjectSinkObservation) { *out = *in if in.BigqueryOptions != nil { in, out := &in.BigqueryOptions, &out.BigqueryOptions - *out = make([]BigqueryOptionsObservation, len(*in)) + *out = make([]ProjectSinkBigqueryOptionsObservation, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -2027,7 +3007,7 @@ func (in *ProjectSinkObservation) DeepCopyInto(out *ProjectSinkObservation) { } if in.Exclusions != nil { in, out := &in.Exclusions, &out.Exclusions - *out = make([]ExclusionsObservation, len(*in)) + *out = make([]ProjectSinkExclusionsObservation, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -2074,7 +3054,7 @@ func (in *ProjectSinkParameters) DeepCopyInto(out *ProjectSinkParameters) { *out = *in if in.BigqueryOptions != nil { in, out := &in.BigqueryOptions, &out.BigqueryOptions - *out = make([]BigqueryOptionsParameters, len(*in)) + *out = make([]ProjectSinkBigqueryOptionsParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -2096,7 +3076,7 @@ func (in *ProjectSinkParameters) DeepCopyInto(out *ProjectSinkParameters) { } if in.Exclusions != nil { in, out := &in.Exclusions, &out.Exclusions - *out = make([]ExclusionsParameters, len(*in)) + *out = make([]ProjectSinkExclusionsParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } diff --git a/apis/logging/v1beta1/zz_generated.managed.go b/apis/logging/v1beta1/zz_generated.managed.go index 78804a214..698a7d6f0 100644 --- a/apis/logging/v1beta1/zz_generated.managed.go +++ b/apis/logging/v1beta1/zz_generated.managed.go @@ -19,6 +19,186 @@ package v1beta1 import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +// GetCondition of this FolderBucketConfig. +func (mg *FolderBucketConfig) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this FolderBucketConfig. +func (mg *FolderBucketConfig) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this FolderBucketConfig. +func (mg *FolderBucketConfig) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this FolderBucketConfig. +func (mg *FolderBucketConfig) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this FolderBucketConfig. +func (mg *FolderBucketConfig) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this FolderBucketConfig. +func (mg *FolderBucketConfig) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this FolderBucketConfig. +func (mg *FolderBucketConfig) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this FolderBucketConfig. +func (mg *FolderBucketConfig) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this FolderBucketConfig. +func (mg *FolderBucketConfig) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this FolderBucketConfig. +func (mg *FolderBucketConfig) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this FolderBucketConfig. +func (mg *FolderBucketConfig) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this FolderBucketConfig. +func (mg *FolderBucketConfig) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this FolderExclusion. +func (mg *FolderExclusion) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this FolderExclusion. +func (mg *FolderExclusion) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this FolderExclusion. +func (mg *FolderExclusion) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this FolderExclusion. +func (mg *FolderExclusion) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this FolderExclusion. +func (mg *FolderExclusion) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this FolderExclusion. +func (mg *FolderExclusion) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this FolderExclusion. +func (mg *FolderExclusion) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this FolderExclusion. +func (mg *FolderExclusion) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this FolderExclusion. +func (mg *FolderExclusion) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this FolderExclusion. +func (mg *FolderExclusion) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this FolderExclusion. +func (mg *FolderExclusion) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this FolderExclusion. +func (mg *FolderExclusion) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this FolderSink. +func (mg *FolderSink) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this FolderSink. +func (mg *FolderSink) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this FolderSink. +func (mg *FolderSink) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this FolderSink. +func (mg *FolderSink) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this FolderSink. +func (mg *FolderSink) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this FolderSink. +func (mg *FolderSink) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this FolderSink. +func (mg *FolderSink) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this FolderSink. +func (mg *FolderSink) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this FolderSink. +func (mg *FolderSink) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this FolderSink. +func (mg *FolderSink) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this FolderSink. +func (mg *FolderSink) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this FolderSink. +func (mg *FolderSink) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this LogView. func (mg *LogView) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/logging/v1beta1/zz_generated.managedlist.go b/apis/logging/v1beta1/zz_generated.managedlist.go index 359df1917..da75c1836 100644 --- a/apis/logging/v1beta1/zz_generated.managedlist.go +++ b/apis/logging/v1beta1/zz_generated.managedlist.go @@ -19,6 +19,33 @@ package v1beta1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" +// GetItems of this FolderBucketConfigList. +func (l *FolderBucketConfigList) 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 FolderExclusionList. +func (l *FolderExclusionList) 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 FolderSinkList. +func (l *FolderSinkList) 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 LogViewList. func (l *LogViewList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/logging/v1beta1/zz_generated.resolvers.go b/apis/logging/v1beta1/zz_generated.resolvers.go index 7242b8302..c482f1569 100644 --- a/apis/logging/v1beta1/zz_generated.resolvers.go +++ b/apis/logging/v1beta1/zz_generated.resolvers.go @@ -22,11 +22,90 @@ import ( reference "github.com/crossplane/crossplane-runtime/pkg/reference" resource "github.com/crossplane/upjet/pkg/resource" errors "github.com/pkg/errors" - v1beta11 "github.com/upbound/provider-gcp/apis/cloudplatform/v1beta1" - v1beta1 "github.com/upbound/provider-gcp/apis/kms/v1beta1" + v1beta1 "github.com/upbound/provider-gcp/apis/cloudplatform/v1beta1" + v1beta11 "github.com/upbound/provider-gcp/apis/kms/v1beta1" + common "github.com/upbound/provider-gcp/config/common" client "sigs.k8s.io/controller-runtime/pkg/client" ) +// ResolveReferences of this FolderBucketConfig. +func (mg *FolderBucketConfig) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Folder), + Extract: common.ExtractFolderID(), + Reference: mg.Spec.ForProvider.FolderRef, + Selector: mg.Spec.ForProvider.FolderSelector, + To: reference.To{ + List: &v1beta1.FolderList{}, + Managed: &v1beta1.Folder{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Folder") + } + mg.Spec.ForProvider.Folder = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.FolderRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this FolderExclusion. +func (mg *FolderExclusion) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Folder), + Extract: resource.ExtractParamPath("name", true), + Reference: mg.Spec.ForProvider.FolderRef, + Selector: mg.Spec.ForProvider.FolderSelector, + To: reference.To{ + List: &v1beta1.FolderList{}, + Managed: &v1beta1.Folder{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Folder") + } + mg.Spec.ForProvider.Folder = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.FolderRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this FolderSink. +func (mg *FolderSink) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Folder), + Extract: resource.ExtractParamPath("name", true), + Reference: mg.Spec.ForProvider.FolderRef, + Selector: mg.Spec.ForProvider.FolderSelector, + To: reference.To{ + List: &v1beta1.FolderList{}, + Managed: &v1beta1.Folder{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Folder") + } + mg.Spec.ForProvider.Folder = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.FolderRef = rsp.ResolvedReference + + return nil +} + // ResolveReferences of this LogView. func (mg *LogView) ResolveReferences(ctx context.Context, c client.Reader) error { r := reference.NewAPIResolver(c, mg) @@ -93,8 +172,8 @@ func (mg *ProjectBucketConfig) ResolveReferences(ctx context.Context, c client.R Reference: mg.Spec.ForProvider.CmekSettings[i3].KMSKeyNameRef, Selector: mg.Spec.ForProvider.CmekSettings[i3].KMSKeyNameSelector, To: reference.To{ - List: &v1beta1.CryptoKeyList{}, - Managed: &v1beta1.CryptoKey{}, + List: &v1beta11.CryptoKeyList{}, + Managed: &v1beta11.CryptoKey{}, }, }) if err != nil { @@ -110,8 +189,8 @@ func (mg *ProjectBucketConfig) ResolveReferences(ctx context.Context, c client.R Reference: mg.Spec.ForProvider.ProjectRef, Selector: mg.Spec.ForProvider.ProjectSelector, To: reference.To{ - List: &v1beta11.ProjectList{}, - Managed: &v1beta11.Project{}, + List: &v1beta1.ProjectList{}, + Managed: &v1beta1.Project{}, }, }) if err != nil { diff --git a/apis/logging/v1beta1/zz_generated_terraformed.go b/apis/logging/v1beta1/zz_generated_terraformed.go index 358398a39..49747bbf8 100755 --- a/apis/logging/v1beta1/zz_generated_terraformed.go +++ b/apis/logging/v1beta1/zz_generated_terraformed.go @@ -29,6 +29,258 @@ import ( "github.com/crossplane/upjet/pkg/resource/json" ) +// GetTerraformResourceType returns Terraform resource type for this FolderBucketConfig +func (mg *FolderBucketConfig) GetTerraformResourceType() string { + return "google_logging_folder_bucket_config" +} + +// GetConnectionDetailsMapping for this FolderBucketConfig +func (tr *FolderBucketConfig) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this FolderBucketConfig +func (tr *FolderBucketConfig) 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 FolderBucketConfig +func (tr *FolderBucketConfig) 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 FolderBucketConfig +func (tr *FolderBucketConfig) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this FolderBucketConfig +func (tr *FolderBucketConfig) 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 FolderBucketConfig +func (tr *FolderBucketConfig) 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 FolderBucketConfig +func (tr *FolderBucketConfig) 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) +} + +// LateInitialize this FolderBucketConfig using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *FolderBucketConfig) LateInitialize(attrs []byte) (bool, error) { + params := &FolderBucketConfigParameters{} + 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 *FolderBucketConfig) GetTerraformSchemaVersion() int { + return 0 +} + +// GetTerraformResourceType returns Terraform resource type for this FolderExclusion +func (mg *FolderExclusion) GetTerraformResourceType() string { + return "google_logging_folder_exclusion" +} + +// GetConnectionDetailsMapping for this FolderExclusion +func (tr *FolderExclusion) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this FolderExclusion +func (tr *FolderExclusion) 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 FolderExclusion +func (tr *FolderExclusion) 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 FolderExclusion +func (tr *FolderExclusion) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this FolderExclusion +func (tr *FolderExclusion) 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 FolderExclusion +func (tr *FolderExclusion) 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 FolderExclusion +func (tr *FolderExclusion) 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) +} + +// LateInitialize this FolderExclusion using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *FolderExclusion) LateInitialize(attrs []byte) (bool, error) { + params := &FolderExclusionParameters{} + 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 *FolderExclusion) GetTerraformSchemaVersion() int { + return 0 +} + +// GetTerraformResourceType returns Terraform resource type for this FolderSink +func (mg *FolderSink) GetTerraformResourceType() string { + return "google_logging_folder_sink" +} + +// GetConnectionDetailsMapping for this FolderSink +func (tr *FolderSink) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this FolderSink +func (tr *FolderSink) 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 FolderSink +func (tr *FolderSink) 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 FolderSink +func (tr *FolderSink) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this FolderSink +func (tr *FolderSink) 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 FolderSink +func (tr *FolderSink) 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 FolderSink +func (tr *FolderSink) 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) +} + +// LateInitialize this FolderSink using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *FolderSink) LateInitialize(attrs []byte) (bool, error) { + params := &FolderSinkParameters{} + 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 *FolderSink) GetTerraformSchemaVersion() int { + return 0 +} + // GetTerraformResourceType returns Terraform resource type for this LogView func (mg *LogView) GetTerraformResourceType() string { return "google_logging_log_view" diff --git a/apis/logging/v1beta1/zz_projectbucketconfig_types.go b/apis/logging/v1beta1/zz_projectbucketconfig_types.go index f62348aa8..03c2284fe 100755 --- a/apis/logging/v1beta1/zz_projectbucketconfig_types.go +++ b/apis/logging/v1beta1/zz_projectbucketconfig_types.go @@ -29,10 +29,10 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) -type CmekSettingsInitParameters struct { +type ProjectBucketConfigCmekSettingsInitParameters struct { } -type CmekSettingsObservation struct { +type ProjectBucketConfigCmekSettingsObservation struct { // The resource name for the configured Cloud KMS key. // KMS key name format: @@ -59,7 +59,7 @@ type CmekSettingsObservation struct { ServiceAccountID *string `json:"serviceAccountId,omitempty" tf:"service_account_id,omitempty"` } -type CmekSettingsParameters struct { +type ProjectBucketConfigCmekSettingsParameters struct { // The resource name for the configured Cloud KMS key. // KMS key name format: @@ -84,7 +84,7 @@ type CmekSettingsParameters struct { type ProjectBucketConfigInitParameters struct { // The CMEK settings of the log bucket. If present, new log entries written to this log bucket are encrypted using the CMEK key provided in this configuration. If a log bucket has CMEK settings, the CMEK settings cannot be disabled later by updating the log bucket. Changing the KMS key is allowed. Structure is documented below. - CmekSettings []CmekSettingsInitParameters `json:"cmekSettings,omitempty" tf:"cmek_settings,omitempty"` + CmekSettings []ProjectBucketConfigCmekSettingsInitParameters `json:"cmekSettings,omitempty" tf:"cmek_settings,omitempty"` // Describes this bucket. Description *string `json:"description,omitempty" tf:"description,omitempty"` @@ -105,7 +105,7 @@ type ProjectBucketConfigObservation struct { BucketID *string `json:"bucketId,omitempty" tf:"bucket_id,omitempty"` // The CMEK settings of the log bucket. If present, new log entries written to this log bucket are encrypted using the CMEK key provided in this configuration. If a log bucket has CMEK settings, the CMEK settings cannot be disabled later by updating the log bucket. Changing the KMS key is allowed. Structure is documented below. - CmekSettings []CmekSettingsObservation `json:"cmekSettings,omitempty" tf:"cmek_settings,omitempty"` + CmekSettings []ProjectBucketConfigCmekSettingsObservation `json:"cmekSettings,omitempty" tf:"cmek_settings,omitempty"` // Describes this bucket. Description *string `json:"description,omitempty" tf:"description,omitempty"` @@ -143,7 +143,7 @@ type ProjectBucketConfigParameters struct { // The CMEK settings of the log bucket. If present, new log entries written to this log bucket are encrypted using the CMEK key provided in this configuration. If a log bucket has CMEK settings, the CMEK settings cannot be disabled later by updating the log bucket. Changing the KMS key is allowed. Structure is documented below. // +kubebuilder:validation:Optional - CmekSettings []CmekSettingsParameters `json:"cmekSettings,omitempty" tf:"cmek_settings,omitempty"` + CmekSettings []ProjectBucketConfigCmekSettingsParameters `json:"cmekSettings,omitempty" tf:"cmek_settings,omitempty"` // Describes this bucket. // +kubebuilder:validation:Optional diff --git a/apis/logging/v1beta1/zz_projectsink_types.go b/apis/logging/v1beta1/zz_projectsink_types.go index 80748cefa..9b81db44d 100755 --- a/apis/logging/v1beta1/zz_projectsink_types.go +++ b/apis/logging/v1beta1/zz_projectsink_types.go @@ -29,7 +29,7 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) -type BigqueryOptionsInitParameters struct { +type ProjectSinkBigqueryOptionsInitParameters struct { // Whether to use BigQuery's partition tables. // By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned @@ -38,7 +38,7 @@ type BigqueryOptionsInitParameters struct { UsePartitionedTables *bool `json:"usePartitionedTables,omitempty" tf:"use_partitioned_tables,omitempty"` } -type BigqueryOptionsObservation struct { +type ProjectSinkBigqueryOptionsObservation struct { // Whether to use BigQuery's partition tables. // By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned @@ -47,7 +47,7 @@ type BigqueryOptionsObservation struct { UsePartitionedTables *bool `json:"usePartitionedTables,omitempty" tf:"use_partitioned_tables,omitempty"` } -type BigqueryOptionsParameters struct { +type ProjectSinkBigqueryOptionsParameters struct { // Whether to use BigQuery's partition tables. // By default, Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned @@ -57,7 +57,7 @@ type BigqueryOptionsParameters struct { UsePartitionedTables *bool `json:"usePartitionedTables" tf:"use_partitioned_tables,omitempty"` } -type ExclusionsInitParameters struct { +type ProjectSinkExclusionsInitParameters struct { // A description of this exclusion. Description *string `json:"description,omitempty" tf:"description,omitempty"` @@ -73,7 +73,7 @@ type ExclusionsInitParameters struct { Name *string `json:"name,omitempty" tf:"name,omitempty"` } -type ExclusionsObservation struct { +type ProjectSinkExclusionsObservation struct { // A description of this exclusion. Description *string `json:"description,omitempty" tf:"description,omitempty"` @@ -89,7 +89,7 @@ type ExclusionsObservation struct { Name *string `json:"name,omitempty" tf:"name,omitempty"` } -type ExclusionsParameters struct { +type ProjectSinkExclusionsParameters struct { // A description of this exclusion. // +kubebuilder:validation:Optional @@ -112,7 +112,7 @@ type ExclusionsParameters struct { type ProjectSinkInitParameters struct { // Options that affect sinks exporting data to BigQuery. Structure documented below. - BigqueryOptions []BigqueryOptionsInitParameters `json:"bigqueryOptions,omitempty" tf:"bigquery_options,omitempty"` + BigqueryOptions []ProjectSinkBigqueryOptionsInitParameters `json:"bigqueryOptions,omitempty" tf:"bigquery_options,omitempty"` // A description of this sink. The maximum length of the description is 8000 characters. Description *string `json:"description,omitempty" tf:"description,omitempty"` @@ -125,7 +125,7 @@ type ProjectSinkInitParameters struct { Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` // Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below. - Exclusions []ExclusionsInitParameters `json:"exclusions,omitempty" tf:"exclusions,omitempty"` + Exclusions []ProjectSinkExclusionsInitParameters `json:"exclusions,omitempty" tf:"exclusions,omitempty"` // The filter to apply when exporting logs. Only log entries that match the filter are exported. // See Advanced Log Filters for information on how to @@ -146,7 +146,7 @@ type ProjectSinkInitParameters struct { type ProjectSinkObservation struct { // Options that affect sinks exporting data to BigQuery. Structure documented below. - BigqueryOptions []BigqueryOptionsObservation `json:"bigqueryOptions,omitempty" tf:"bigquery_options,omitempty"` + BigqueryOptions []ProjectSinkBigqueryOptionsObservation `json:"bigqueryOptions,omitempty" tf:"bigquery_options,omitempty"` // A description of this sink. The maximum length of the description is 8000 characters. Description *string `json:"description,omitempty" tf:"description,omitempty"` @@ -159,7 +159,7 @@ type ProjectSinkObservation struct { Disabled *bool `json:"disabled,omitempty" tf:"disabled,omitempty"` // Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below. - Exclusions []ExclusionsObservation `json:"exclusions,omitempty" tf:"exclusions,omitempty"` + Exclusions []ProjectSinkExclusionsObservation `json:"exclusions,omitempty" tf:"exclusions,omitempty"` // The filter to apply when exporting logs. Only log entries that match the filter are exported. // See Advanced Log Filters for information on how to @@ -188,7 +188,7 @@ type ProjectSinkParameters struct { // Options that affect sinks exporting data to BigQuery. Structure documented below. // +kubebuilder:validation:Optional - BigqueryOptions []BigqueryOptionsParameters `json:"bigqueryOptions,omitempty" tf:"bigquery_options,omitempty"` + BigqueryOptions []ProjectSinkBigqueryOptionsParameters `json:"bigqueryOptions,omitempty" tf:"bigquery_options,omitempty"` // A description of this sink. The maximum length of the description is 8000 characters. // +kubebuilder:validation:Optional @@ -205,7 +205,7 @@ type ProjectSinkParameters struct { // Log entries that match any of the exclusion filters will not be exported. If a log entry is matched by both filter and one of exclusions.filter, it will not be exported. Can be repeated multiple times for multiple exclusions. Structure is documented below. // +kubebuilder:validation:Optional - Exclusions []ExclusionsParameters `json:"exclusions,omitempty" tf:"exclusions,omitempty"` + Exclusions []ProjectSinkExclusionsParameters `json:"exclusions,omitempty" tf:"exclusions,omitempty"` // The filter to apply when exporting logs. Only log entries that match the filter are exported. // See Advanced Log Filters for information on how to diff --git a/build b/build index 2672eeb76..a6e25afa0 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 2672eeb767636ec837aa7c63cd7e26e6089fa810 +Subproject commit a6e25afa0d43da62b11af96a5d29627a52f32cd9 diff --git a/config/common/config.go b/config/common/config.go index 9c7dc778a..e0524074e 100644 --- a/config/common/config.go +++ b/config/common/config.go @@ -21,6 +21,7 @@ const ( // ExtractResourceIDFuncPath holds the GCP resource ID extractor func name ExtractResourceIDFuncPath = "github.com/upbound/provider-gcp/config/common.ExtractResourceID()" ExtractProjectIDFuncPath = "github.com/upbound/provider-gcp/config/common.ExtractProjectID()" + ExtractFolderIDFuncPath = "github.com/upbound/provider-gcp/config/common.ExtractFolderID()" ) var ( @@ -85,3 +86,13 @@ func ExtractProjectID() reference.ExtractValueFn { return strings.TrimPrefix(tr.GetID(), "projects/") } } + +func ExtractFolderID() reference.ExtractValueFn { + return func(mr resource.Managed) string { + tr, ok := mr.(jresource.Terraformed) + if !ok { + return "" + } + return strings.TrimPrefix(tr.GetID(), "folders/") + } +} diff --git a/config/externalname.go b/config/externalname.go index e2c1a1204..37e11cca8 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -912,6 +912,13 @@ var externalNameConfigs = map[string]config.ExternalName{ // Project-level logging sinks can be imported using their URI // projects/my-project/sinks/my-sink "google_logging_project_sink": config.TemplatedStringAsIdentifier("name", "projects/{{ if .parameters.project }}{{ .parameters.project }}{{ else }}{{ .setup.configuration.project }}{{ end }}/sinks/{{ .external_name }}"), + // This resource can be imported using the following format: folders/{{folder}}/locations/{{location}}/buckets/{{bucket_id}} + "google_logging_folder_bucket_config": config.TemplatedStringAsIdentifier("", "folders/{{ .parameters.folder }}/locations/{{ .parameters.location }}/buckets/{{ .parameters.bucket_id }}"), + // Folder-level logging exclusions can be imported using their URI + // folders/my-folder/exclusions/my-exclusion + "google_logging_folder_exclusion": config.TemplatedStringAsIdentifier("name", "folders/{{ .parameters.folder }}/exclusions/{{ .external_name }}"), + // Folder-level logging sinks can be imported using this format: folders/{{folder_id}}/sinks/{{name}} + "google_logging_folder_sink": config.TemplatedStringAsIdentifier("name", "folders/{{ .parameters.folder }}/sinks/{{ .external_name }}"), // vertexai // diff --git a/config/externalnamenottested.go b/config/externalnamenottested.go index 2c591f58f..672e6a638 100644 --- a/config/externalnamenottested.go +++ b/config/externalnamenottested.go @@ -206,13 +206,6 @@ var ExternalNameNotTestedConfigs = map[string]config.ExternalName{ "google_logging_billing_account_exclusion": config.TemplatedStringAsIdentifier("name", "billingAccounts/{{ .parameters.billing_account }}/exclusions/{{ .external_name }}"), // Billing account logging sinks can be imported using this format: billingAccounts/{{billing_account_id}}/sinks/{{sink_id}} "google_logging_billing_account_sink": config.IdentifierFromProvider, - // This resource can be imported using the following format: folders/{{folder}}/locations/{{location}}/buckets/{{bucket_id}} - "google_logging_folder_bucket_config": config.TemplatedStringAsIdentifier("", "folders/{{ .parameters.folder }}/locations/{{ .parameters.location }}/buckets/{{ .parameters.bucket_id }}"), - // Folder-level logging exclusions can be imported using their URI - // folders/my-folder/exclusions/my-exclusion - "google_logging_folder_exclusion": config.TemplatedStringAsIdentifier("name", "folders/{{ .parameters.folder }}/exclusions/{{ .external_name }}"), - // Folder-level logging sinks can be imported using this format: folders/{{folder_id}}/sinks/{{name}} - "google_logging_folder_sink": config.TemplatedStringAsIdentifier("name", "folders/{{ .parameters.folder }}/sinks/{{ .external_name }}"), // This resource can be imported using the following format: organizations/{{organization}}/locations/{{location}}/buckets/{{bucket_id}} "google_logging_organization_bucket_config": config.TemplatedStringAsIdentifier("", "organizations/{{ .parameters.organization }}/locations/{{ .parameters.location }}/buckets/{{ .parameters.bucket_id }}"), // Organization-level logging exclusions can be imported using their URI diff --git a/config/generated.lst b/config/generated.lst index c78d43c43..941996cb9 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_envgroup","google_apigee_environment","google_apigee_environment_iam_member","google_apigee_instance","google_apigee_nat_address","google_apigee_organization","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_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_cloudiot_device","google_cloudiot_registry","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_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_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_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_tag","google_data_catalog_tag_template","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_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_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_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_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_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_notification","google_storage_object_access_control","google_storage_object_acl","google_storage_transfer_agent_pool","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_envgroup","google_apigee_environment","google_apigee_environment_iam_member","google_apigee_instance","google_apigee_nat_address","google_apigee_organization","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_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_cloudiot_device","google_cloudiot_registry","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_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_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_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_tag","google_data_catalog_tag_template","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_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_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_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_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_notification","google_storage_object_access_control","google_storage_object_acl","google_storage_transfer_agent_pool","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/config/logging/config.go b/config/logging/config.go new file mode 100644 index 000000000..a98a7db33 --- /dev/null +++ b/config/logging/config.go @@ -0,0 +1,18 @@ +package logging + +import ( + "github.com/crossplane/upjet/pkg/config" + + "github.com/upbound/provider-gcp/config/common" +) + +// Configure configures individual resources by adding custom +// ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("google_logging_folder_bucket_config", func(r *config.Resource) { + r.References["folder"] = config.Reference{ + Type: "github.com/upbound/provider-gcp/apis/cloudplatform/v1beta1.Folder", + Extractor: common.ExtractFolderIDFuncPath, + } + }) +} diff --git a/config/provider.go b/config/provider.go index bfe8e8703..ea4b9103d 100644 --- a/config/provider.go +++ b/config/provider.go @@ -49,6 +49,7 @@ import ( "github.com/upbound/provider-gcp/config/iap" "github.com/upbound/provider-gcp/config/identityplatform" "github.com/upbound/provider-gcp/config/kms" + "github.com/upbound/provider-gcp/config/logging" "github.com/upbound/provider-gcp/config/monitoring" "github.com/upbound/provider-gcp/config/notebooks" "github.com/upbound/provider-gcp/config/oslogin" @@ -178,6 +179,7 @@ func GetProvider() *tjconfig.Provider { gameservices.Configure, iap.Configure, identityplatform.Configure, + logging.Configure, kms.Configure, notebooks.Configure, privateca.Configure, diff --git a/examples-generated/logging/folderbucketconfig.yaml b/examples-generated/logging/folderbucketconfig.yaml new file mode 100644 index 000000000..09e09682e --- /dev/null +++ b/examples-generated/logging/folderbucketconfig.yaml @@ -0,0 +1,33 @@ +apiVersion: logging.gcp.upbound.io/v1beta1 +kind: FolderBucketConfig +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/folderbucketconfig + labels: + testing.upbound.io/example-name: basic + name: basic +spec: + forProvider: + bucketId: _Default + folderSelector: + matchLabels: + testing.upbound.io/example-name: default + location: global + retentionDays: 30 + +--- + +apiVersion: cloudplatform.gcp.upbound.io/v1beta1 +kind: Folder +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/folderbucketconfig + labels: + testing.upbound.io/example-name: default + name: default +spec: + forProvider: + displayName: some-folder-name + parentSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/examples-generated/logging/folderexclusion.yaml b/examples-generated/logging/folderexclusion.yaml new file mode 100644 index 000000000..b26372d49 --- /dev/null +++ b/examples-generated/logging/folderexclusion.yaml @@ -0,0 +1,32 @@ +apiVersion: logging.gcp.upbound.io/v1beta1 +kind: FolderExclusion +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/folderexclusion + labels: + testing.upbound.io/example-name: my-exclusion + name: my-exclusion +spec: + forProvider: + description: Exclude GCE instance debug logs + filter: resource.type = gce_instance AND severity <= DEBUG + folderSelector: + matchLabels: + testing.upbound.io/example-name: my-folder + +--- + +apiVersion: cloudplatform.gcp.upbound.io/v1beta1 +kind: Folder +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/folderexclusion + labels: + testing.upbound.io/example-name: my-folder + name: my-folder +spec: + forProvider: + displayName: My folder + parentSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/examples-generated/logging/foldersink.yaml b/examples-generated/logging/foldersink.yaml new file mode 100644 index 000000000..2e5ea28af --- /dev/null +++ b/examples-generated/logging/foldersink.yaml @@ -0,0 +1,47 @@ +apiVersion: logging.gcp.upbound.io/v1beta1 +kind: FolderSink +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/foldersink + labels: + testing.upbound.io/example-name: my-sink + name: my-sink +spec: + forProvider: + description: some explanation on what this is + destination: storage.googleapis.com/${google_storage_bucket.log-bucket.name} + filter: resource.type = gce_instance AND severity >= WARNING + folderSelector: + matchLabels: + testing.upbound.io/example-name: my-folder + +--- + +apiVersion: cloudplatform.gcp.upbound.io/v1beta1 +kind: Folder +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/foldersink + labels: + testing.upbound.io/example-name: my-folder + name: my-folder +spec: + forProvider: + displayName: My folder + parentSelector: + matchLabels: + testing.upbound.io/example-name: example + +--- + +apiVersion: storage.gcp.upbound.io/v1beta1 +kind: Bucket +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/foldersink + labels: + testing.upbound.io/example-name: log-bucket + name: log-bucket +spec: + forProvider: + location: US diff --git a/examples/logging/folderbucketconfig.yaml b/examples/logging/folderbucketconfig.yaml new file mode 100644 index 000000000..0fcc1bdab --- /dev/null +++ b/examples/logging/folderbucketconfig.yaml @@ -0,0 +1,32 @@ +apiVersion: logging.gcp.upbound.io/v1beta1 +kind: FolderBucketConfig +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/folderbucketconfig + upjet.upbound.io/manual-intervention: "This resource depends on Folder.cloudplatform with the required organization level IAM permissions" + labels: + testing.upbound.io/example-name: basic + name: basic +spec: + forProvider: + bucketId: _Default + folderSelector: + matchLabels: + testing.upbound.io/example-name: default + location: global + retentionDays: 30 + +--- +apiVersion: cloudplatform.gcp.upbound.io/v1beta1 +kind: Folder +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/folderbucketconfig + upjet.upbound.io/manual-intervention: "Requires organization level IAM permissions" + labels: + testing.upbound.io/example-name: default + name: default +spec: + forProvider: + displayName: some-folder-name + parent: organizations/{org_id} diff --git a/examples/logging/folderexclusion.yaml b/examples/logging/folderexclusion.yaml new file mode 100644 index 000000000..89b6012a8 --- /dev/null +++ b/examples/logging/folderexclusion.yaml @@ -0,0 +1,31 @@ +apiVersion: logging.gcp.upbound.io/v1beta1 +kind: FolderExclusion +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/folderexclusion + upjet.upbound.io/manual-intervention: "This resource depends on Folder.cloudplatform with the required organization level IAM permissions" + labels: + testing.upbound.io/example-name: my-exclusion + name: my-exclusion +spec: + forProvider: + description: Exclude GCE instance debug logs + filter: resource.type = gce_instance AND severity <= DEBUG + folderSelector: + matchLabels: + testing.upbound.io/example-name: my-folder + +--- +apiVersion: cloudplatform.gcp.upbound.io/v1beta1 +kind: Folder +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/folderexclusion + upjet.upbound.io/manual-intervention: "Requires organization level IAM permissions" + labels: + testing.upbound.io/example-name: my-folder + name: my-folder +spec: + forProvider: + displayName: My folder + parent: organizations/{org_id} diff --git a/examples/logging/foldersink.yaml b/examples/logging/foldersink.yaml new file mode 100644 index 000000000..f8451061e --- /dev/null +++ b/examples/logging/foldersink.yaml @@ -0,0 +1,46 @@ +apiVersion: logging.gcp.upbound.io/v1beta1 +kind: FolderSink +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/foldersink + upjet.upbound.io/manual-intervention: "This resource depends on Folder.cloudplatform with the required organization level IAM permissions" + labels: + testing.upbound.io/example-name: my-sink + name: my-sink +spec: + forProvider: + description: some explanation on what this is + destination: storage.googleapis.com/${google_storage_bucket.log-bucket.name} + filter: resource.type = gce_instance AND severity >= WARNING + folderSelector: + matchLabels: + testing.upbound.io/example-name: my-folder + +--- +apiVersion: cloudplatform.gcp.upbound.io/v1beta1 +kind: Folder +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/foldersink + upjet.upbound.io/manual-intervention: "Requires organization level IAM permissions" + labels: + testing.upbound.io/example-name: my-folder + name: my-folder +spec: + forProvider: + displayName: My folder + parent: organizations/{org_id} + +--- +apiVersion: storage.gcp.upbound.io/v1beta1 +kind: Bucket +metadata: + annotations: + meta.upbound.io/example-id: logging/v1beta1/foldersink + labels: + meta.upbound.io/example-id: logging/v1beta1/foldersink + upjet.upbound.io/manual-intervention: "This resource is the dependency of FolderSink.logging. This resource is skipping because parent resource was skipped." + name: log-bucket-${Rand.RFC1123Subdomain} +spec: + forProvider: + location: US diff --git a/internal/controller/logging/folderbucketconfig/zz_controller.go b/internal/controller/logging/folderbucketconfig/zz_controller.go new file mode 100755 index 000000000..445a1820f --- /dev/null +++ b/internal/controller/logging/folderbucketconfig/zz_controller.go @@ -0,0 +1,79 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package folderbucketconfig + +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" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/upbound/provider-gcp/apis/logging/v1beta1" + features "github.com/upbound/provider-gcp/internal/features" +) + +// Setup adds a controller that reconciles FolderBucketConfig managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.FolderBucketConfig_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))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FolderBucketConfig_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FolderBucketConfig_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["google_logging_folder_bucket_config"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, 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()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FolderBucketConfig_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1beta1.FolderBucketConfig{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/logging/folderexclusion/zz_controller.go b/internal/controller/logging/folderexclusion/zz_controller.go new file mode 100755 index 000000000..64bbaade1 --- /dev/null +++ b/internal/controller/logging/folderexclusion/zz_controller.go @@ -0,0 +1,79 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package folderexclusion + +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" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/upbound/provider-gcp/apis/logging/v1beta1" + features "github.com/upbound/provider-gcp/internal/features" +) + +// Setup adds a controller that reconciles FolderExclusion managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.FolderExclusion_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))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FolderExclusion_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FolderExclusion_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["google_logging_folder_exclusion"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, 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()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FolderExclusion_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1beta1.FolderExclusion{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/logging/foldersink/zz_controller.go b/internal/controller/logging/foldersink/zz_controller.go new file mode 100755 index 000000000..7b7d5cbe1 --- /dev/null +++ b/internal/controller/logging/foldersink/zz_controller.go @@ -0,0 +1,79 @@ +// SPDX-FileCopyrightText: 2023 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +/* +Copyright 2021 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package foldersink + +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" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1beta1 "github.com/upbound/provider-gcp/apis/logging/v1beta1" + features "github.com/upbound/provider-gcp/internal/features" +) + +// Setup adds a controller that reconciles FolderSink managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1beta1.FolderSink_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))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.FolderSink_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.FolderSink_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["google_logging_folder_sink"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, 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()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.FolderSink_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1beta1.FolderSink{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_logging_setup.go b/internal/controller/zz_logging_setup.go index cf3ca3f5e..a2f333303 100755 --- a/internal/controller/zz_logging_setup.go +++ b/internal/controller/zz_logging_setup.go @@ -9,6 +9,9 @@ import ( "github.com/crossplane/upjet/pkg/controller" + folderbucketconfig "github.com/upbound/provider-gcp/internal/controller/logging/folderbucketconfig" + folderexclusion "github.com/upbound/provider-gcp/internal/controller/logging/folderexclusion" + foldersink "github.com/upbound/provider-gcp/internal/controller/logging/foldersink" logview "github.com/upbound/provider-gcp/internal/controller/logging/logview" metric "github.com/upbound/provider-gcp/internal/controller/logging/metric" projectbucketconfig "github.com/upbound/provider-gcp/internal/controller/logging/projectbucketconfig" @@ -20,6 +23,9 @@ import ( // the supplied manager. func Setup_logging(mgr ctrl.Manager, o controller.Options) error { for _, setup := range []func(ctrl.Manager, controller.Options) error{ + folderbucketconfig.Setup, + folderexclusion.Setup, + foldersink.Setup, logview.Setup, metric.Setup, projectbucketconfig.Setup, diff --git a/internal/controller/zz_monolith_setup.go b/internal/controller/zz_monolith_setup.go index 801783188..2f46603da 100755 --- a/internal/controller/zz_monolith_setup.go +++ b/internal/controller/zz_monolith_setup.go @@ -274,6 +274,9 @@ import ( keyringiammember "github.com/upbound/provider-gcp/internal/controller/kms/keyringiammember" keyringimportjob "github.com/upbound/provider-gcp/internal/controller/kms/keyringimportjob" secretciphertext "github.com/upbound/provider-gcp/internal/controller/kms/secretciphertext" + folderbucketconfig "github.com/upbound/provider-gcp/internal/controller/logging/folderbucketconfig" + folderexclusion "github.com/upbound/provider-gcp/internal/controller/logging/folderexclusion" + foldersink "github.com/upbound/provider-gcp/internal/controller/logging/foldersink" logview "github.com/upbound/provider-gcp/internal/controller/logging/logview" metric "github.com/upbound/provider-gcp/internal/controller/logging/metric" projectbucketconfig "github.com/upbound/provider-gcp/internal/controller/logging/projectbucketconfig" @@ -621,6 +624,9 @@ func Setup_monolith(mgr ctrl.Manager, o controller.Options) error { keyringiammember.Setup, keyringimportjob.Setup, secretciphertext.Setup, + folderbucketconfig.Setup, + folderexclusion.Setup, + foldersink.Setup, logview.Setup, metric.Setup, projectbucketconfig.Setup, diff --git a/package/crds/logging.gcp.upbound.io_folderbucketconfigs.yaml b/package/crds/logging.gcp.upbound.io_folderbucketconfigs.yaml new file mode 100644 index 000000000..4c5c4e66a --- /dev/null +++ b/package/crds/logging.gcp.upbound.io_folderbucketconfigs.yaml @@ -0,0 +1,473 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: folderbucketconfigs.logging.gcp.upbound.io +spec: + group: logging.gcp.upbound.io + names: + categories: + - crossplane + - managed + - gcp + kind: FolderBucketConfig + listKind: FolderBucketConfigList + plural: folderbucketconfigs + singular: folderbucketconfig + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + 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: FolderBucketConfig is the Schema for the FolderBucketConfigs + API. Manages a folder-level logging bucket config. + 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: FolderBucketConfigSpec defines the desired state of FolderBucketConfig + 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: + bucketId: + description: 'The name of the logging bucket. Logging automatically + creates two log buckets: _Required and _Default.' + type: string + cmekSettings: + items: + properties: + kmsKeyName: + description: 'The resource name of the bucket. For example: + "folders/my-folder-id/locations/my-location/buckets/my-bucket-id"' + type: string + type: object + type: array + description: + description: Describes this bucket. + type: string + folder: + description: The parent resource that contains the logging bucket. + type: string + folderRef: + description: Reference to a Folder in cloudplatform to populate + folder. + 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 + folderSelector: + description: Selector for a Folder in cloudplatform to populate + folder. + 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 + location: + description: The location of the bucket. + type: string + retentionDays: + description: Logs will be retained by default for this amount + of time, after which they will automatically be deleted. The + minimum retention period is 1 day. If this value is set to zero + at bucket creation time, the default time of 30 days will be + used. Bucket retention can not be increased on buckets outside + of projects. + type: number + required: + - bucketId + - location + 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: + cmekSettings: + items: + properties: + kmsKeyName: + description: 'The resource name of the bucket. For example: + "folders/my-folder-id/locations/my-location/buckets/my-bucket-id"' + type: string + type: object + type: array + description: + description: Describes this bucket. + type: string + retentionDays: + description: Logs will be retained by default for this amount + of time, after which they will automatically be deleted. The + minimum retention period is 1 day. If this value is set to zero + at bucket creation time, the default time of 30 days will be + used. Bucket retention can not be increased on buckets outside + of projects. + type: number + 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: FolderBucketConfigStatus defines the observed state of FolderBucketConfig. + properties: + atProvider: + properties: + bucketId: + description: 'The name of the logging bucket. Logging automatically + creates two log buckets: _Required and _Default.' + type: string + cmekSettings: + items: + properties: + kmsKeyName: + description: 'The resource name of the bucket. For example: + "folders/my-folder-id/locations/my-location/buckets/my-bucket-id"' + type: string + kmsKeyVersionName: + description: 'The resource name of the bucket. For example: + "folders/my-folder-id/locations/my-location/buckets/my-bucket-id"' + type: string + name: + description: 'The resource name of the bucket. For example: + "folders/my-folder-id/locations/my-location/buckets/my-bucket-id"' + type: string + serviceAccountId: + description: an identifier for the resource with format + folders/{{folder}}/locations/{{location}}/buckets/{{bucket_id}} + type: string + type: object + type: array + description: + description: Describes this bucket. + type: string + folder: + description: The parent resource that contains the logging bucket. + type: string + id: + description: an identifier for the resource with format folders/{{folder}}/locations/{{location}}/buckets/{{bucket_id}} + type: string + lifecycleState: + description: The bucket's lifecycle such as active or deleted. + See LifecycleState. + type: string + location: + description: The location of the bucket. + type: string + name: + description: 'The resource name of the bucket. For example: "folders/my-folder-id/locations/my-location/buckets/my-bucket-id"' + type: string + retentionDays: + description: Logs will be retained by default for this amount + of time, after which they will automatically be deleted. The + minimum retention period is 1 day. If this value is set to zero + at bucket creation time, the default time of 30 days will be + used. Bucket retention can not be increased on buckets outside + of projects. + type: number + 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 + 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 + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/logging.gcp.upbound.io_folderexclusions.yaml b/package/crds/logging.gcp.upbound.io_folderexclusions.yaml new file mode 100644 index 000000000..d2ad83a4f --- /dev/null +++ b/package/crds/logging.gcp.upbound.io_folderexclusions.yaml @@ -0,0 +1,420 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: folderexclusions.logging.gcp.upbound.io +spec: + group: logging.gcp.upbound.io + names: + categories: + - crossplane + - managed + - gcp + kind: FolderExclusion + listKind: FolderExclusionList + plural: folderexclusions + singular: folderexclusion + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + 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: FolderExclusion is the Schema for the FolderExclusions API. Manages + a folder-level logging exclusion. + 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: FolderExclusionSpec defines the desired state of FolderExclusion + 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: + description: + description: A human-readable description. + type: string + disabled: + description: Whether this exclusion rule should be disabled or + not. This defaults to false. + type: boolean + filter: + description: The filter to apply when excluding logs. Only log + entries that match the filter are excluded. See Advanced Log + Filters for information on how to write a filter. + type: string + folder: + description: The folder to be exported to the sink. Note that + either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted. + type: string + folderRef: + description: Reference to a Folder in cloudplatform to populate + folder. + 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 + folderSelector: + description: Selector for a Folder in cloudplatform to populate + folder. + 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 + 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: + description: + description: A human-readable description. + type: string + disabled: + description: Whether this exclusion rule should be disabled or + not. This defaults to false. + type: boolean + filter: + description: The filter to apply when excluding logs. Only log + entries that match the filter are excluded. See Advanced Log + Filters for information on how to write a filter. + 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 + x-kubernetes-validations: + - message: spec.forProvider.filter is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.filter) + || (has(self.initProvider) && has(self.initProvider.filter))' + status: + description: FolderExclusionStatus defines the observed state of FolderExclusion. + properties: + atProvider: + properties: + description: + description: A human-readable description. + type: string + disabled: + description: Whether this exclusion rule should be disabled or + not. This defaults to false. + type: boolean + filter: + description: The filter to apply when excluding logs. Only log + entries that match the filter are excluded. See Advanced Log + Filters for information on how to write a filter. + type: string + folder: + description: The folder to be exported to the sink. Note that + either [FOLDER_ID] or "folders/[FOLDER_ID]" is accepted. + type: string + id: + description: an identifier for the resource with format folders/{{folder}}/exclusions/{{name}} + 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 + 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 + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/logging.gcp.upbound.io_foldersinks.yaml b/package/crds/logging.gcp.upbound.io_foldersinks.yaml new file mode 100644 index 000000000..a958cff70 --- /dev/null +++ b/package/crds/logging.gcp.upbound.io_foldersinks.yaml @@ -0,0 +1,598 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: foldersinks.logging.gcp.upbound.io +spec: + group: logging.gcp.upbound.io + names: + categories: + - crossplane + - managed + - gcp + kind: FolderSink + listKind: FolderSinkList + plural: foldersinks + singular: foldersink + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + 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: FolderSink is the Schema for the FolderSinks API. Manages a folder-level + logging sink. + 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: FolderSinkSpec defines the desired state of FolderSink + 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: + bigqueryOptions: + description: Options that affect sinks exporting data to BigQuery. + Structure documented below. + items: + properties: + usePartitionedTables: + description: Whether to use BigQuery's partition tables. + By default, Logging creates dated tables based on the + log entries' timestamps, e.g. syslog_20170523. With partitioned + tables, the date suffix is no longer present and special + query syntax has to be used instead. In both cases, tables + are sharded based on UTC timezone. + type: boolean + type: object + type: array + description: + description: A description of this sink. The maximum length of + the description is 8000 characters. + type: string + destination: + description: 'The destination of the sink (or, in other words, + where logs are written to). Can be a Cloud Storage bucket, a + PubSub topic, a BigQuery dataset or a Cloud Logging bucket. + Examples:' + type: string + disabled: + description: If set to True, then this sink is disabled and it + does not export any log entries. + type: boolean + exclusions: + description: Log entries that match any of the exclusion filters + will not be exported. If a log entry is matched by both filter + and one of exclusions.filter, it will not be exported. Can + be repeated multiple times for multiple exclusions. Structure + is documented below. + items: + properties: + description: + description: A description of this exclusion. + type: string + disabled: + description: If set to True, then this exclusion is disabled + and it does not exclude any log entries. + type: boolean + filter: + description: An advanced logs filter that matches the log + entries to be excluded. By using the sample function, + you can exclude less than 100% of the matching log entries. + See Advanced Log Filters for information on how to write + a filter. + type: string + name: + description: A client-assigned identifier, such as load-balancer-exclusion. + Identifiers are limited to 100 characters and can include + only letters, digits, underscores, hyphens, and periods. + First character has to be alphanumeric. + type: string + type: object + type: array + filter: + description: The filter to apply when exporting logs. Only log + entries that match the filter are exported. See Advanced Log + Filters for information on how to write a filter. + type: string + folder: + description: The folder to be exported to the sink. Note that + either [FOLDER_ID] or folders/[FOLDER_ID] is accepted. + type: string + folderRef: + description: Reference to a Folder in cloudplatform to populate + folder. + 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 + folderSelector: + description: Selector for a Folder in cloudplatform to populate + folder. + 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 + includeChildren: + description: Whether or not to include children folders in the + sink export. If true, logs associated with child projects are + also exported; otherwise only logs relating to the provided + folder are included. + type: boolean + 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: + bigqueryOptions: + description: Options that affect sinks exporting data to BigQuery. + Structure documented below. + items: + properties: + usePartitionedTables: + description: Whether to use BigQuery's partition tables. + By default, Logging creates dated tables based on the + log entries' timestamps, e.g. syslog_20170523. With partitioned + tables, the date suffix is no longer present and special + query syntax has to be used instead. In both cases, tables + are sharded based on UTC timezone. + type: boolean + type: object + type: array + description: + description: A description of this sink. The maximum length of + the description is 8000 characters. + type: string + destination: + description: 'The destination of the sink (or, in other words, + where logs are written to). Can be a Cloud Storage bucket, a + PubSub topic, a BigQuery dataset or a Cloud Logging bucket. + Examples:' + type: string + disabled: + description: If set to True, then this sink is disabled and it + does not export any log entries. + type: boolean + exclusions: + description: Log entries that match any of the exclusion filters + will not be exported. If a log entry is matched by both filter + and one of exclusions.filter, it will not be exported. Can + be repeated multiple times for multiple exclusions. Structure + is documented below. + items: + properties: + description: + description: A description of this exclusion. + type: string + disabled: + description: If set to True, then this exclusion is disabled + and it does not exclude any log entries. + type: boolean + filter: + description: An advanced logs filter that matches the log + entries to be excluded. By using the sample function, + you can exclude less than 100% of the matching log entries. + See Advanced Log Filters for information on how to write + a filter. + type: string + name: + description: A client-assigned identifier, such as load-balancer-exclusion. + Identifiers are limited to 100 characters and can include + only letters, digits, underscores, hyphens, and periods. + First character has to be alphanumeric. + type: string + type: object + type: array + filter: + description: The filter to apply when exporting logs. Only log + entries that match the filter are exported. See Advanced Log + Filters for information on how to write a filter. + type: string + includeChildren: + description: Whether or not to include children folders in the + sink export. If true, logs associated with child projects are + also exported; otherwise only logs relating to the provided + folder are included. + type: boolean + 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 + x-kubernetes-validations: + - message: spec.forProvider.destination is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.destination) + || (has(self.initProvider) && has(self.initProvider.destination))' + status: + description: FolderSinkStatus defines the observed state of FolderSink. + properties: + atProvider: + properties: + bigqueryOptions: + description: Options that affect sinks exporting data to BigQuery. + Structure documented below. + items: + properties: + usePartitionedTables: + description: Whether to use BigQuery's partition tables. + By default, Logging creates dated tables based on the + log entries' timestamps, e.g. syslog_20170523. With partitioned + tables, the date suffix is no longer present and special + query syntax has to be used instead. In both cases, tables + are sharded based on UTC timezone. + type: boolean + type: object + type: array + description: + description: A description of this sink. The maximum length of + the description is 8000 characters. + type: string + destination: + description: 'The destination of the sink (or, in other words, + where logs are written to). Can be a Cloud Storage bucket, a + PubSub topic, a BigQuery dataset or a Cloud Logging bucket. + Examples:' + type: string + disabled: + description: If set to True, then this sink is disabled and it + does not export any log entries. + type: boolean + exclusions: + description: Log entries that match any of the exclusion filters + will not be exported. If a log entry is matched by both filter + and one of exclusions.filter, it will not be exported. Can + be repeated multiple times for multiple exclusions. Structure + is documented below. + items: + properties: + description: + description: A description of this exclusion. + type: string + disabled: + description: If set to True, then this exclusion is disabled + and it does not exclude any log entries. + type: boolean + filter: + description: An advanced logs filter that matches the log + entries to be excluded. By using the sample function, + you can exclude less than 100% of the matching log entries. + See Advanced Log Filters for information on how to write + a filter. + type: string + name: + description: A client-assigned identifier, such as load-balancer-exclusion. + Identifiers are limited to 100 characters and can include + only letters, digits, underscores, hyphens, and periods. + First character has to be alphanumeric. + type: string + type: object + type: array + filter: + description: The filter to apply when exporting logs. Only log + entries that match the filter are exported. See Advanced Log + Filters for information on how to write a filter. + type: string + folder: + description: The folder to be exported to the sink. Note that + either [FOLDER_ID] or folders/[FOLDER_ID] is accepted. + type: string + id: + description: an identifier for the resource with format folders/{{folder_id}}/sinks/{{name}} + type: string + includeChildren: + description: Whether or not to include children folders in the + sink export. If true, logs associated with child projects are + also exported; otherwise only logs relating to the provided + folder are included. + type: boolean + writerIdentity: + description: The identity associated with this sink. This identity + must be granted write access to the configured destination. + 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 + 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 + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {}