From 9b5d17d2dff15e617ecfd416eb50937ab81a240a Mon Sep 17 00:00:00 2001 From: Jason Zhang Date: Wed, 25 Dec 2024 10:06:43 +0800 Subject: [PATCH 1/2] add nat resources --- apis/nat/v1alpha1/zz_dnatrule_terraformed.go | 141 + apis/nat/v1alpha1/zz_dnatrule_types.go | 377 +++ apis/nat/v1alpha1/zz_gateway_terraformed.go | 129 + apis/nat/v1alpha1/zz_gateway_types.go | 344 +++ .../v1alpha1/zz_generated.conversion_hubs.go | 28 + apis/nat/v1alpha1/zz_generated.deepcopy.go | 2476 +++++++++++++++++ apis/nat/v1alpha1/zz_generated.managed.go | 429 +++ apis/nat/v1alpha1/zz_generated.managedlist.go | 72 + apis/nat/v1alpha1/zz_generated.resolvers.go | 599 ++++ apis/nat/v1alpha1/zz_groupversion_info.go | 32 + .../zz_privatednatrule_terraformed.go | 135 + apis/nat/v1alpha1/zz_privatednatrule_types.go | 276 ++ .../v1alpha1/zz_privategateway_terraformed.go | 129 + apis/nat/v1alpha1/zz_privategateway_types.go | 242 ++ .../zz_privatesnatrule_terraformed.go | 135 + apis/nat/v1alpha1/zz_privatesnatrule_types.go | 259 ++ .../zz_privatetransitip_terraformed.go | 129 + .../nat/v1alpha1/zz_privatetransitip_types.go | 203 ++ apis/nat/v1alpha1/zz_snatrule_terraformed.go | 138 + apis/nat/v1alpha1/zz_snatrule_types.go | 320 +++ apis/zz_register.go | 2 + config/external_name.go | 9 + config/nat/config.go | 136 + config/provider.go | 2 + examples-generated/nat/v1alpha1/dnatrule.yaml | 33 + examples-generated/nat/v1alpha1/gateway.yaml | 19 + .../nat/v1alpha1/privatednatrule.yaml | 33 + .../nat/v1alpha1/privategateway.yaml | 17 + .../nat/v1alpha1/privatesnatrule.yaml | 19 + .../nat/v1alpha1/privatetransitip.yaml | 17 + examples-generated/nat/v1alpha1/snatrule.yaml | 19 + .../controller/nat/dnatrule/zz_controller.go | 87 + .../controller/nat/gateway/zz_controller.go | 87 + .../nat/privatednatrule/zz_controller.go | 87 + .../nat/privategateway/zz_controller.go | 87 + .../nat/privatesnatrule/zz_controller.go | 87 + .../nat/privatetransitip/zz_controller.go | 87 + .../controller/nat/snatrule/zz_controller.go | 87 + internal/controller/zz_setup.go | 14 + ...t.huaweicloud.crossplane.io_dnatrules.yaml | 1032 +++++++ ...at.huaweicloud.crossplane.io_gateways.yaml | 879 ++++++ ...icloud.crossplane.io_privatednatrules.yaml | 801 ++++++ ...eicloud.crossplane.io_privategateways.yaml | 637 +++++ ...icloud.crossplane.io_privatesnatrules.yaml | 906 ++++++ ...cloud.crossplane.io_privatetransitips.yaml | 591 ++++ ...t.huaweicloud.crossplane.io_snatrules.yaml | 1089 ++++++++ 46 files changed, 13457 insertions(+) create mode 100755 apis/nat/v1alpha1/zz_dnatrule_terraformed.go create mode 100755 apis/nat/v1alpha1/zz_dnatrule_types.go create mode 100755 apis/nat/v1alpha1/zz_gateway_terraformed.go create mode 100755 apis/nat/v1alpha1/zz_gateway_types.go create mode 100755 apis/nat/v1alpha1/zz_generated.conversion_hubs.go create mode 100644 apis/nat/v1alpha1/zz_generated.deepcopy.go create mode 100644 apis/nat/v1alpha1/zz_generated.managed.go create mode 100644 apis/nat/v1alpha1/zz_generated.managedlist.go create mode 100644 apis/nat/v1alpha1/zz_generated.resolvers.go create mode 100755 apis/nat/v1alpha1/zz_groupversion_info.go create mode 100755 apis/nat/v1alpha1/zz_privatednatrule_terraformed.go create mode 100755 apis/nat/v1alpha1/zz_privatednatrule_types.go create mode 100755 apis/nat/v1alpha1/zz_privategateway_terraformed.go create mode 100755 apis/nat/v1alpha1/zz_privategateway_types.go create mode 100755 apis/nat/v1alpha1/zz_privatesnatrule_terraformed.go create mode 100755 apis/nat/v1alpha1/zz_privatesnatrule_types.go create mode 100755 apis/nat/v1alpha1/zz_privatetransitip_terraformed.go create mode 100755 apis/nat/v1alpha1/zz_privatetransitip_types.go create mode 100755 apis/nat/v1alpha1/zz_snatrule_terraformed.go create mode 100755 apis/nat/v1alpha1/zz_snatrule_types.go create mode 100644 config/nat/config.go create mode 100644 examples-generated/nat/v1alpha1/dnatrule.yaml create mode 100644 examples-generated/nat/v1alpha1/gateway.yaml create mode 100644 examples-generated/nat/v1alpha1/privatednatrule.yaml create mode 100644 examples-generated/nat/v1alpha1/privategateway.yaml create mode 100644 examples-generated/nat/v1alpha1/privatesnatrule.yaml create mode 100644 examples-generated/nat/v1alpha1/privatetransitip.yaml create mode 100644 examples-generated/nat/v1alpha1/snatrule.yaml create mode 100755 internal/controller/nat/dnatrule/zz_controller.go create mode 100755 internal/controller/nat/gateway/zz_controller.go create mode 100755 internal/controller/nat/privatednatrule/zz_controller.go create mode 100755 internal/controller/nat/privategateway/zz_controller.go create mode 100755 internal/controller/nat/privatesnatrule/zz_controller.go create mode 100755 internal/controller/nat/privatetransitip/zz_controller.go create mode 100755 internal/controller/nat/snatrule/zz_controller.go create mode 100644 package/crds/nat.huaweicloud.crossplane.io_dnatrules.yaml create mode 100644 package/crds/nat.huaweicloud.crossplane.io_gateways.yaml create mode 100644 package/crds/nat.huaweicloud.crossplane.io_privatednatrules.yaml create mode 100644 package/crds/nat.huaweicloud.crossplane.io_privategateways.yaml create mode 100644 package/crds/nat.huaweicloud.crossplane.io_privatesnatrules.yaml create mode 100644 package/crds/nat.huaweicloud.crossplane.io_privatetransitips.yaml create mode 100644 package/crds/nat.huaweicloud.crossplane.io_snatrules.yaml diff --git a/apis/nat/v1alpha1/zz_dnatrule_terraformed.go b/apis/nat/v1alpha1/zz_dnatrule_terraformed.go new file mode 100755 index 0000000..eb68f13 --- /dev/null +++ b/apis/nat/v1alpha1/zz_dnatrule_terraformed.go @@ -0,0 +1,141 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this DnatRule +func (mg *DnatRule) GetTerraformResourceType() string { + return "huaweicloud_nat_dnat_rule" +} + +// GetConnectionDetailsMapping for this DnatRule +func (tr *DnatRule) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this DnatRule +func (tr *DnatRule) 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 DnatRule +func (tr *DnatRule) 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 DnatRule +func (tr *DnatRule) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this DnatRule +func (tr *DnatRule) 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 DnatRule +func (tr *DnatRule) 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 DnatRule +func (tr *DnatRule) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this DnatRule +func (tr *DnatRule) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this DnatRule using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *DnatRule) LateInitialize(attrs []byte) (bool, error) { + params := &DnatRuleParameters{} + 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)} + initParams, err := tr.GetInitParameters() + if err != nil { + return false, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + opts = append(opts, resource.WithConditionalFilter("ExternalServicePort", initParams)) + opts = append(opts, resource.WithConditionalFilter("ExternalServicePortRange", initParams)) + opts = append(opts, resource.WithConditionalFilter("FloatingIPID", initParams)) + opts = append(opts, resource.WithConditionalFilter("GlobalEIPID", initParams)) + opts = append(opts, resource.WithConditionalFilter("InternalServicePort", initParams)) + opts = append(opts, resource.WithConditionalFilter("InternalServicePortRange", initParams)) + opts = append(opts, resource.WithConditionalFilter("PortID", initParams)) + opts = append(opts, resource.WithConditionalFilter("PrivateIP", initParams)) + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *DnatRule) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/nat/v1alpha1/zz_dnatrule_types.go b/apis/nat/v1alpha1/zz_dnatrule_types.go new file mode 100755 index 0000000..f518a52 --- /dev/null +++ b/apis/nat/v1alpha1/zz_dnatrule_types.go @@ -0,0 +1,377 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 DnatRuleInitParameters struct { + + // Specifies the description of the DNAT rule. + // The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + // The description of the DNAT rule. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies port used by ECSs or BMSs to provide services for + // external systems. + // Exactly one of external_service_port and external_service_port_range must be set. + // Required if internal_service_port is set. + // The port range used by Floating IP provide services for external systems. + ExternalServicePort *float64 `json:"externalServicePort,omitempty" tf:"external_service_port,omitempty"` + + // Specifies port range used by ECSs or BMSs to provide + // services for external systems. + // This parameter and internal_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + // The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + // Required if internal_service_port_range is set. + // The port range used by ECSs or BMSs to provide services for external systems. + ExternalServicePortRange *string `json:"externalServicePortRange,omitempty" tf:"external_service_port_range,omitempty"` + + // Specifies the ID of the floating IP address. + // The ID of the floating IP address. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/eip/v1alpha1.VpcEip + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + FloatingIPID *string `json:"floatingIpId,omitempty" tf:"floating_ip_id,omitempty"` + + // Reference to a VpcEip in eip to populate floatingIpId. + // +kubebuilder:validation:Optional + FloatingIPIDRef *v1.Reference `json:"floatingIpIdRef,omitempty" tf:"-"` + + // Selector for a VpcEip in eip to populate floatingIpId. + // +kubebuilder:validation:Optional + FloatingIPIDSelector *v1.Selector `json:"floatingIpIdSelector,omitempty" tf:"-"` + + // Specifies the ID of the global EIP connected by the DNAT rule. + // The ID of the global EIP connected by the DNAT rule. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/eip/v1alpha1.GlobalEip + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + GlobalEIPID *string `json:"globalEipId,omitempty" tf:"global_eip_id,omitempty"` + + // Reference to a GlobalEip in eip to populate globalEipId. + // +kubebuilder:validation:Optional + GlobalEIPIDRef *v1.Reference `json:"globalEipIdRef,omitempty" tf:"-"` + + // Selector for a GlobalEip in eip to populate globalEipId. + // +kubebuilder:validation:Optional + GlobalEIPIDSelector *v1.Selector `json:"globalEipIdSelector,omitempty" tf:"-"` + + // Specifies port used by Floating IP provide services for external + // systems. + // Exactly one of internal_service_port and internal_service_port_range must be set. + // The port used by Floating IP provide services for external systems. + InternalServicePort *float64 `json:"internalServicePort,omitempty" tf:"internal_service_port,omitempty"` + + // Specifies port range used by Floating IP provide services + // for external systems. + // This parameter and external_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + // The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + // The port used by ECSs or BMSs to provide services for external systems. + InternalServicePortRange *string `json:"internalServicePortRange,omitempty" tf:"internal_service_port_range,omitempty"` + + // Specifies the ID of the NAT gateway to which the DNAT rule belongs. + // Changing this will create a new resource. + // The ID of the NAT gateway to which the DNAT rule belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.Gateway + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + NATGatewayID *string `json:"natGatewayId,omitempty" tf:"nat_gateway_id,omitempty"` + + // Reference to a Gateway in nat to populate natGatewayId. + // +kubebuilder:validation:Optional + NATGatewayIDRef *v1.Reference `json:"natGatewayIdRef,omitempty" tf:"-"` + + // Selector for a Gateway in nat to populate natGatewayId. + // +kubebuilder:validation:Optional + NATGatewayIDSelector *v1.Selector `json:"natGatewayIdSelector,omitempty" tf:"-"` + + // Specifies the port ID of network. This parameter is mandatory in VPC scenario. + // Use huaweicloud_networking_port to get the port if just know a fixed IP addresses + // on the port. + // The port ID of network. + PortID *string `json:"portId,omitempty" tf:"port_id,omitempty"` + + // Specifies the private IP address of a user. This parameter is mandatory in + // Direct Connect scenario. + // The private IP address of a user. + PrivateIP *string `json:"privateIp,omitempty" tf:"private_ip,omitempty"` + + // Specifies the protocol type. + // The valid values are tcp, udp, and any. + // The protocol type. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region where the DNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the DNAT rule is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` +} + +type DnatRuleObservation struct { + + // The creation time of the DNAT rule. + // The creation time of the DNAT rule. + CreatedAt *string `json:"createdAt,omitempty" tf:"created_at,omitempty"` + + // Specifies the description of the DNAT rule. + // The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + // The description of the DNAT rule. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies port used by ECSs or BMSs to provide services for + // external systems. + // Exactly one of external_service_port and external_service_port_range must be set. + // Required if internal_service_port is set. + // The port range used by Floating IP provide services for external systems. + ExternalServicePort *float64 `json:"externalServicePort,omitempty" tf:"external_service_port,omitempty"` + + // Specifies port range used by ECSs or BMSs to provide + // services for external systems. + // This parameter and internal_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + // The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + // Required if internal_service_port_range is set. + // The port range used by ECSs or BMSs to provide services for external systems. + ExternalServicePortRange *string `json:"externalServicePortRange,omitempty" tf:"external_service_port_range,omitempty"` + + // The actual floating IP address. + // The floating IP address of the DNAT rule. + FloatingIPAddress *string `json:"floatingIpAddress,omitempty" tf:"floating_ip_address,omitempty"` + + // Specifies the ID of the floating IP address. + // The ID of the floating IP address. + FloatingIPID *string `json:"floatingIpId,omitempty" tf:"floating_ip_id,omitempty"` + + // The global EIP address connected by the DNAT rule. + // The global EIP address connected by the DNAT rule. + GlobalEIPAddress *string `json:"globalEipAddress,omitempty" tf:"global_eip_address,omitempty"` + + // Specifies the ID of the global EIP connected by the DNAT rule. + // The ID of the global EIP connected by the DNAT rule. + GlobalEIPID *string `json:"globalEipId,omitempty" tf:"global_eip_id,omitempty"` + + // The resource ID in UUID format. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies port used by Floating IP provide services for external + // systems. + // Exactly one of internal_service_port and internal_service_port_range must be set. + // The port used by Floating IP provide services for external systems. + InternalServicePort *float64 `json:"internalServicePort,omitempty" tf:"internal_service_port,omitempty"` + + // Specifies port range used by Floating IP provide services + // for external systems. + // This parameter and external_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + // The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + // The port used by ECSs or BMSs to provide services for external systems. + InternalServicePortRange *string `json:"internalServicePortRange,omitempty" tf:"internal_service_port_range,omitempty"` + + // Specifies the ID of the NAT gateway to which the DNAT rule belongs. + // Changing this will create a new resource. + // The ID of the NAT gateway to which the DNAT rule belongs. + NATGatewayID *string `json:"natGatewayId,omitempty" tf:"nat_gateway_id,omitempty"` + + // Specifies the port ID of network. This parameter is mandatory in VPC scenario. + // Use huaweicloud_networking_port to get the port if just know a fixed IP addresses + // on the port. + // The port ID of network. + PortID *string `json:"portId,omitempty" tf:"port_id,omitempty"` + + // Specifies the private IP address of a user. This parameter is mandatory in + // Direct Connect scenario. + // The private IP address of a user. + PrivateIP *string `json:"privateIp,omitempty" tf:"private_ip,omitempty"` + + // Specifies the protocol type. + // The valid values are tcp, udp, and any. + // The protocol type. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region where the DNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the DNAT rule is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The current status of the DNAT rule. + // The current status of the DNAT rule. + Status *string `json:"status,omitempty" tf:"status,omitempty"` +} + +type DnatRuleParameters struct { + + // Specifies the description of the DNAT rule. + // The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + // The description of the DNAT rule. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies port used by ECSs or BMSs to provide services for + // external systems. + // Exactly one of external_service_port and external_service_port_range must be set. + // Required if internal_service_port is set. + // The port range used by Floating IP provide services for external systems. + // +kubebuilder:validation:Optional + ExternalServicePort *float64 `json:"externalServicePort,omitempty" tf:"external_service_port,omitempty"` + + // Specifies port range used by ECSs or BMSs to provide + // services for external systems. + // This parameter and internal_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + // The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + // Required if internal_service_port_range is set. + // The port range used by ECSs or BMSs to provide services for external systems. + // +kubebuilder:validation:Optional + ExternalServicePortRange *string `json:"externalServicePortRange,omitempty" tf:"external_service_port_range,omitempty"` + + // Specifies the ID of the floating IP address. + // The ID of the floating IP address. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/eip/v1alpha1.VpcEip + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + FloatingIPID *string `json:"floatingIpId,omitempty" tf:"floating_ip_id,omitempty"` + + // Reference to a VpcEip in eip to populate floatingIpId. + // +kubebuilder:validation:Optional + FloatingIPIDRef *v1.Reference `json:"floatingIpIdRef,omitempty" tf:"-"` + + // Selector for a VpcEip in eip to populate floatingIpId. + // +kubebuilder:validation:Optional + FloatingIPIDSelector *v1.Selector `json:"floatingIpIdSelector,omitempty" tf:"-"` + + // Specifies the ID of the global EIP connected by the DNAT rule. + // The ID of the global EIP connected by the DNAT rule. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/eip/v1alpha1.GlobalEip + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + GlobalEIPID *string `json:"globalEipId,omitempty" tf:"global_eip_id,omitempty"` + + // Reference to a GlobalEip in eip to populate globalEipId. + // +kubebuilder:validation:Optional + GlobalEIPIDRef *v1.Reference `json:"globalEipIdRef,omitempty" tf:"-"` + + // Selector for a GlobalEip in eip to populate globalEipId. + // +kubebuilder:validation:Optional + GlobalEIPIDSelector *v1.Selector `json:"globalEipIdSelector,omitempty" tf:"-"` + + // Specifies port used by Floating IP provide services for external + // systems. + // Exactly one of internal_service_port and internal_service_port_range must be set. + // The port used by Floating IP provide services for external systems. + // +kubebuilder:validation:Optional + InternalServicePort *float64 `json:"internalServicePort,omitempty" tf:"internal_service_port,omitempty"` + + // Specifies port range used by Floating IP provide services + // for external systems. + // This parameter and external_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + // The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + // The port used by ECSs or BMSs to provide services for external systems. + // +kubebuilder:validation:Optional + InternalServicePortRange *string `json:"internalServicePortRange,omitempty" tf:"internal_service_port_range,omitempty"` + + // Specifies the ID of the NAT gateway to which the DNAT rule belongs. + // Changing this will create a new resource. + // The ID of the NAT gateway to which the DNAT rule belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.Gateway + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + NATGatewayID *string `json:"natGatewayId,omitempty" tf:"nat_gateway_id,omitempty"` + + // Reference to a Gateway in nat to populate natGatewayId. + // +kubebuilder:validation:Optional + NATGatewayIDRef *v1.Reference `json:"natGatewayIdRef,omitempty" tf:"-"` + + // Selector for a Gateway in nat to populate natGatewayId. + // +kubebuilder:validation:Optional + NATGatewayIDSelector *v1.Selector `json:"natGatewayIdSelector,omitempty" tf:"-"` + + // Specifies the port ID of network. This parameter is mandatory in VPC scenario. + // Use huaweicloud_networking_port to get the port if just know a fixed IP addresses + // on the port. + // The port ID of network. + // +kubebuilder:validation:Optional + PortID *string `json:"portId,omitempty" tf:"port_id,omitempty"` + + // Specifies the private IP address of a user. This parameter is mandatory in + // Direct Connect scenario. + // The private IP address of a user. + // +kubebuilder:validation:Optional + PrivateIP *string `json:"privateIp,omitempty" tf:"private_ip,omitempty"` + + // Specifies the protocol type. + // The valid values are tcp, udp, and any. + // The protocol type. + // +kubebuilder:validation:Optional + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region where the DNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the DNAT rule is located. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` +} + +// DnatRuleSpec defines the desired state of DnatRule +type DnatRuleSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider DnatRuleParameters `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 DnatRuleInitParameters `json:"initProvider,omitempty"` +} + +// DnatRuleStatus defines the observed state of DnatRule. +type DnatRuleStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider DnatRuleObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// DnatRule is the Schema for the DnatRules API. "" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type DnatRule 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.protocol) || (has(self.initProvider) && has(self.initProvider.protocol))",message="spec.forProvider.protocol is a required parameter" + Spec DnatRuleSpec `json:"spec"` + Status DnatRuleStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// DnatRuleList contains a list of DnatRules +type DnatRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DnatRule `json:"items"` +} + +// Repository type metadata. +var ( + DnatRule_Kind = "DnatRule" + DnatRule_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: DnatRule_Kind}.String() + DnatRule_KindAPIVersion = DnatRule_Kind + "." + CRDGroupVersion.String() + DnatRule_GroupVersionKind = CRDGroupVersion.WithKind(DnatRule_Kind) +) + +func init() { + SchemeBuilder.Register(&DnatRule{}, &DnatRuleList{}) +} diff --git a/apis/nat/v1alpha1/zz_gateway_terraformed.go b/apis/nat/v1alpha1/zz_gateway_terraformed.go new file mode 100755 index 0000000..f7b8084 --- /dev/null +++ b/apis/nat/v1alpha1/zz_gateway_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this Gateway +func (mg *Gateway) GetTerraformResourceType() string { + return "huaweicloud_nat_gateway" +} + +// GetConnectionDetailsMapping for this Gateway +func (tr *Gateway) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Gateway +func (tr *Gateway) 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 Gateway +func (tr *Gateway) 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 Gateway +func (tr *Gateway) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Gateway +func (tr *Gateway) 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 Gateway +func (tr *Gateway) 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 Gateway +func (tr *Gateway) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this Gateway +func (tr *Gateway) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this Gateway using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Gateway) LateInitialize(attrs []byte) (bool, error) { + params := &GatewayParameters{} + 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 *Gateway) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/nat/v1alpha1/zz_gateway_types.go b/apis/nat/v1alpha1/zz_gateway_types.go new file mode 100755 index 0000000..bb99b99 --- /dev/null +++ b/apis/nat/v1alpha1/zz_gateway_types.go @@ -0,0 +1,344 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 GatewayInitParameters struct { + + // Specifies whether auto-renew is enabled. This parameter is only valid when + // charging_mode is set to prePaid. Valid values are true and false. Defaults to false. + AutoRenew *string `json:"autoRenew,omitempty" tf:"auto_renew,omitempty"` + + // Specifies the charging mode of the NAT gateway. + // The valid values are as follows: + ChargingMode *string `json:"chargingMode,omitempty" tf:"charging_mode,omitempty"` + + // Specifies the description of the NAT gateway, which contain maximum of 512 + // characters, and angle brackets (<) and (>) are not allowed. + // The description of the NAT gateway. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the enterprise project ID of the NAT gateway. + // Changing this will create a new resource. + // The enterprise project ID of the NAT gateway. + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // Specifies the NAT gateway name. + // The valid length is limited from 1 to 64, only letters, digits, hyphens (-) and underscores (_) are allowed. + // The NAT gateway name. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the private IP address of the NAT gateway. + // The IP address must be one of the IP addresses of the VPC subnet associated with the NAT gateway. + // If not spacified, it will be automatically allocated. + // Changing this will creates a new resource. + // The private IP address of the NAT gateway. + NgportIPAddress *string `json:"ngportIpAddress,omitempty" tf:"ngport_ip_address,omitempty"` + + // Specifies the charging period of the NAT gateway. + // If period_unit is set to month, the value ranges from 1 to 9. + // If period_unit is set to year, the value ranges from 1 to 3. + // This parameter is mandatory if charging_mode is set to prePaid. + // Changing this will create a new resource. + Period *float64 `json:"period,omitempty" tf:"period,omitempty"` + + // Specifies the charging period unit of the NAT gateway. + // Valid values are month and year. This parameter is mandatory if charging_mode is set to prePaid. + // Changing this will create a new resource. + PeriodUnit *string `json:"periodUnit,omitempty" tf:"period_unit,omitempty"` + + // Specifies the region where the NAT gateway is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the NAT gateway is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the specification of the NAT gateway. The valid values are as follows: + // The specification of the NAT gateway. + Spec *string `json:"spec,omitempty" tf:"spec,omitempty"` + + // Specifies the subnet ID of the downstream interface (the next hop of the + // DVR) of the NAT gateway. + // Changing this will create a new resource. + // The network ID of the downstream interface (the next hop of the DVR) of the NAT gateway. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.Subnet + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Reference to a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + + // Specifies the key/value pairs to associate with the NAT gateway. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Specifies the ID of the VPC to which the NAT gateway belongs. + // Changing this will create a new resource. + // The ID of the VPC to which the NAT gateway belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.VPC + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` + + // Reference to a VPC in vpc to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDRef *v1.Reference `json:"vpcIdRef,omitempty" tf:"-"` + + // Selector for a VPC in vpc to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDSelector *v1.Selector `json:"vpcIdSelector,omitempty" tf:"-"` +} + +type GatewayObservation struct { + + // Specifies whether auto-renew is enabled. This parameter is only valid when + // charging_mode is set to prePaid. Valid values are true and false. Defaults to false. + AutoRenew *string `json:"autoRenew,omitempty" tf:"auto_renew,omitempty"` + + // Specifies the charging mode of the NAT gateway. + // The valid values are as follows: + ChargingMode *string `json:"chargingMode,omitempty" tf:"charging_mode,omitempty"` + + // Specifies the description of the NAT gateway, which contain maximum of 512 + // characters, and angle brackets (<) and (>) are not allowed. + // The description of the NAT gateway. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the enterprise project ID of the NAT gateway. + // Changing this will create a new resource. + // The enterprise project ID of the NAT gateway. + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // The resource ID in UUID format. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies the NAT gateway name. + // The valid length is limited from 1 to 64, only letters, digits, hyphens (-) and underscores (_) are allowed. + // The NAT gateway name. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the private IP address of the NAT gateway. + // The IP address must be one of the IP addresses of the VPC subnet associated with the NAT gateway. + // If not spacified, it will be automatically allocated. + // Changing this will creates a new resource. + // The private IP address of the NAT gateway. + NgportIPAddress *string `json:"ngportIpAddress,omitempty" tf:"ngport_ip_address,omitempty"` + + // Specifies the charging period of the NAT gateway. + // If period_unit is set to month, the value ranges from 1 to 9. + // If period_unit is set to year, the value ranges from 1 to 3. + // This parameter is mandatory if charging_mode is set to prePaid. + // Changing this will create a new resource. + Period *float64 `json:"period,omitempty" tf:"period,omitempty"` + + // Specifies the charging period unit of the NAT gateway. + // Valid values are month and year. This parameter is mandatory if charging_mode is set to prePaid. + // Changing this will create a new resource. + PeriodUnit *string `json:"periodUnit,omitempty" tf:"period_unit,omitempty"` + + // Specifies the region where the NAT gateway is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the NAT gateway is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the specification of the NAT gateway. The valid values are as follows: + // The specification of the NAT gateway. + Spec *string `json:"spec,omitempty" tf:"spec,omitempty"` + + // The current status of the NAT gateway. + // The current status of the NAT gateway. + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // Specifies the subnet ID of the downstream interface (the next hop of the + // DVR) of the NAT gateway. + // Changing this will create a new resource. + // The network ID of the downstream interface (the next hop of the DVR) of the NAT gateway. + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Specifies the key/value pairs to associate with the NAT gateway. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Specifies the ID of the VPC to which the NAT gateway belongs. + // Changing this will create a new resource. + // The ID of the VPC to which the NAT gateway belongs. + VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` +} + +type GatewayParameters struct { + + // Specifies whether auto-renew is enabled. This parameter is only valid when + // charging_mode is set to prePaid. Valid values are true and false. Defaults to false. + // +kubebuilder:validation:Optional + AutoRenew *string `json:"autoRenew,omitempty" tf:"auto_renew,omitempty"` + + // Specifies the charging mode of the NAT gateway. + // The valid values are as follows: + // +kubebuilder:validation:Optional + ChargingMode *string `json:"chargingMode,omitempty" tf:"charging_mode,omitempty"` + + // Specifies the description of the NAT gateway, which contain maximum of 512 + // characters, and angle brackets (<) and (>) are not allowed. + // The description of the NAT gateway. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the enterprise project ID of the NAT gateway. + // Changing this will create a new resource. + // The enterprise project ID of the NAT gateway. + // +kubebuilder:validation:Optional + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // Specifies the NAT gateway name. + // The valid length is limited from 1 to 64, only letters, digits, hyphens (-) and underscores (_) are allowed. + // The NAT gateway name. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the private IP address of the NAT gateway. + // The IP address must be one of the IP addresses of the VPC subnet associated with the NAT gateway. + // If not spacified, it will be automatically allocated. + // Changing this will creates a new resource. + // The private IP address of the NAT gateway. + // +kubebuilder:validation:Optional + NgportIPAddress *string `json:"ngportIpAddress,omitempty" tf:"ngport_ip_address,omitempty"` + + // Specifies the charging period of the NAT gateway. + // If period_unit is set to month, the value ranges from 1 to 9. + // If period_unit is set to year, the value ranges from 1 to 3. + // This parameter is mandatory if charging_mode is set to prePaid. + // Changing this will create a new resource. + // +kubebuilder:validation:Optional + Period *float64 `json:"period,omitempty" tf:"period,omitempty"` + + // Specifies the charging period unit of the NAT gateway. + // Valid values are month and year. This parameter is mandatory if charging_mode is set to prePaid. + // Changing this will create a new resource. + // +kubebuilder:validation:Optional + PeriodUnit *string `json:"periodUnit,omitempty" tf:"period_unit,omitempty"` + + // Specifies the region where the NAT gateway is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the NAT gateway is located. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the specification of the NAT gateway. The valid values are as follows: + // The specification of the NAT gateway. + // +kubebuilder:validation:Optional + Spec *string `json:"spec,omitempty" tf:"spec,omitempty"` + + // Specifies the subnet ID of the downstream interface (the next hop of the + // DVR) of the NAT gateway. + // Changing this will create a new resource. + // The network ID of the downstream interface (the next hop of the DVR) of the NAT gateway. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.Subnet + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Reference to a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + + // Specifies the key/value pairs to associate with the NAT gateway. + // +kubebuilder:validation:Optional + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Specifies the ID of the VPC to which the NAT gateway belongs. + // Changing this will create a new resource. + // The ID of the VPC to which the NAT gateway belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.VPC + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` + + // Reference to a VPC in vpc to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDRef *v1.Reference `json:"vpcIdRef,omitempty" tf:"-"` + + // Selector for a VPC in vpc to populate vpcId. + // +kubebuilder:validation:Optional + VPCIDSelector *v1.Selector `json:"vpcIdSelector,omitempty" tf:"-"` +} + +// GatewaySpec defines the desired state of Gateway +type GatewaySpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider GatewayParameters `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 GatewayInitParameters `json:"initProvider,omitempty"` +} + +// GatewayStatus defines the observed state of Gateway. +type GatewayStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider GatewayObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// Gateway is the Schema for the Gateways API. "" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type Gateway 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.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.spec) || (has(self.initProvider) && has(self.initProvider.spec))",message="spec.forProvider.spec is a required parameter" + Spec GatewaySpec `json:"spec"` + Status GatewayStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// GatewayList contains a list of Gateways +type GatewayList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Gateway `json:"items"` +} + +// Repository type metadata. +var ( + Gateway_Kind = "Gateway" + Gateway_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Gateway_Kind}.String() + Gateway_KindAPIVersion = Gateway_Kind + "." + CRDGroupVersion.String() + Gateway_GroupVersionKind = CRDGroupVersion.WithKind(Gateway_Kind) +) + +func init() { + SchemeBuilder.Register(&Gateway{}, &GatewayList{}) +} diff --git a/apis/nat/v1alpha1/zz_generated.conversion_hubs.go b/apis/nat/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..d46fb65 --- /dev/null +++ b/apis/nat/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *DnatRule) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *Gateway) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *PrivateDnatRule) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *PrivateGateway) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *PrivateSnatRule) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *PrivateTransitIP) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *SnatRule) Hub() {} diff --git a/apis/nat/v1alpha1/zz_generated.deepcopy.go b/apis/nat/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..c1d19eb --- /dev/null +++ b/apis/nat/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,2476 @@ +//go:build !ignore_autogenerated + +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DnatRule) DeepCopyInto(out *DnatRule) { + *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 DnatRule. +func (in *DnatRule) DeepCopy() *DnatRule { + if in == nil { + return nil + } + out := new(DnatRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DnatRule) 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 *DnatRuleInitParameters) DeepCopyInto(out *DnatRuleInitParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.ExternalServicePort != nil { + in, out := &in.ExternalServicePort, &out.ExternalServicePort + *out = new(float64) + **out = **in + } + if in.ExternalServicePortRange != nil { + in, out := &in.ExternalServicePortRange, &out.ExternalServicePortRange + *out = new(string) + **out = **in + } + if in.FloatingIPID != nil { + in, out := &in.FloatingIPID, &out.FloatingIPID + *out = new(string) + **out = **in + } + if in.FloatingIPIDRef != nil { + in, out := &in.FloatingIPIDRef, &out.FloatingIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.FloatingIPIDSelector != nil { + in, out := &in.FloatingIPIDSelector, &out.FloatingIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.GlobalEIPID != nil { + in, out := &in.GlobalEIPID, &out.GlobalEIPID + *out = new(string) + **out = **in + } + if in.GlobalEIPIDRef != nil { + in, out := &in.GlobalEIPIDRef, &out.GlobalEIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.GlobalEIPIDSelector != nil { + in, out := &in.GlobalEIPIDSelector, &out.GlobalEIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.InternalServicePort != nil { + in, out := &in.InternalServicePort, &out.InternalServicePort + *out = new(float64) + **out = **in + } + if in.InternalServicePortRange != nil { + in, out := &in.InternalServicePortRange, &out.InternalServicePortRange + *out = new(string) + **out = **in + } + if in.NATGatewayID != nil { + in, out := &in.NATGatewayID, &out.NATGatewayID + *out = new(string) + **out = **in + } + if in.NATGatewayIDRef != nil { + in, out := &in.NATGatewayIDRef, &out.NATGatewayIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NATGatewayIDSelector != nil { + in, out := &in.NATGatewayIDSelector, &out.NATGatewayIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.PortID != nil { + in, out := &in.PortID, &out.PortID + *out = new(string) + **out = **in + } + if in.PrivateIP != nil { + in, out := &in.PrivateIP, &out.PrivateIP + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DnatRuleInitParameters. +func (in *DnatRuleInitParameters) DeepCopy() *DnatRuleInitParameters { + if in == nil { + return nil + } + out := new(DnatRuleInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DnatRuleList) DeepCopyInto(out *DnatRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DnatRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DnatRuleList. +func (in *DnatRuleList) DeepCopy() *DnatRuleList { + if in == nil { + return nil + } + out := new(DnatRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DnatRuleList) 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 *DnatRuleObservation) DeepCopyInto(out *DnatRuleObservation) { + *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.ExternalServicePort != nil { + in, out := &in.ExternalServicePort, &out.ExternalServicePort + *out = new(float64) + **out = **in + } + if in.ExternalServicePortRange != nil { + in, out := &in.ExternalServicePortRange, &out.ExternalServicePortRange + *out = new(string) + **out = **in + } + if in.FloatingIPAddress != nil { + in, out := &in.FloatingIPAddress, &out.FloatingIPAddress + *out = new(string) + **out = **in + } + if in.FloatingIPID != nil { + in, out := &in.FloatingIPID, &out.FloatingIPID + *out = new(string) + **out = **in + } + if in.GlobalEIPAddress != nil { + in, out := &in.GlobalEIPAddress, &out.GlobalEIPAddress + *out = new(string) + **out = **in + } + if in.GlobalEIPID != nil { + in, out := &in.GlobalEIPID, &out.GlobalEIPID + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.InternalServicePort != nil { + in, out := &in.InternalServicePort, &out.InternalServicePort + *out = new(float64) + **out = **in + } + if in.InternalServicePortRange != nil { + in, out := &in.InternalServicePortRange, &out.InternalServicePortRange + *out = new(string) + **out = **in + } + if in.NATGatewayID != nil { + in, out := &in.NATGatewayID, &out.NATGatewayID + *out = new(string) + **out = **in + } + if in.PortID != nil { + in, out := &in.PortID, &out.PortID + *out = new(string) + **out = **in + } + if in.PrivateIP != nil { + in, out := &in.PrivateIP, &out.PrivateIP + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DnatRuleObservation. +func (in *DnatRuleObservation) DeepCopy() *DnatRuleObservation { + if in == nil { + return nil + } + out := new(DnatRuleObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DnatRuleParameters) DeepCopyInto(out *DnatRuleParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.ExternalServicePort != nil { + in, out := &in.ExternalServicePort, &out.ExternalServicePort + *out = new(float64) + **out = **in + } + if in.ExternalServicePortRange != nil { + in, out := &in.ExternalServicePortRange, &out.ExternalServicePortRange + *out = new(string) + **out = **in + } + if in.FloatingIPID != nil { + in, out := &in.FloatingIPID, &out.FloatingIPID + *out = new(string) + **out = **in + } + if in.FloatingIPIDRef != nil { + in, out := &in.FloatingIPIDRef, &out.FloatingIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.FloatingIPIDSelector != nil { + in, out := &in.FloatingIPIDSelector, &out.FloatingIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.GlobalEIPID != nil { + in, out := &in.GlobalEIPID, &out.GlobalEIPID + *out = new(string) + **out = **in + } + if in.GlobalEIPIDRef != nil { + in, out := &in.GlobalEIPIDRef, &out.GlobalEIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.GlobalEIPIDSelector != nil { + in, out := &in.GlobalEIPIDSelector, &out.GlobalEIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.InternalServicePort != nil { + in, out := &in.InternalServicePort, &out.InternalServicePort + *out = new(float64) + **out = **in + } + if in.InternalServicePortRange != nil { + in, out := &in.InternalServicePortRange, &out.InternalServicePortRange + *out = new(string) + **out = **in + } + if in.NATGatewayID != nil { + in, out := &in.NATGatewayID, &out.NATGatewayID + *out = new(string) + **out = **in + } + if in.NATGatewayIDRef != nil { + in, out := &in.NATGatewayIDRef, &out.NATGatewayIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NATGatewayIDSelector != nil { + in, out := &in.NATGatewayIDSelector, &out.NATGatewayIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.PortID != nil { + in, out := &in.PortID, &out.PortID + *out = new(string) + **out = **in + } + if in.PrivateIP != nil { + in, out := &in.PrivateIP, &out.PrivateIP + *out = new(string) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DnatRuleParameters. +func (in *DnatRuleParameters) DeepCopy() *DnatRuleParameters { + if in == nil { + return nil + } + out := new(DnatRuleParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DnatRuleSpec) DeepCopyInto(out *DnatRuleSpec) { + *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 DnatRuleSpec. +func (in *DnatRuleSpec) DeepCopy() *DnatRuleSpec { + if in == nil { + return nil + } + out := new(DnatRuleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DnatRuleStatus) DeepCopyInto(out *DnatRuleStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DnatRuleStatus. +func (in *DnatRuleStatus) DeepCopy() *DnatRuleStatus { + if in == nil { + return nil + } + out := new(DnatRuleStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Gateway) DeepCopyInto(out *Gateway) { + *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 Gateway. +func (in *Gateway) DeepCopy() *Gateway { + if in == nil { + return nil + } + out := new(Gateway) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Gateway) 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 *GatewayInitParameters) DeepCopyInto(out *GatewayInitParameters) { + *out = *in + if in.AutoRenew != nil { + in, out := &in.AutoRenew, &out.AutoRenew + *out = new(string) + **out = **in + } + if in.ChargingMode != nil { + in, out := &in.ChargingMode, &out.ChargingMode + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.NgportIPAddress != nil { + in, out := &in.NgportIPAddress, &out.NgportIPAddress + *out = new(string) + **out = **in + } + if in.Period != nil { + in, out := &in.Period, &out.Period + *out = new(float64) + **out = **in + } + if in.PeriodUnit != nil { + in, out := &in.PeriodUnit, &out.PeriodUnit + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.VPCID != nil { + in, out := &in.VPCID, &out.VPCID + *out = new(string) + **out = **in + } + if in.VPCIDRef != nil { + in, out := &in.VPCIDRef, &out.VPCIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.VPCIDSelector != nil { + in, out := &in.VPCIDSelector, &out.VPCIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayInitParameters. +func (in *GatewayInitParameters) DeepCopy() *GatewayInitParameters { + if in == nil { + return nil + } + out := new(GatewayInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayList) DeepCopyInto(out *GatewayList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Gateway, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayList. +func (in *GatewayList) DeepCopy() *GatewayList { + if in == nil { + return nil + } + out := new(GatewayList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GatewayList) 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 *GatewayObservation) DeepCopyInto(out *GatewayObservation) { + *out = *in + if in.AutoRenew != nil { + in, out := &in.AutoRenew, &out.AutoRenew + *out = new(string) + **out = **in + } + if in.ChargingMode != nil { + in, out := &in.ChargingMode, &out.ChargingMode + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.NgportIPAddress != nil { + in, out := &in.NgportIPAddress, &out.NgportIPAddress + *out = new(string) + **out = **in + } + if in.Period != nil { + in, out := &in.Period, &out.Period + *out = new(float64) + **out = **in + } + if in.PeriodUnit != nil { + in, out := &in.PeriodUnit, &out.PeriodUnit + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.VPCID != nil { + in, out := &in.VPCID, &out.VPCID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayObservation. +func (in *GatewayObservation) DeepCopy() *GatewayObservation { + if in == nil { + return nil + } + out := new(GatewayObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayParameters) DeepCopyInto(out *GatewayParameters) { + *out = *in + if in.AutoRenew != nil { + in, out := &in.AutoRenew, &out.AutoRenew + *out = new(string) + **out = **in + } + if in.ChargingMode != nil { + in, out := &in.ChargingMode, &out.ChargingMode + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.NgportIPAddress != nil { + in, out := &in.NgportIPAddress, &out.NgportIPAddress + *out = new(string) + **out = **in + } + if in.Period != nil { + in, out := &in.Period, &out.Period + *out = new(float64) + **out = **in + } + if in.PeriodUnit != nil { + in, out := &in.PeriodUnit, &out.PeriodUnit + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.VPCID != nil { + in, out := &in.VPCID, &out.VPCID + *out = new(string) + **out = **in + } + if in.VPCIDRef != nil { + in, out := &in.VPCIDRef, &out.VPCIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.VPCIDSelector != nil { + in, out := &in.VPCIDSelector, &out.VPCIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayParameters. +func (in *GatewayParameters) DeepCopy() *GatewayParameters { + if in == nil { + return nil + } + out := new(GatewayParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) { + *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 GatewaySpec. +func (in *GatewaySpec) DeepCopy() *GatewaySpec { + if in == nil { + return nil + } + out := new(GatewaySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GatewayStatus) DeepCopyInto(out *GatewayStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewayStatus. +func (in *GatewayStatus) DeepCopy() *GatewayStatus { + if in == nil { + return nil + } + out := new(GatewayStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateDnatRule) DeepCopyInto(out *PrivateDnatRule) { + *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 PrivateDnatRule. +func (in *PrivateDnatRule) DeepCopy() *PrivateDnatRule { + if in == nil { + return nil + } + out := new(PrivateDnatRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PrivateDnatRule) 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 *PrivateDnatRuleInitParameters) DeepCopyInto(out *PrivateDnatRuleInitParameters) { + *out = *in + if in.BackendInterfaceID != nil { + in, out := &in.BackendInterfaceID, &out.BackendInterfaceID + *out = new(string) + **out = **in + } + if in.BackendPrivateIP != nil { + in, out := &in.BackendPrivateIP, &out.BackendPrivateIP + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.GatewayID != nil { + in, out := &in.GatewayID, &out.GatewayID + *out = new(string) + **out = **in + } + if in.GatewayIDRef != nil { + in, out := &in.GatewayIDRef, &out.GatewayIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.GatewayIDSelector != nil { + in, out := &in.GatewayIDSelector, &out.GatewayIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.InternalServicePort != nil { + in, out := &in.InternalServicePort, &out.InternalServicePort + *out = new(float64) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.TransitIPID != nil { + in, out := &in.TransitIPID, &out.TransitIPID + *out = new(string) + **out = **in + } + if in.TransitIPIDRef != nil { + in, out := &in.TransitIPIDRef, &out.TransitIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TransitIPIDSelector != nil { + in, out := &in.TransitIPIDSelector, &out.TransitIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.TransitServicePort != nil { + in, out := &in.TransitServicePort, &out.TransitServicePort + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateDnatRuleInitParameters. +func (in *PrivateDnatRuleInitParameters) DeepCopy() *PrivateDnatRuleInitParameters { + if in == nil { + return nil + } + out := new(PrivateDnatRuleInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateDnatRuleList) DeepCopyInto(out *PrivateDnatRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PrivateDnatRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateDnatRuleList. +func (in *PrivateDnatRuleList) DeepCopy() *PrivateDnatRuleList { + if in == nil { + return nil + } + out := new(PrivateDnatRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PrivateDnatRuleList) 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 *PrivateDnatRuleObservation) DeepCopyInto(out *PrivateDnatRuleObservation) { + *out = *in + if in.BackendInterfaceID != nil { + in, out := &in.BackendInterfaceID, &out.BackendInterfaceID + *out = new(string) + **out = **in + } + if in.BackendPrivateIP != nil { + in, out := &in.BackendPrivateIP, &out.BackendPrivateIP + *out = new(string) + **out = **in + } + if in.BackendType != nil { + in, out := &in.BackendType, &out.BackendType + *out = new(string) + **out = **in + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.GatewayID != nil { + in, out := &in.GatewayID, &out.GatewayID + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.InternalServicePort != nil { + in, out := &in.InternalServicePort, &out.InternalServicePort + *out = new(float64) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.TransitIPID != nil { + in, out := &in.TransitIPID, &out.TransitIPID + *out = new(string) + **out = **in + } + if in.TransitServicePort != nil { + in, out := &in.TransitServicePort, &out.TransitServicePort + *out = new(float64) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateDnatRuleObservation. +func (in *PrivateDnatRuleObservation) DeepCopy() *PrivateDnatRuleObservation { + if in == nil { + return nil + } + out := new(PrivateDnatRuleObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateDnatRuleParameters) DeepCopyInto(out *PrivateDnatRuleParameters) { + *out = *in + if in.BackendInterfaceID != nil { + in, out := &in.BackendInterfaceID, &out.BackendInterfaceID + *out = new(string) + **out = **in + } + if in.BackendPrivateIP != nil { + in, out := &in.BackendPrivateIP, &out.BackendPrivateIP + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.GatewayID != nil { + in, out := &in.GatewayID, &out.GatewayID + *out = new(string) + **out = **in + } + if in.GatewayIDRef != nil { + in, out := &in.GatewayIDRef, &out.GatewayIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.GatewayIDSelector != nil { + in, out := &in.GatewayIDSelector, &out.GatewayIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.InternalServicePort != nil { + in, out := &in.InternalServicePort, &out.InternalServicePort + *out = new(float64) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.TransitIPID != nil { + in, out := &in.TransitIPID, &out.TransitIPID + *out = new(string) + **out = **in + } + if in.TransitIPIDRef != nil { + in, out := &in.TransitIPIDRef, &out.TransitIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TransitIPIDSelector != nil { + in, out := &in.TransitIPIDSelector, &out.TransitIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.TransitServicePort != nil { + in, out := &in.TransitServicePort, &out.TransitServicePort + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateDnatRuleParameters. +func (in *PrivateDnatRuleParameters) DeepCopy() *PrivateDnatRuleParameters { + if in == nil { + return nil + } + out := new(PrivateDnatRuleParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateDnatRuleSpec) DeepCopyInto(out *PrivateDnatRuleSpec) { + *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 PrivateDnatRuleSpec. +func (in *PrivateDnatRuleSpec) DeepCopy() *PrivateDnatRuleSpec { + if in == nil { + return nil + } + out := new(PrivateDnatRuleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateDnatRuleStatus) DeepCopyInto(out *PrivateDnatRuleStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateDnatRuleStatus. +func (in *PrivateDnatRuleStatus) DeepCopy() *PrivateDnatRuleStatus { + if in == nil { + return nil + } + out := new(PrivateDnatRuleStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateGateway) DeepCopyInto(out *PrivateGateway) { + *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 PrivateGateway. +func (in *PrivateGateway) DeepCopy() *PrivateGateway { + if in == nil { + return nil + } + out := new(PrivateGateway) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PrivateGateway) 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 *PrivateGatewayInitParameters) DeepCopyInto(out *PrivateGatewayInitParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateGatewayInitParameters. +func (in *PrivateGatewayInitParameters) DeepCopy() *PrivateGatewayInitParameters { + if in == nil { + return nil + } + out := new(PrivateGatewayInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateGatewayList) DeepCopyInto(out *PrivateGatewayList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PrivateGateway, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateGatewayList. +func (in *PrivateGatewayList) DeepCopy() *PrivateGatewayList { + if in == nil { + return nil + } + out := new(PrivateGatewayList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PrivateGatewayList) 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 *PrivateGatewayObservation) DeepCopyInto(out *PrivateGatewayObservation) { + *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } + if in.VPCID != nil { + in, out := &in.VPCID, &out.VPCID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateGatewayObservation. +func (in *PrivateGatewayObservation) DeepCopy() *PrivateGatewayObservation { + if in == nil { + return nil + } + out := new(PrivateGatewayObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateGatewayParameters) DeepCopyInto(out *PrivateGatewayParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateGatewayParameters. +func (in *PrivateGatewayParameters) DeepCopy() *PrivateGatewayParameters { + if in == nil { + return nil + } + out := new(PrivateGatewayParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateGatewaySpec) DeepCopyInto(out *PrivateGatewaySpec) { + *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 PrivateGatewaySpec. +func (in *PrivateGatewaySpec) DeepCopy() *PrivateGatewaySpec { + if in == nil { + return nil + } + out := new(PrivateGatewaySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateGatewayStatus) DeepCopyInto(out *PrivateGatewayStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateGatewayStatus. +func (in *PrivateGatewayStatus) DeepCopy() *PrivateGatewayStatus { + if in == nil { + return nil + } + out := new(PrivateGatewayStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateSnatRule) DeepCopyInto(out *PrivateSnatRule) { + *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 PrivateSnatRule. +func (in *PrivateSnatRule) DeepCopy() *PrivateSnatRule { + if in == nil { + return nil + } + out := new(PrivateSnatRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PrivateSnatRule) 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 *PrivateSnatRuleInitParameters) DeepCopyInto(out *PrivateSnatRuleInitParameters) { + *out = *in + if in.Cidr != nil { + in, out := &in.Cidr, &out.Cidr + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.GatewayID != nil { + in, out := &in.GatewayID, &out.GatewayID + *out = new(string) + **out = **in + } + if in.GatewayIDRef != nil { + in, out := &in.GatewayIDRef, &out.GatewayIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.GatewayIDSelector != nil { + in, out := &in.GatewayIDSelector, &out.GatewayIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.TransitIPID != nil { + in, out := &in.TransitIPID, &out.TransitIPID + *out = new(string) + **out = **in + } + if in.TransitIPIDRef != nil { + in, out := &in.TransitIPIDRef, &out.TransitIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TransitIPIDSelector != nil { + in, out := &in.TransitIPIDSelector, &out.TransitIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateSnatRuleInitParameters. +func (in *PrivateSnatRuleInitParameters) DeepCopy() *PrivateSnatRuleInitParameters { + if in == nil { + return nil + } + out := new(PrivateSnatRuleInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateSnatRuleList) DeepCopyInto(out *PrivateSnatRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PrivateSnatRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateSnatRuleList. +func (in *PrivateSnatRuleList) DeepCopy() *PrivateSnatRuleList { + if in == nil { + return nil + } + out := new(PrivateSnatRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PrivateSnatRuleList) 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 *PrivateSnatRuleObservation) DeepCopyInto(out *PrivateSnatRuleObservation) { + *out = *in + if in.Cidr != nil { + in, out := &in.Cidr, &out.Cidr + *out = new(string) + **out = **in + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.GatewayID != nil { + in, out := &in.GatewayID, &out.GatewayID + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.TransitIPAddress != nil { + in, out := &in.TransitIPAddress, &out.TransitIPAddress + *out = new(string) + **out = **in + } + if in.TransitIPID != nil { + in, out := &in.TransitIPID, &out.TransitIPID + *out = new(string) + **out = **in + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateSnatRuleObservation. +func (in *PrivateSnatRuleObservation) DeepCopy() *PrivateSnatRuleObservation { + if in == nil { + return nil + } + out := new(PrivateSnatRuleObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateSnatRuleParameters) DeepCopyInto(out *PrivateSnatRuleParameters) { + *out = *in + if in.Cidr != nil { + in, out := &in.Cidr, &out.Cidr + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.GatewayID != nil { + in, out := &in.GatewayID, &out.GatewayID + *out = new(string) + **out = **in + } + if in.GatewayIDRef != nil { + in, out := &in.GatewayIDRef, &out.GatewayIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.GatewayIDSelector != nil { + in, out := &in.GatewayIDSelector, &out.GatewayIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.TransitIPID != nil { + in, out := &in.TransitIPID, &out.TransitIPID + *out = new(string) + **out = **in + } + if in.TransitIPIDRef != nil { + in, out := &in.TransitIPIDRef, &out.TransitIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.TransitIPIDSelector != nil { + in, out := &in.TransitIPIDSelector, &out.TransitIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateSnatRuleParameters. +func (in *PrivateSnatRuleParameters) DeepCopy() *PrivateSnatRuleParameters { + if in == nil { + return nil + } + out := new(PrivateSnatRuleParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateSnatRuleSpec) DeepCopyInto(out *PrivateSnatRuleSpec) { + *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 PrivateSnatRuleSpec. +func (in *PrivateSnatRuleSpec) DeepCopy() *PrivateSnatRuleSpec { + if in == nil { + return nil + } + out := new(PrivateSnatRuleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateSnatRuleStatus) DeepCopyInto(out *PrivateSnatRuleStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateSnatRuleStatus. +func (in *PrivateSnatRuleStatus) DeepCopy() *PrivateSnatRuleStatus { + if in == nil { + return nil + } + out := new(PrivateSnatRuleStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateTransitIP) DeepCopyInto(out *PrivateTransitIP) { + *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 PrivateTransitIP. +func (in *PrivateTransitIP) DeepCopy() *PrivateTransitIP { + if in == nil { + return nil + } + out := new(PrivateTransitIP) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PrivateTransitIP) 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 *PrivateTransitIPInitParameters) DeepCopyInto(out *PrivateTransitIPInitParameters) { + *out = *in + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.IPAddress != nil { + in, out := &in.IPAddress, &out.IPAddress + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateTransitIPInitParameters. +func (in *PrivateTransitIPInitParameters) DeepCopy() *PrivateTransitIPInitParameters { + if in == nil { + return nil + } + out := new(PrivateTransitIPInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateTransitIPList) DeepCopyInto(out *PrivateTransitIPList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PrivateTransitIP, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateTransitIPList. +func (in *PrivateTransitIPList) DeepCopy() *PrivateTransitIPList { + if in == nil { + return nil + } + out := new(PrivateTransitIPList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PrivateTransitIPList) 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 *PrivateTransitIPObservation) DeepCopyInto(out *PrivateTransitIPObservation) { + *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.GatewayID != nil { + in, out := &in.GatewayID, &out.GatewayID + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.IPAddress != nil { + in, out := &in.IPAddress, &out.IPAddress + *out = new(string) + **out = **in + } + if in.NetworkInterfaceID != nil { + in, out := &in.NetworkInterfaceID, &out.NetworkInterfaceID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.UpdatedAt != nil { + in, out := &in.UpdatedAt, &out.UpdatedAt + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateTransitIPObservation. +func (in *PrivateTransitIPObservation) DeepCopy() *PrivateTransitIPObservation { + if in == nil { + return nil + } + out := new(PrivateTransitIPObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateTransitIPParameters) DeepCopyInto(out *PrivateTransitIPParameters) { + *out = *in + if in.EnterpriseProjectID != nil { + in, out := &in.EnterpriseProjectID, &out.EnterpriseProjectID + *out = new(string) + **out = **in + } + if in.IPAddress != nil { + in, out := &in.IPAddress, &out.IPAddress + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateTransitIPParameters. +func (in *PrivateTransitIPParameters) DeepCopy() *PrivateTransitIPParameters { + if in == nil { + return nil + } + out := new(PrivateTransitIPParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateTransitIPSpec) DeepCopyInto(out *PrivateTransitIPSpec) { + *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 PrivateTransitIPSpec. +func (in *PrivateTransitIPSpec) DeepCopy() *PrivateTransitIPSpec { + if in == nil { + return nil + } + out := new(PrivateTransitIPSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PrivateTransitIPStatus) DeepCopyInto(out *PrivateTransitIPStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrivateTransitIPStatus. +func (in *PrivateTransitIPStatus) DeepCopy() *PrivateTransitIPStatus { + if in == nil { + return nil + } + out := new(PrivateTransitIPStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SnatRule) DeepCopyInto(out *SnatRule) { + *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 SnatRule. +func (in *SnatRule) DeepCopy() *SnatRule { + if in == nil { + return nil + } + out := new(SnatRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SnatRule) 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 *SnatRuleInitParameters) DeepCopyInto(out *SnatRuleInitParameters) { + *out = *in + if in.Cidr != nil { + in, out := &in.Cidr, &out.Cidr + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.FloatingIPID != nil { + in, out := &in.FloatingIPID, &out.FloatingIPID + *out = new(string) + **out = **in + } + if in.FloatingIPIDRef != nil { + in, out := &in.FloatingIPIDRef, &out.FloatingIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.FloatingIPIDSelector != nil { + in, out := &in.FloatingIPIDSelector, &out.FloatingIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.GlobalEIPID != nil { + in, out := &in.GlobalEIPID, &out.GlobalEIPID + *out = new(string) + **out = **in + } + if in.GlobalEIPIDRef != nil { + in, out := &in.GlobalEIPIDRef, &out.GlobalEIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.GlobalEIPIDSelector != nil { + in, out := &in.GlobalEIPIDSelector, &out.GlobalEIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.NATGatewayID != nil { + in, out := &in.NATGatewayID, &out.NATGatewayID + *out = new(string) + **out = **in + } + if in.NATGatewayIDRef != nil { + in, out := &in.NATGatewayIDRef, &out.NATGatewayIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NATGatewayIDSelector != nil { + in, out := &in.NATGatewayIDSelector, &out.NATGatewayIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.NetworkID != nil { + in, out := &in.NetworkID, &out.NetworkID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SourceType != nil { + in, out := &in.SourceType, &out.SourceType + *out = new(float64) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnatRuleInitParameters. +func (in *SnatRuleInitParameters) DeepCopy() *SnatRuleInitParameters { + if in == nil { + return nil + } + out := new(SnatRuleInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SnatRuleList) DeepCopyInto(out *SnatRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SnatRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnatRuleList. +func (in *SnatRuleList) DeepCopy() *SnatRuleList { + if in == nil { + return nil + } + out := new(SnatRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SnatRuleList) 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 *SnatRuleObservation) DeepCopyInto(out *SnatRuleObservation) { + *out = *in + if in.Cidr != nil { + in, out := &in.Cidr, &out.Cidr + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.FloatingIPAddress != nil { + in, out := &in.FloatingIPAddress, &out.FloatingIPAddress + *out = new(string) + **out = **in + } + if in.FloatingIPID != nil { + in, out := &in.FloatingIPID, &out.FloatingIPID + *out = new(string) + **out = **in + } + if in.GlobalEIPAddress != nil { + in, out := &in.GlobalEIPAddress, &out.GlobalEIPAddress + *out = new(string) + **out = **in + } + if in.GlobalEIPID != nil { + in, out := &in.GlobalEIPID, &out.GlobalEIPID + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.NATGatewayID != nil { + in, out := &in.NATGatewayID, &out.NATGatewayID + *out = new(string) + **out = **in + } + if in.NetworkID != nil { + in, out := &in.NetworkID, &out.NetworkID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SourceType != nil { + in, out := &in.SourceType, &out.SourceType + *out = new(float64) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnatRuleObservation. +func (in *SnatRuleObservation) DeepCopy() *SnatRuleObservation { + if in == nil { + return nil + } + out := new(SnatRuleObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SnatRuleParameters) DeepCopyInto(out *SnatRuleParameters) { + *out = *in + if in.Cidr != nil { + in, out := &in.Cidr, &out.Cidr + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.FloatingIPID != nil { + in, out := &in.FloatingIPID, &out.FloatingIPID + *out = new(string) + **out = **in + } + if in.FloatingIPIDRef != nil { + in, out := &in.FloatingIPIDRef, &out.FloatingIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.FloatingIPIDSelector != nil { + in, out := &in.FloatingIPIDSelector, &out.FloatingIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.GlobalEIPID != nil { + in, out := &in.GlobalEIPID, &out.GlobalEIPID + *out = new(string) + **out = **in + } + if in.GlobalEIPIDRef != nil { + in, out := &in.GlobalEIPIDRef, &out.GlobalEIPIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.GlobalEIPIDSelector != nil { + in, out := &in.GlobalEIPIDSelector, &out.GlobalEIPIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.NATGatewayID != nil { + in, out := &in.NATGatewayID, &out.NATGatewayID + *out = new(string) + **out = **in + } + if in.NATGatewayIDRef != nil { + in, out := &in.NATGatewayIDRef, &out.NATGatewayIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.NATGatewayIDSelector != nil { + in, out := &in.NATGatewayIDSelector, &out.NATGatewayIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.NetworkID != nil { + in, out := &in.NetworkID, &out.NetworkID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SourceType != nil { + in, out := &in.SourceType, &out.SourceType + *out = new(float64) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(string) + **out = **in + } + if in.SubnetIDRef != nil { + in, out := &in.SubnetIDRef, &out.SubnetIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.SubnetIDSelector != nil { + in, out := &in.SubnetIDSelector, &out.SubnetIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnatRuleParameters. +func (in *SnatRuleParameters) DeepCopy() *SnatRuleParameters { + if in == nil { + return nil + } + out := new(SnatRuleParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SnatRuleSpec) DeepCopyInto(out *SnatRuleSpec) { + *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 SnatRuleSpec. +func (in *SnatRuleSpec) DeepCopy() *SnatRuleSpec { + if in == nil { + return nil + } + out := new(SnatRuleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SnatRuleStatus) DeepCopyInto(out *SnatRuleStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnatRuleStatus. +func (in *SnatRuleStatus) DeepCopy() *SnatRuleStatus { + if in == nil { + return nil + } + out := new(SnatRuleStatus) + in.DeepCopyInto(out) + return out +} diff --git a/apis/nat/v1alpha1/zz_generated.managed.go b/apis/nat/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..36bfa51 --- /dev/null +++ b/apis/nat/v1alpha1/zz_generated.managed.go @@ -0,0 +1,429 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this DnatRule. +func (mg *DnatRule) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this DnatRule. +func (mg *DnatRule) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this DnatRule. +func (mg *DnatRule) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this DnatRule. +func (mg *DnatRule) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this DnatRule. +func (mg *DnatRule) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this DnatRule. +func (mg *DnatRule) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this DnatRule. +func (mg *DnatRule) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this DnatRule. +func (mg *DnatRule) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this DnatRule. +func (mg *DnatRule) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this DnatRule. +func (mg *DnatRule) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this DnatRule. +func (mg *DnatRule) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this DnatRule. +func (mg *DnatRule) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this Gateway. +func (mg *Gateway) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Gateway. +func (mg *Gateway) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this Gateway. +func (mg *Gateway) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this Gateway. +func (mg *Gateway) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this Gateway. +func (mg *Gateway) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Gateway. +func (mg *Gateway) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Gateway. +func (mg *Gateway) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Gateway. +func (mg *Gateway) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this Gateway. +func (mg *Gateway) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this Gateway. +func (mg *Gateway) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this Gateway. +func (mg *Gateway) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Gateway. +func (mg *Gateway) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this PrivateDnatRule. +func (mg *PrivateDnatRule) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this PrivateDnatRule. +func (mg *PrivateDnatRule) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this PrivateDnatRule. +func (mg *PrivateDnatRule) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this PrivateDnatRule. +func (mg *PrivateDnatRule) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this PrivateDnatRule. +func (mg *PrivateDnatRule) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this PrivateDnatRule. +func (mg *PrivateDnatRule) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this PrivateDnatRule. +func (mg *PrivateDnatRule) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this PrivateDnatRule. +func (mg *PrivateDnatRule) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this PrivateDnatRule. +func (mg *PrivateDnatRule) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this PrivateDnatRule. +func (mg *PrivateDnatRule) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this PrivateDnatRule. +func (mg *PrivateDnatRule) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this PrivateDnatRule. +func (mg *PrivateDnatRule) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this PrivateGateway. +func (mg *PrivateGateway) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this PrivateGateway. +func (mg *PrivateGateway) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this PrivateGateway. +func (mg *PrivateGateway) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this PrivateGateway. +func (mg *PrivateGateway) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this PrivateGateway. +func (mg *PrivateGateway) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this PrivateGateway. +func (mg *PrivateGateway) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this PrivateGateway. +func (mg *PrivateGateway) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this PrivateGateway. +func (mg *PrivateGateway) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this PrivateGateway. +func (mg *PrivateGateway) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this PrivateGateway. +func (mg *PrivateGateway) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this PrivateGateway. +func (mg *PrivateGateway) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this PrivateGateway. +func (mg *PrivateGateway) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this PrivateSnatRule. +func (mg *PrivateSnatRule) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this PrivateSnatRule. +func (mg *PrivateSnatRule) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this PrivateSnatRule. +func (mg *PrivateSnatRule) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this PrivateSnatRule. +func (mg *PrivateSnatRule) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this PrivateSnatRule. +func (mg *PrivateSnatRule) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this PrivateSnatRule. +func (mg *PrivateSnatRule) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this PrivateSnatRule. +func (mg *PrivateSnatRule) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this PrivateSnatRule. +func (mg *PrivateSnatRule) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this PrivateSnatRule. +func (mg *PrivateSnatRule) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this PrivateSnatRule. +func (mg *PrivateSnatRule) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this PrivateSnatRule. +func (mg *PrivateSnatRule) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this PrivateSnatRule. +func (mg *PrivateSnatRule) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this PrivateTransitIP. +func (mg *PrivateTransitIP) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this PrivateTransitIP. +func (mg *PrivateTransitIP) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this PrivateTransitIP. +func (mg *PrivateTransitIP) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this PrivateTransitIP. +func (mg *PrivateTransitIP) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this PrivateTransitIP. +func (mg *PrivateTransitIP) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this PrivateTransitIP. +func (mg *PrivateTransitIP) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this PrivateTransitIP. +func (mg *PrivateTransitIP) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this PrivateTransitIP. +func (mg *PrivateTransitIP) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this PrivateTransitIP. +func (mg *PrivateTransitIP) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this PrivateTransitIP. +func (mg *PrivateTransitIP) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this PrivateTransitIP. +func (mg *PrivateTransitIP) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this PrivateTransitIP. +func (mg *PrivateTransitIP) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this SnatRule. +func (mg *SnatRule) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this SnatRule. +func (mg *SnatRule) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this SnatRule. +func (mg *SnatRule) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this SnatRule. +func (mg *SnatRule) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this SnatRule. +func (mg *SnatRule) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this SnatRule. +func (mg *SnatRule) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this SnatRule. +func (mg *SnatRule) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this SnatRule. +func (mg *SnatRule) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this SnatRule. +func (mg *SnatRule) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this SnatRule. +func (mg *SnatRule) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this SnatRule. +func (mg *SnatRule) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this SnatRule. +func (mg *SnatRule) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/nat/v1alpha1/zz_generated.managedlist.go b/apis/nat/v1alpha1/zz_generated.managedlist.go new file mode 100644 index 0000000..998360b --- /dev/null +++ b/apis/nat/v1alpha1/zz_generated.managedlist.go @@ -0,0 +1,72 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this DnatRuleList. +func (l *DnatRuleList) 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 GatewayList. +func (l *GatewayList) 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 PrivateDnatRuleList. +func (l *PrivateDnatRuleList) 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 PrivateGatewayList. +func (l *PrivateGatewayList) 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 PrivateSnatRuleList. +func (l *PrivateSnatRuleList) 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 PrivateTransitIPList. +func (l *PrivateTransitIPList) 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 SnatRuleList. +func (l *SnatRuleList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} diff --git a/apis/nat/v1alpha1/zz_generated.resolvers.go b/apis/nat/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..fa94a43 --- /dev/null +++ b/apis/nat/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,599 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + resource "github.com/crossplane/upjet/pkg/resource" + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/eip/v1alpha1" + v1alpha11 "github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this DnatRule. +func (mg *DnatRule) 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.FloatingIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.FloatingIPIDRef, + Selector: mg.Spec.ForProvider.FloatingIPIDSelector, + To: reference.To{ + List: &v1alpha1.VpcEipList{}, + Managed: &v1alpha1.VpcEip{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.FloatingIPID") + } + mg.Spec.ForProvider.FloatingIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.FloatingIPIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.GlobalEIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.GlobalEIPIDRef, + Selector: mg.Spec.ForProvider.GlobalEIPIDSelector, + To: reference.To{ + List: &v1alpha1.GlobalEipList{}, + Managed: &v1alpha1.GlobalEip{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.GlobalEIPID") + } + mg.Spec.ForProvider.GlobalEIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.GlobalEIPIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.NATGatewayID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.NATGatewayIDRef, + Selector: mg.Spec.ForProvider.NATGatewayIDSelector, + To: reference.To{ + List: &GatewayList{}, + Managed: &Gateway{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.NATGatewayID") + } + mg.Spec.ForProvider.NATGatewayID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.NATGatewayIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.FloatingIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.FloatingIPIDRef, + Selector: mg.Spec.InitProvider.FloatingIPIDSelector, + To: reference.To{ + List: &v1alpha1.VpcEipList{}, + Managed: &v1alpha1.VpcEip{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.FloatingIPID") + } + mg.Spec.InitProvider.FloatingIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.FloatingIPIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.GlobalEIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.GlobalEIPIDRef, + Selector: mg.Spec.InitProvider.GlobalEIPIDSelector, + To: reference.To{ + List: &v1alpha1.GlobalEipList{}, + Managed: &v1alpha1.GlobalEip{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.GlobalEIPID") + } + mg.Spec.InitProvider.GlobalEIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.GlobalEIPIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.NATGatewayID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.NATGatewayIDRef, + Selector: mg.Spec.InitProvider.NATGatewayIDSelector, + To: reference.To{ + List: &GatewayList{}, + Managed: &Gateway{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.NATGatewayID") + } + mg.Spec.InitProvider.NATGatewayID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.NATGatewayIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this Gateway. +func (mg *Gateway) 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.SubnetID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.SubnetIDRef, + Selector: mg.Spec.ForProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha11.SubnetList{}, + Managed: &v1alpha11.Subnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SubnetID") + } + mg.Spec.ForProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.SubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VPCID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.VPCIDRef, + Selector: mg.Spec.ForProvider.VPCIDSelector, + To: reference.To{ + List: &v1alpha11.VPCList{}, + Managed: &v1alpha11.VPC{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.VPCID") + } + mg.Spec.ForProvider.VPCID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.VPCIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.SubnetID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.SubnetIDRef, + Selector: mg.Spec.InitProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha11.SubnetList{}, + Managed: &v1alpha11.Subnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.SubnetID") + } + mg.Spec.InitProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.SubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.VPCID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.VPCIDRef, + Selector: mg.Spec.InitProvider.VPCIDSelector, + To: reference.To{ + List: &v1alpha11.VPCList{}, + Managed: &v1alpha11.VPC{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.VPCID") + } + mg.Spec.InitProvider.VPCID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.VPCIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this PrivateDnatRule. +func (mg *PrivateDnatRule) 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.GatewayID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.GatewayIDRef, + Selector: mg.Spec.ForProvider.GatewayIDSelector, + To: reference.To{ + List: &PrivateGatewayList{}, + Managed: &PrivateGateway{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.GatewayID") + } + mg.Spec.ForProvider.GatewayID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.GatewayIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.TransitIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.TransitIPIDRef, + Selector: mg.Spec.ForProvider.TransitIPIDSelector, + To: reference.To{ + List: &PrivateTransitIPList{}, + Managed: &PrivateTransitIP{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.TransitIPID") + } + mg.Spec.ForProvider.TransitIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.TransitIPIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.GatewayID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.GatewayIDRef, + Selector: mg.Spec.InitProvider.GatewayIDSelector, + To: reference.To{ + List: &PrivateGatewayList{}, + Managed: &PrivateGateway{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.GatewayID") + } + mg.Spec.InitProvider.GatewayID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.GatewayIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.TransitIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.TransitIPIDRef, + Selector: mg.Spec.InitProvider.TransitIPIDSelector, + To: reference.To{ + List: &PrivateTransitIPList{}, + Managed: &PrivateTransitIP{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.TransitIPID") + } + mg.Spec.InitProvider.TransitIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.TransitIPIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this PrivateGateway. +func (mg *PrivateGateway) 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.SubnetID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.SubnetIDRef, + Selector: mg.Spec.ForProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha11.SubnetList{}, + Managed: &v1alpha11.Subnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SubnetID") + } + mg.Spec.ForProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.SubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.SubnetID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.SubnetIDRef, + Selector: mg.Spec.InitProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha11.SubnetList{}, + Managed: &v1alpha11.Subnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.SubnetID") + } + mg.Spec.InitProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.SubnetIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this PrivateSnatRule. +func (mg *PrivateSnatRule) 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.GatewayID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.GatewayIDRef, + Selector: mg.Spec.ForProvider.GatewayIDSelector, + To: reference.To{ + List: &PrivateGatewayList{}, + Managed: &PrivateGateway{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.GatewayID") + } + mg.Spec.ForProvider.GatewayID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.GatewayIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.SubnetID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.SubnetIDRef, + Selector: mg.Spec.ForProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha11.SubnetList{}, + Managed: &v1alpha11.Subnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SubnetID") + } + mg.Spec.ForProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.SubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.TransitIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.TransitIPIDRef, + Selector: mg.Spec.ForProvider.TransitIPIDSelector, + To: reference.To{ + List: &PrivateTransitIPList{}, + Managed: &PrivateTransitIP{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.TransitIPID") + } + mg.Spec.ForProvider.TransitIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.TransitIPIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.GatewayID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.GatewayIDRef, + Selector: mg.Spec.InitProvider.GatewayIDSelector, + To: reference.To{ + List: &PrivateGatewayList{}, + Managed: &PrivateGateway{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.GatewayID") + } + mg.Spec.InitProvider.GatewayID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.GatewayIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.SubnetID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.SubnetIDRef, + Selector: mg.Spec.InitProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha11.SubnetList{}, + Managed: &v1alpha11.Subnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.SubnetID") + } + mg.Spec.InitProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.SubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.TransitIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.TransitIPIDRef, + Selector: mg.Spec.InitProvider.TransitIPIDSelector, + To: reference.To{ + List: &PrivateTransitIPList{}, + Managed: &PrivateTransitIP{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.TransitIPID") + } + mg.Spec.InitProvider.TransitIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.TransitIPIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this PrivateTransitIP. +func (mg *PrivateTransitIP) 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.SubnetID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.SubnetIDRef, + Selector: mg.Spec.ForProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha11.SubnetList{}, + Managed: &v1alpha11.Subnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SubnetID") + } + mg.Spec.ForProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.SubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.SubnetID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.SubnetIDRef, + Selector: mg.Spec.InitProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha11.SubnetList{}, + Managed: &v1alpha11.Subnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.SubnetID") + } + mg.Spec.InitProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.SubnetIDRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this SnatRule. +func (mg *SnatRule) 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.FloatingIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.FloatingIPIDRef, + Selector: mg.Spec.ForProvider.FloatingIPIDSelector, + To: reference.To{ + List: &v1alpha1.VpcEipList{}, + Managed: &v1alpha1.VpcEip{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.FloatingIPID") + } + mg.Spec.ForProvider.FloatingIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.FloatingIPIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.GlobalEIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.GlobalEIPIDRef, + Selector: mg.Spec.ForProvider.GlobalEIPIDSelector, + To: reference.To{ + List: &v1alpha1.GlobalEipList{}, + Managed: &v1alpha1.GlobalEip{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.GlobalEIPID") + } + mg.Spec.ForProvider.GlobalEIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.GlobalEIPIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.NATGatewayID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.NATGatewayIDRef, + Selector: mg.Spec.ForProvider.NATGatewayIDSelector, + To: reference.To{ + List: &GatewayList{}, + Managed: &Gateway{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.NATGatewayID") + } + mg.Spec.ForProvider.NATGatewayID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.NATGatewayIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.SubnetID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.ForProvider.SubnetIDRef, + Selector: mg.Spec.ForProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha11.SubnetList{}, + Managed: &v1alpha11.Subnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.SubnetID") + } + mg.Spec.ForProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.SubnetIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.FloatingIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.FloatingIPIDRef, + Selector: mg.Spec.InitProvider.FloatingIPIDSelector, + To: reference.To{ + List: &v1alpha1.VpcEipList{}, + Managed: &v1alpha1.VpcEip{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.FloatingIPID") + } + mg.Spec.InitProvider.FloatingIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.FloatingIPIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.GlobalEIPID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.GlobalEIPIDRef, + Selector: mg.Spec.InitProvider.GlobalEIPIDSelector, + To: reference.To{ + List: &v1alpha1.GlobalEipList{}, + Managed: &v1alpha1.GlobalEip{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.GlobalEIPID") + } + mg.Spec.InitProvider.GlobalEIPID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.GlobalEIPIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.NATGatewayID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.NATGatewayIDRef, + Selector: mg.Spec.InitProvider.NATGatewayIDSelector, + To: reference.To{ + List: &GatewayList{}, + Managed: &Gateway{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.NATGatewayID") + } + mg.Spec.InitProvider.NATGatewayID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.NATGatewayIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.SubnetID), + Extract: resource.ExtractResourceID(), + Reference: mg.Spec.InitProvider.SubnetIDRef, + Selector: mg.Spec.InitProvider.SubnetIDSelector, + To: reference.To{ + List: &v1alpha11.SubnetList{}, + Managed: &v1alpha11.Subnet{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.SubnetID") + } + mg.Spec.InitProvider.SubnetID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.SubnetIDRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/nat/v1alpha1/zz_groupversion_info.go b/apis/nat/v1alpha1/zz_groupversion_info.go new file mode 100755 index 0000000..920acc4 --- /dev/null +++ b/apis/nat/v1alpha1/zz_groupversion_info.go @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +// +kubebuilder:object:generate=true +// +groupName=nat.huaweicloud.crossplane.io +// +versionName=v1alpha1 +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// Package type metadata. +const ( + CRDGroup = "nat.huaweicloud.crossplane.io" + CRDVersion = "v1alpha1" +) + +var ( + // CRDGroupVersion is the API Group Version used to register the objects + CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/nat/v1alpha1/zz_privatednatrule_terraformed.go b/apis/nat/v1alpha1/zz_privatednatrule_terraformed.go new file mode 100755 index 0000000..6a3d483 --- /dev/null +++ b/apis/nat/v1alpha1/zz_privatednatrule_terraformed.go @@ -0,0 +1,135 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this PrivateDnatRule +func (mg *PrivateDnatRule) GetTerraformResourceType() string { + return "huaweicloud_nat_private_dnat_rule" +} + +// GetConnectionDetailsMapping for this PrivateDnatRule +func (tr *PrivateDnatRule) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this PrivateDnatRule +func (tr *PrivateDnatRule) 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 PrivateDnatRule +func (tr *PrivateDnatRule) 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 PrivateDnatRule +func (tr *PrivateDnatRule) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this PrivateDnatRule +func (tr *PrivateDnatRule) 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 PrivateDnatRule +func (tr *PrivateDnatRule) 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 PrivateDnatRule +func (tr *PrivateDnatRule) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this PrivateDnatRule +func (tr *PrivateDnatRule) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this PrivateDnatRule using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *PrivateDnatRule) LateInitialize(attrs []byte) (bool, error) { + params := &PrivateDnatRuleParameters{} + 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)} + initParams, err := tr.GetInitParameters() + if err != nil { + return false, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + opts = append(opts, resource.WithConditionalFilter("BackendInterfaceID", initParams)) + opts = append(opts, resource.WithConditionalFilter("BackendPrivateIP", initParams)) + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *PrivateDnatRule) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/nat/v1alpha1/zz_privatednatrule_types.go b/apis/nat/v1alpha1/zz_privatednatrule_types.go new file mode 100755 index 0000000..8c9ba62 --- /dev/null +++ b/apis/nat/v1alpha1/zz_privatednatrule_types.go @@ -0,0 +1,276 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 PrivateDnatRuleInitParameters struct { + + // Specifies the network interface ID of the transit IP for private NAT. + // Exactly one of backend_interface_id and backend_private_ip must be set. + // The network interface ID of the transit IP for private NAT. + BackendInterfaceID *string `json:"backendInterfaceId,omitempty" tf:"backend_interface_id,omitempty"` + + // Specifies the private IP address of the backend instance. + // The private IP address of the backend instance. + BackendPrivateIP *string `json:"backendPrivateIp,omitempty" tf:"backend_private_ip,omitempty"` + + // Specifies the description of the DNAT rule, which contain maximum of 255 + // characters, and angle brackets (< and >) are not allowed. + // The description of the DNAT rule. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the private NAT gateway ID to which the DNAT rule belongs. + // Changing this will create a new resource. + // The private NAT gateway ID to which the DNAT rule belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.PrivateGateway + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + GatewayID *string `json:"gatewayId,omitempty" tf:"gateway_id,omitempty"` + + // Reference to a PrivateGateway in nat to populate gatewayId. + // +kubebuilder:validation:Optional + GatewayIDRef *v1.Reference `json:"gatewayIdRef,omitempty" tf:"-"` + + // Selector for a PrivateGateway in nat to populate gatewayId. + // +kubebuilder:validation:Optional + GatewayIDSelector *v1.Selector `json:"gatewayIdSelector,omitempty" tf:"-"` + + // Specifies the port of the backend instance. + // The port of the backend instance. + InternalServicePort *float64 `json:"internalServicePort,omitempty" tf:"internal_service_port,omitempty"` + + // Specifies the protocol type. + // The valid values are tcp, udp and any. Defaults to any. + // The protocol type. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region where the DNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the DNAT rule is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the ID of the transit IP for private NAT. + // The ID of the transit IP for private NAT. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.PrivateTransitIP + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + TransitIPID *string `json:"transitIpId,omitempty" tf:"transit_ip_id,omitempty"` + + // Reference to a PrivateTransitIP in nat to populate transitIpId. + // +kubebuilder:validation:Optional + TransitIPIDRef *v1.Reference `json:"transitIpIdRef,omitempty" tf:"-"` + + // Selector for a PrivateTransitIP in nat to populate transitIpId. + // +kubebuilder:validation:Optional + TransitIPIDSelector *v1.Selector `json:"transitIpIdSelector,omitempty" tf:"-"` + + // Specifies the port of the transit IP. + // The port of the transit IP. + TransitServicePort *float64 `json:"transitServicePort,omitempty" tf:"transit_service_port,omitempty"` +} + +type PrivateDnatRuleObservation struct { + + // Specifies the network interface ID of the transit IP for private NAT. + // Exactly one of backend_interface_id and backend_private_ip must be set. + // The network interface ID of the transit IP for private NAT. + BackendInterfaceID *string `json:"backendInterfaceId,omitempty" tf:"backend_interface_id,omitempty"` + + // Specifies the private IP address of the backend instance. + // The private IP address of the backend instance. + BackendPrivateIP *string `json:"backendPrivateIp,omitempty" tf:"backend_private_ip,omitempty"` + + // The type of backend instance. + // The valid values are as follows: + // The type of backend instance. + BackendType *string `json:"backendType,omitempty" tf:"backend_type,omitempty"` + + // The creation time of the DNAT rule. + // The creation time of the DNAT rule. + CreatedAt *string `json:"createdAt,omitempty" tf:"created_at,omitempty"` + + // Specifies the description of the DNAT rule, which contain maximum of 255 + // characters, and angle brackets (< and >) are not allowed. + // The description of the DNAT rule. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The ID of the enterprise project to which the private DNAT rule belongs. + // The ID of the enterprise project to which the private DNAT rule belongs. + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // Specifies the private NAT gateway ID to which the DNAT rule belongs. + // Changing this will create a new resource. + // The private NAT gateway ID to which the DNAT rule belongs. + GatewayID *string `json:"gatewayId,omitempty" tf:"gateway_id,omitempty"` + + // The resource ID in UUID format. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies the port of the backend instance. + // The port of the backend instance. + InternalServicePort *float64 `json:"internalServicePort,omitempty" tf:"internal_service_port,omitempty"` + + // Specifies the protocol type. + // The valid values are tcp, udp and any. Defaults to any. + // The protocol type. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region where the DNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the DNAT rule is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the ID of the transit IP for private NAT. + // The ID of the transit IP for private NAT. + TransitIPID *string `json:"transitIpId,omitempty" tf:"transit_ip_id,omitempty"` + + // Specifies the port of the transit IP. + // The port of the transit IP. + TransitServicePort *float64 `json:"transitServicePort,omitempty" tf:"transit_service_port,omitempty"` + + // The latest update time of the DNAT rule. + // The latest update time of the DNAT rule. + UpdatedAt *string `json:"updatedAt,omitempty" tf:"updated_at,omitempty"` +} + +type PrivateDnatRuleParameters struct { + + // Specifies the network interface ID of the transit IP for private NAT. + // Exactly one of backend_interface_id and backend_private_ip must be set. + // The network interface ID of the transit IP for private NAT. + // +kubebuilder:validation:Optional + BackendInterfaceID *string `json:"backendInterfaceId,omitempty" tf:"backend_interface_id,omitempty"` + + // Specifies the private IP address of the backend instance. + // The private IP address of the backend instance. + // +kubebuilder:validation:Optional + BackendPrivateIP *string `json:"backendPrivateIp,omitempty" tf:"backend_private_ip,omitempty"` + + // Specifies the description of the DNAT rule, which contain maximum of 255 + // characters, and angle brackets (< and >) are not allowed. + // The description of the DNAT rule. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the private NAT gateway ID to which the DNAT rule belongs. + // Changing this will create a new resource. + // The private NAT gateway ID to which the DNAT rule belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.PrivateGateway + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + GatewayID *string `json:"gatewayId,omitempty" tf:"gateway_id,omitempty"` + + // Reference to a PrivateGateway in nat to populate gatewayId. + // +kubebuilder:validation:Optional + GatewayIDRef *v1.Reference `json:"gatewayIdRef,omitempty" tf:"-"` + + // Selector for a PrivateGateway in nat to populate gatewayId. + // +kubebuilder:validation:Optional + GatewayIDSelector *v1.Selector `json:"gatewayIdSelector,omitempty" tf:"-"` + + // Specifies the port of the backend instance. + // The port of the backend instance. + // +kubebuilder:validation:Optional + InternalServicePort *float64 `json:"internalServicePort,omitempty" tf:"internal_service_port,omitempty"` + + // Specifies the protocol type. + // The valid values are tcp, udp and any. Defaults to any. + // The protocol type. + // +kubebuilder:validation:Optional + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Specifies the region where the DNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the DNAT rule is located. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the ID of the transit IP for private NAT. + // The ID of the transit IP for private NAT. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.PrivateTransitIP + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + TransitIPID *string `json:"transitIpId,omitempty" tf:"transit_ip_id,omitempty"` + + // Reference to a PrivateTransitIP in nat to populate transitIpId. + // +kubebuilder:validation:Optional + TransitIPIDRef *v1.Reference `json:"transitIpIdRef,omitempty" tf:"-"` + + // Selector for a PrivateTransitIP in nat to populate transitIpId. + // +kubebuilder:validation:Optional + TransitIPIDSelector *v1.Selector `json:"transitIpIdSelector,omitempty" tf:"-"` + + // Specifies the port of the transit IP. + // The port of the transit IP. + // +kubebuilder:validation:Optional + TransitServicePort *float64 `json:"transitServicePort,omitempty" tf:"transit_service_port,omitempty"` +} + +// PrivateDnatRuleSpec defines the desired state of PrivateDnatRule +type PrivateDnatRuleSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider PrivateDnatRuleParameters `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 PrivateDnatRuleInitParameters `json:"initProvider,omitempty"` +} + +// PrivateDnatRuleStatus defines the observed state of PrivateDnatRule. +type PrivateDnatRuleStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider PrivateDnatRuleObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// PrivateDnatRule is the Schema for the PrivateDnatRules API. "" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type PrivateDnatRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec PrivateDnatRuleSpec `json:"spec"` + Status PrivateDnatRuleStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// PrivateDnatRuleList contains a list of PrivateDnatRules +type PrivateDnatRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []PrivateDnatRule `json:"items"` +} + +// Repository type metadata. +var ( + PrivateDnatRule_Kind = "PrivateDnatRule" + PrivateDnatRule_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: PrivateDnatRule_Kind}.String() + PrivateDnatRule_KindAPIVersion = PrivateDnatRule_Kind + "." + CRDGroupVersion.String() + PrivateDnatRule_GroupVersionKind = CRDGroupVersion.WithKind(PrivateDnatRule_Kind) +) + +func init() { + SchemeBuilder.Register(&PrivateDnatRule{}, &PrivateDnatRuleList{}) +} diff --git a/apis/nat/v1alpha1/zz_privategateway_terraformed.go b/apis/nat/v1alpha1/zz_privategateway_terraformed.go new file mode 100755 index 0000000..e020e8e --- /dev/null +++ b/apis/nat/v1alpha1/zz_privategateway_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this PrivateGateway +func (mg *PrivateGateway) GetTerraformResourceType() string { + return "huaweicloud_nat_private_gateway" +} + +// GetConnectionDetailsMapping for this PrivateGateway +func (tr *PrivateGateway) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this PrivateGateway +func (tr *PrivateGateway) 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 PrivateGateway +func (tr *PrivateGateway) 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 PrivateGateway +func (tr *PrivateGateway) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this PrivateGateway +func (tr *PrivateGateway) 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 PrivateGateway +func (tr *PrivateGateway) 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 PrivateGateway +func (tr *PrivateGateway) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this PrivateGateway +func (tr *PrivateGateway) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this PrivateGateway using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *PrivateGateway) LateInitialize(attrs []byte) (bool, error) { + params := &PrivateGatewayParameters{} + 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 *PrivateGateway) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/nat/v1alpha1/zz_privategateway_types.go b/apis/nat/v1alpha1/zz_privategateway_types.go new file mode 100755 index 0000000..d8c7c09 --- /dev/null +++ b/apis/nat/v1alpha1/zz_privategateway_types.go @@ -0,0 +1,242 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 PrivateGatewayInitParameters struct { + + // Specifies the description of the private NAT gateway, which contain maximum of + // 255 characters, and angle brackets (< and >) are not allowed. + // The description of the private NAT gateway. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the ID of the enterprise project to which the private + // NAT gateway belongs. + // Changing this will create a new resource. + // The ID of the enterprise project to which the private NAT gateway belongs. + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // Specifies the private NAT gateway name. + // The valid length is limited from 1 to 64, only English letters, Chinese characters, digits, hyphens (-) and + // underscores (_) are allowed. + // The name of the private NAT gateway. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the region where the private NAT gateway is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the private NAT gateway is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the specification of the private NAT gateway. + // The valid values are as follows: + // The specification of the private NAT gateway. + Spec *string `json:"spec,omitempty" tf:"spec,omitempty"` + + // Specifies the network ID of the subnet to which the private NAT gateway + // belongs. + // Changing this will create a new resource. + // The network ID of the subnet to which the private NAT gateway belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.Subnet + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Reference to a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + + // Specifies the key/value pairs to associate with the private NAT gateway. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +type PrivateGatewayObservation struct { + + // The creation time of the private NAT gateway. + // The creation time of the private NAT gateway. + CreatedAt *string `json:"createdAt,omitempty" tf:"created_at,omitempty"` + + // Specifies the description of the private NAT gateway, which contain maximum of + // 255 characters, and angle brackets (< and >) are not allowed. + // The description of the private NAT gateway. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the ID of the enterprise project to which the private + // NAT gateway belongs. + // Changing this will create a new resource. + // The ID of the enterprise project to which the private NAT gateway belongs. + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // The resource ID in UUID format. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies the private NAT gateway name. + // The valid length is limited from 1 to 64, only English letters, Chinese characters, digits, hyphens (-) and + // underscores (_) are allowed. + // The name of the private NAT gateway. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the region where the private NAT gateway is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the private NAT gateway is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the specification of the private NAT gateway. + // The valid values are as follows: + // The specification of the private NAT gateway. + Spec *string `json:"spec,omitempty" tf:"spec,omitempty"` + + // The current status of the private NAT gateway. + // The current status of the private NAT gateway. + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // Specifies the network ID of the subnet to which the private NAT gateway + // belongs. + // Changing this will create a new resource. + // The network ID of the subnet to which the private NAT gateway belongs. + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Specifies the key/value pairs to associate with the private NAT gateway. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // The latest update time of the private NAT gateway. + // The latest update time of the private NAT gateway. + UpdatedAt *string `json:"updatedAt,omitempty" tf:"updated_at,omitempty"` + + // The ID of the VPC to which the private NAT gateway belongs. + // The ID of the VPC to which the private NAT gateway belongs. + VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` +} + +type PrivateGatewayParameters struct { + + // Specifies the description of the private NAT gateway, which contain maximum of + // 255 characters, and angle brackets (< and >) are not allowed. + // The description of the private NAT gateway. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the ID of the enterprise project to which the private + // NAT gateway belongs. + // Changing this will create a new resource. + // The ID of the enterprise project to which the private NAT gateway belongs. + // +kubebuilder:validation:Optional + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // Specifies the private NAT gateway name. + // The valid length is limited from 1 to 64, only English letters, Chinese characters, digits, hyphens (-) and + // underscores (_) are allowed. + // The name of the private NAT gateway. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // Specifies the region where the private NAT gateway is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the private NAT gateway is located. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the specification of the private NAT gateway. + // The valid values are as follows: + // The specification of the private NAT gateway. + // +kubebuilder:validation:Optional + Spec *string `json:"spec,omitempty" tf:"spec,omitempty"` + + // Specifies the network ID of the subnet to which the private NAT gateway + // belongs. + // Changing this will create a new resource. + // The network ID of the subnet to which the private NAT gateway belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.Subnet + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Reference to a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + + // Specifies the key/value pairs to associate with the private NAT gateway. + // +kubebuilder:validation:Optional + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +// PrivateGatewaySpec defines the desired state of PrivateGateway +type PrivateGatewaySpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider PrivateGatewayParameters `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 PrivateGatewayInitParameters `json:"initProvider,omitempty"` +} + +// PrivateGatewayStatus defines the observed state of PrivateGateway. +type PrivateGatewayStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider PrivateGatewayObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// PrivateGateway is the Schema for the PrivateGateways API. "" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type PrivateGateway 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.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" + Spec PrivateGatewaySpec `json:"spec"` + Status PrivateGatewayStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// PrivateGatewayList contains a list of PrivateGateways +type PrivateGatewayList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []PrivateGateway `json:"items"` +} + +// Repository type metadata. +var ( + PrivateGateway_Kind = "PrivateGateway" + PrivateGateway_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: PrivateGateway_Kind}.String() + PrivateGateway_KindAPIVersion = PrivateGateway_Kind + "." + CRDGroupVersion.String() + PrivateGateway_GroupVersionKind = CRDGroupVersion.WithKind(PrivateGateway_Kind) +) + +func init() { + SchemeBuilder.Register(&PrivateGateway{}, &PrivateGatewayList{}) +} diff --git a/apis/nat/v1alpha1/zz_privatesnatrule_terraformed.go b/apis/nat/v1alpha1/zz_privatesnatrule_terraformed.go new file mode 100755 index 0000000..cf59b43 --- /dev/null +++ b/apis/nat/v1alpha1/zz_privatesnatrule_terraformed.go @@ -0,0 +1,135 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this PrivateSnatRule +func (mg *PrivateSnatRule) GetTerraformResourceType() string { + return "huaweicloud_nat_private_snat_rule" +} + +// GetConnectionDetailsMapping for this PrivateSnatRule +func (tr *PrivateSnatRule) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this PrivateSnatRule +func (tr *PrivateSnatRule) 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 PrivateSnatRule +func (tr *PrivateSnatRule) 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 PrivateSnatRule +func (tr *PrivateSnatRule) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this PrivateSnatRule +func (tr *PrivateSnatRule) 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 PrivateSnatRule +func (tr *PrivateSnatRule) 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 PrivateSnatRule +func (tr *PrivateSnatRule) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this PrivateSnatRule +func (tr *PrivateSnatRule) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this PrivateSnatRule using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *PrivateSnatRule) LateInitialize(attrs []byte) (bool, error) { + params := &PrivateSnatRuleParameters{} + 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)} + initParams, err := tr.GetInitParameters() + if err != nil { + return false, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + opts = append(opts, resource.WithConditionalFilter("Cidr", initParams)) + opts = append(opts, resource.WithConditionalFilter("SubnetID", initParams)) + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *PrivateSnatRule) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/nat/v1alpha1/zz_privatesnatrule_types.go b/apis/nat/v1alpha1/zz_privatesnatrule_types.go new file mode 100755 index 0000000..a8eda61 --- /dev/null +++ b/apis/nat/v1alpha1/zz_privatesnatrule_types.go @@ -0,0 +1,259 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 PrivateSnatRuleInitParameters struct { + + // Specifies the CIDR block of the match rule. + // Changing this will create a new resource. + // Exactly one of cidr and subnet_id must be set. + // The CIDR block of the match rule. + Cidr *string `json:"cidr,omitempty" tf:"cidr,omitempty"` + + // Specifies the description of the SNAT rule, which contain maximum of 255 + // characters, and angle brackets (< and >) are not allowed. + // The description of the SNAT rule. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the private NAT gateway ID to which the SNAT rule belongs. + // Changing this will create a new resource. + // The private NAT gateway ID to which the SNAT rule belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.PrivateGateway + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + GatewayID *string `json:"gatewayId,omitempty" tf:"gateway_id,omitempty"` + + // Reference to a PrivateGateway in nat to populate gatewayId. + // +kubebuilder:validation:Optional + GatewayIDRef *v1.Reference `json:"gatewayIdRef,omitempty" tf:"-"` + + // Selector for a PrivateGateway in nat to populate gatewayId. + // +kubebuilder:validation:Optional + GatewayIDSelector *v1.Selector `json:"gatewayIdSelector,omitempty" tf:"-"` + + // Specifies the region where the SNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the SNAT rule is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the subnet ID of the match rule. + // Changing this will create a new resource. + // The subnet ID of the match rule. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.Subnet + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Reference to a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + + // Specifies the ID of the transit IP associated with SNAT rule. + // The ID of the transit IP associated with SNAT rule. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.PrivateTransitIP + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + TransitIPID *string `json:"transitIpId,omitempty" tf:"transit_ip_id,omitempty"` + + // Reference to a PrivateTransitIP in nat to populate transitIpId. + // +kubebuilder:validation:Optional + TransitIPIDRef *v1.Reference `json:"transitIpIdRef,omitempty" tf:"-"` + + // Selector for a PrivateTransitIP in nat to populate transitIpId. + // +kubebuilder:validation:Optional + TransitIPIDSelector *v1.Selector `json:"transitIpIdSelector,omitempty" tf:"-"` +} + +type PrivateSnatRuleObservation struct { + + // Specifies the CIDR block of the match rule. + // Changing this will create a new resource. + // Exactly one of cidr and subnet_id must be set. + // The CIDR block of the match rule. + Cidr *string `json:"cidr,omitempty" tf:"cidr,omitempty"` + + // The creation time of the SNAT rule. + // The creation time of the SNAT rule. + CreatedAt *string `json:"createdAt,omitempty" tf:"created_at,omitempty"` + + // Specifies the description of the SNAT rule, which contain maximum of 255 + // characters, and angle brackets (< and >) are not allowed. + // The description of the SNAT rule. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The ID of the enterprise project to which the private SNAT rule belongs. + // The ID of the enterprise project to which the private SNAT rule belongs. + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // Specifies the private NAT gateway ID to which the SNAT rule belongs. + // Changing this will create a new resource. + // The private NAT gateway ID to which the SNAT rule belongs. + GatewayID *string `json:"gatewayId,omitempty" tf:"gateway_id,omitempty"` + + // The resource ID in UUID format. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies the region where the SNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the SNAT rule is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the subnet ID of the match rule. + // Changing this will create a new resource. + // The subnet ID of the match rule. + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // The address of the transit IP. + // The address of the transit IP + TransitIPAddress *string `json:"transitIpAddress,omitempty" tf:"transit_ip_address,omitempty"` + + // Specifies the ID of the transit IP associated with SNAT rule. + // The ID of the transit IP associated with SNAT rule. + TransitIPID *string `json:"transitIpId,omitempty" tf:"transit_ip_id,omitempty"` + + // The latest update time of the SNAT rule. + // The latest update time of the SNAT rule. + UpdatedAt *string `json:"updatedAt,omitempty" tf:"updated_at,omitempty"` +} + +type PrivateSnatRuleParameters struct { + + // Specifies the CIDR block of the match rule. + // Changing this will create a new resource. + // Exactly one of cidr and subnet_id must be set. + // The CIDR block of the match rule. + // +kubebuilder:validation:Optional + Cidr *string `json:"cidr,omitempty" tf:"cidr,omitempty"` + + // Specifies the description of the SNAT rule, which contain maximum of 255 + // characters, and angle brackets (< and >) are not allowed. + // The description of the SNAT rule. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the private NAT gateway ID to which the SNAT rule belongs. + // Changing this will create a new resource. + // The private NAT gateway ID to which the SNAT rule belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.PrivateGateway + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + GatewayID *string `json:"gatewayId,omitempty" tf:"gateway_id,omitempty"` + + // Reference to a PrivateGateway in nat to populate gatewayId. + // +kubebuilder:validation:Optional + GatewayIDRef *v1.Reference `json:"gatewayIdRef,omitempty" tf:"-"` + + // Selector for a PrivateGateway in nat to populate gatewayId. + // +kubebuilder:validation:Optional + GatewayIDSelector *v1.Selector `json:"gatewayIdSelector,omitempty" tf:"-"` + + // Specifies the region where the SNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the SNAT rule is located. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the subnet ID of the match rule. + // Changing this will create a new resource. + // The subnet ID of the match rule. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.Subnet + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Reference to a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + + // Specifies the ID of the transit IP associated with SNAT rule. + // The ID of the transit IP associated with SNAT rule. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.PrivateTransitIP + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + TransitIPID *string `json:"transitIpId,omitempty" tf:"transit_ip_id,omitempty"` + + // Reference to a PrivateTransitIP in nat to populate transitIpId. + // +kubebuilder:validation:Optional + TransitIPIDRef *v1.Reference `json:"transitIpIdRef,omitempty" tf:"-"` + + // Selector for a PrivateTransitIP in nat to populate transitIpId. + // +kubebuilder:validation:Optional + TransitIPIDSelector *v1.Selector `json:"transitIpIdSelector,omitempty" tf:"-"` +} + +// PrivateSnatRuleSpec defines the desired state of PrivateSnatRule +type PrivateSnatRuleSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider PrivateSnatRuleParameters `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 PrivateSnatRuleInitParameters `json:"initProvider,omitempty"` +} + +// PrivateSnatRuleStatus defines the observed state of PrivateSnatRule. +type PrivateSnatRuleStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider PrivateSnatRuleObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// PrivateSnatRule is the Schema for the PrivateSnatRules API. "" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type PrivateSnatRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec PrivateSnatRuleSpec `json:"spec"` + Status PrivateSnatRuleStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// PrivateSnatRuleList contains a list of PrivateSnatRules +type PrivateSnatRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []PrivateSnatRule `json:"items"` +} + +// Repository type metadata. +var ( + PrivateSnatRule_Kind = "PrivateSnatRule" + PrivateSnatRule_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: PrivateSnatRule_Kind}.String() + PrivateSnatRule_KindAPIVersion = PrivateSnatRule_Kind + "." + CRDGroupVersion.String() + PrivateSnatRule_GroupVersionKind = CRDGroupVersion.WithKind(PrivateSnatRule_Kind) +) + +func init() { + SchemeBuilder.Register(&PrivateSnatRule{}, &PrivateSnatRuleList{}) +} diff --git a/apis/nat/v1alpha1/zz_privatetransitip_terraformed.go b/apis/nat/v1alpha1/zz_privatetransitip_terraformed.go new file mode 100755 index 0000000..ab89c81 --- /dev/null +++ b/apis/nat/v1alpha1/zz_privatetransitip_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this PrivateTransitIP +func (mg *PrivateTransitIP) GetTerraformResourceType() string { + return "huaweicloud_nat_private_transit_ip" +} + +// GetConnectionDetailsMapping for this PrivateTransitIP +func (tr *PrivateTransitIP) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this PrivateTransitIP +func (tr *PrivateTransitIP) 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 PrivateTransitIP +func (tr *PrivateTransitIP) 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 PrivateTransitIP +func (tr *PrivateTransitIP) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this PrivateTransitIP +func (tr *PrivateTransitIP) 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 PrivateTransitIP +func (tr *PrivateTransitIP) 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 PrivateTransitIP +func (tr *PrivateTransitIP) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this PrivateTransitIP +func (tr *PrivateTransitIP) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this PrivateTransitIP using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *PrivateTransitIP) LateInitialize(attrs []byte) (bool, error) { + params := &PrivateTransitIPParameters{} + 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 *PrivateTransitIP) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/nat/v1alpha1/zz_privatetransitip_types.go b/apis/nat/v1alpha1/zz_privatetransitip_types.go new file mode 100755 index 0000000..f4348ff --- /dev/null +++ b/apis/nat/v1alpha1/zz_privatetransitip_types.go @@ -0,0 +1,203 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 PrivateTransitIPInitParameters struct { + + // Specifies the ID of the enterprise project to which the transit + // IP belongs. + // Changing this will create a new resource. + // The ID of the enterprise project to which the transit IP belongs. + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // Specifies the IP address of the transit subnet. + // Changing this will create a new resource. + // The IP address of the transit subnet. + IPAddress *string `json:"ipAddress,omitempty" tf:"ip_address,omitempty"` + + // Specifies the region where the transit IP is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the transit IP is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the transit subnet ID to which the transit IP belongs. + // Changing this will create a new resource. + // The ID of the transit subnet to which the transit IP belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.Subnet + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Reference to a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + + // Specifies the key/value pairs to associate with the transit IP. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +type PrivateTransitIPObservation struct { + + // The creation time of the transit IP for private NAT. + // The creation time of the transit IP for private NAT. + CreatedAt *string `json:"createdAt,omitempty" tf:"created_at,omitempty"` + + // Specifies the ID of the enterprise project to which the transit + // IP belongs. + // Changing this will create a new resource. + // The ID of the enterprise project to which the transit IP belongs. + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // The ID of the private NAT gateway to which the transit IP belongs. + // The ID of the private NAT gateway to which the transit IP belongs. + GatewayID *string `json:"gatewayId,omitempty" tf:"gateway_id,omitempty"` + + // The resource ID in UUID format. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies the IP address of the transit subnet. + // Changing this will create a new resource. + // The IP address of the transit subnet. + IPAddress *string `json:"ipAddress,omitempty" tf:"ip_address,omitempty"` + + // The network interface ID of the transit IP for private NAT. + // The network interface ID of the transit IP for private NAT. + NetworkInterfaceID *string `json:"networkInterfaceId,omitempty" tf:"network_interface_id,omitempty"` + + // Specifies the region where the transit IP is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the transit IP is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the transit subnet ID to which the transit IP belongs. + // Changing this will create a new resource. + // The ID of the transit subnet to which the transit IP belongs. + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Specifies the key/value pairs to associate with the transit IP. + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // The latest update time of the transit IP for private NAT. + // The latest update time of the transit IP for private NAT. + UpdatedAt *string `json:"updatedAt,omitempty" tf:"updated_at,omitempty"` +} + +type PrivateTransitIPParameters struct { + + // Specifies the ID of the enterprise project to which the transit + // IP belongs. + // Changing this will create a new resource. + // The ID of the enterprise project to which the transit IP belongs. + // +kubebuilder:validation:Optional + EnterpriseProjectID *string `json:"enterpriseProjectId,omitempty" tf:"enterprise_project_id,omitempty"` + + // Specifies the IP address of the transit subnet. + // Changing this will create a new resource. + // The IP address of the transit subnet. + // +kubebuilder:validation:Optional + IPAddress *string `json:"ipAddress,omitempty" tf:"ip_address,omitempty"` + + // Specifies the region where the transit IP is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the transit IP is located. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the transit subnet ID to which the transit IP belongs. + // Changing this will create a new resource. + // The ID of the transit subnet to which the transit IP belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.Subnet + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Reference to a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` + + // Specifies the key/value pairs to associate with the transit IP. + // +kubebuilder:validation:Optional + // +mapType=granular + Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` +} + +// PrivateTransitIPSpec defines the desired state of PrivateTransitIP +type PrivateTransitIPSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider PrivateTransitIPParameters `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 PrivateTransitIPInitParameters `json:"initProvider,omitempty"` +} + +// PrivateTransitIPStatus defines the observed state of PrivateTransitIP. +type PrivateTransitIPStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider PrivateTransitIPObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// PrivateTransitIP is the Schema for the PrivateTransitIPs API. "" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type PrivateTransitIP struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec PrivateTransitIPSpec `json:"spec"` + Status PrivateTransitIPStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// PrivateTransitIPList contains a list of PrivateTransitIPs +type PrivateTransitIPList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []PrivateTransitIP `json:"items"` +} + +// Repository type metadata. +var ( + PrivateTransitIP_Kind = "PrivateTransitIP" + PrivateTransitIP_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: PrivateTransitIP_Kind}.String() + PrivateTransitIP_KindAPIVersion = PrivateTransitIP_Kind + "." + CRDGroupVersion.String() + PrivateTransitIP_GroupVersionKind = CRDGroupVersion.WithKind(PrivateTransitIP_Kind) +) + +func init() { + SchemeBuilder.Register(&PrivateTransitIP{}, &PrivateTransitIPList{}) +} diff --git a/apis/nat/v1alpha1/zz_snatrule_terraformed.go b/apis/nat/v1alpha1/zz_snatrule_terraformed.go new file mode 100755 index 0000000..30ddcb0 --- /dev/null +++ b/apis/nat/v1alpha1/zz_snatrule_terraformed.go @@ -0,0 +1,138 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this SnatRule +func (mg *SnatRule) GetTerraformResourceType() string { + return "huaweicloud_nat_snat_rule" +} + +// GetConnectionDetailsMapping for this SnatRule +func (tr *SnatRule) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this SnatRule +func (tr *SnatRule) 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 SnatRule +func (tr *SnatRule) 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 SnatRule +func (tr *SnatRule) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this SnatRule +func (tr *SnatRule) 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 SnatRule +func (tr *SnatRule) 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 SnatRule +func (tr *SnatRule) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this SnatRule +func (tr *SnatRule) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this SnatRule using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *SnatRule) LateInitialize(attrs []byte) (bool, error) { + params := &SnatRuleParameters{} + 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)} + opts = append(opts, resource.WithNameFilter("NetworkID")) + initParams, err := tr.GetInitParameters() + if err != nil { + return false, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + opts = append(opts, resource.WithConditionalFilter("Cidr", initParams)) + opts = append(opts, resource.WithConditionalFilter("FloatingIPID", initParams)) + opts = append(opts, resource.WithConditionalFilter("GlobalEIPID", initParams)) + opts = append(opts, resource.WithConditionalFilter("SubnetID", initParams)) + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *SnatRule) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/nat/v1alpha1/zz_snatrule_types.go b/apis/nat/v1alpha1/zz_snatrule_types.go new file mode 100755 index 0000000..4727fd0 --- /dev/null +++ b/apis/nat/v1alpha1/zz_snatrule_types.go @@ -0,0 +1,320 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +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 SnatRuleInitParameters struct { + + // Specifies the CIDR block connected by SNAT rule (DC side). + // This parameter and subnet_id are alternative. Changing this will create a new resource. + // The CIDR block connected by SNAT rule (DC side). + Cidr *string `json:"cidr,omitempty" tf:"cidr,omitempty"` + + // Specifies the description of the SNAT rule. + // The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + // The description of the SNAT rule. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the IDs of floating IPs connected by SNAT rule. + // Multiple floating IPs are separated using commas (,). The number of floating IP IDs cannot exceed 20. + // The IDs of floating IPs connected by SNAT rule. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/eip/v1alpha1.VpcEip + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + FloatingIPID *string `json:"floatingIpId,omitempty" tf:"floating_ip_id,omitempty"` + + // Reference to a VpcEip in eip to populate floatingIpId. + // +kubebuilder:validation:Optional + FloatingIPIDRef *v1.Reference `json:"floatingIpIdRef,omitempty" tf:"-"` + + // Selector for a VpcEip in eip to populate floatingIpId. + // +kubebuilder:validation:Optional + FloatingIPIDSelector *v1.Selector `json:"floatingIpIdSelector,omitempty" tf:"-"` + + // Specifies the IDs of global EIPs connected by SNAT rule. + // Multiple global EIPs are separated using commas (,). The number of global EIP IDs cannot exceed 20. + // The IDs (separated by commas) of global EIPs connected by SNAT rule. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/eip/v1alpha1.GlobalEip + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + GlobalEIPID *string `json:"globalEipId,omitempty" tf:"global_eip_id,omitempty"` + + // Reference to a GlobalEip in eip to populate globalEipId. + // +kubebuilder:validation:Optional + GlobalEIPIDRef *v1.Reference `json:"globalEipIdRef,omitempty" tf:"-"` + + // Selector for a GlobalEip in eip to populate globalEipId. + // +kubebuilder:validation:Optional + GlobalEIPIDSelector *v1.Selector `json:"globalEipIdSelector,omitempty" tf:"-"` + + // Specifies the ID of the gateway to which the SNAT rule belongs. + // Changing this will create a new resource. + // schema: Required; The ID of the gateway to which the SNAT rule belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.Gateway + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + NATGatewayID *string `json:"natGatewayId,omitempty" tf:"nat_gateway_id,omitempty"` + + // Reference to a Gateway in nat to populate natGatewayId. + // +kubebuilder:validation:Optional + NATGatewayIDRef *v1.Reference `json:"natGatewayIdRef,omitempty" tf:"-"` + + // Selector for a Gateway in nat to populate natGatewayId. + // +kubebuilder:validation:Optional + NATGatewayIDSelector *v1.Selector `json:"natGatewayIdSelector,omitempty" tf:"-"` + + // Specifies a resource ID in UUID format. + NetworkID *string `json:"networkId,omitempty" tf:"network_id,omitempty"` + + // Specifies the region where the SNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the SNAT rule is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the resource scenario. + // The valid values are 0 (VPC scenario) and 1 (Direct Connect scenario), and the default value is 0. + // Only cidr can be specified over a Direct Connect connection. Changing this will create a new resource. + // The resource type of the SNAT rule. + SourceType *float64 `json:"sourceType,omitempty" tf:"source_type,omitempty"` + + // Specifies the network IDs of subnet connected by SNAT rule (VPC side). + // This parameter and cidr are alternative. Changing this will create a new resource. + // The network IDs of subnet connected by SNAT rule (VPC side). + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.Subnet + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Reference to a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` +} + +type SnatRuleObservation struct { + + // Specifies the CIDR block connected by SNAT rule (DC side). + // This parameter and subnet_id are alternative. Changing this will create a new resource. + // The CIDR block connected by SNAT rule (DC side). + Cidr *string `json:"cidr,omitempty" tf:"cidr,omitempty"` + + // Specifies the description of the SNAT rule. + // The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + // The description of the SNAT rule. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The actual floating IP address. + // The floating IP addresses (separated by commas) connected by SNAT rule. + FloatingIPAddress *string `json:"floatingIpAddress,omitempty" tf:"floating_ip_address,omitempty"` + + // Specifies the IDs of floating IPs connected by SNAT rule. + // Multiple floating IPs are separated using commas (,). The number of floating IP IDs cannot exceed 20. + // The IDs of floating IPs connected by SNAT rule. + FloatingIPID *string `json:"floatingIpId,omitempty" tf:"floating_ip_id,omitempty"` + + // The global EIP addresses (separated by commas) connected by SNAT rule. + // The global EIP addresses (separated by commas) connected by SNAT rule. + GlobalEIPAddress *string `json:"globalEipAddress,omitempty" tf:"global_eip_address,omitempty"` + + // Specifies the IDs of global EIPs connected by SNAT rule. + // Multiple global EIPs are separated using commas (,). The number of global EIP IDs cannot exceed 20. + // The IDs (separated by commas) of global EIPs connected by SNAT rule. + GlobalEIPID *string `json:"globalEipId,omitempty" tf:"global_eip_id,omitempty"` + + // Specifies a resource ID in UUID format. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Specifies the ID of the gateway to which the SNAT rule belongs. + // Changing this will create a new resource. + // schema: Required; The ID of the gateway to which the SNAT rule belongs. + NATGatewayID *string `json:"natGatewayId,omitempty" tf:"nat_gateway_id,omitempty"` + + // Specifies a resource ID in UUID format. + NetworkID *string `json:"networkId,omitempty" tf:"network_id,omitempty"` + + // Specifies the region where the SNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the SNAT rule is located. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the resource scenario. + // The valid values are 0 (VPC scenario) and 1 (Direct Connect scenario), and the default value is 0. + // Only cidr can be specified over a Direct Connect connection. Changing this will create a new resource. + // The resource type of the SNAT rule. + SourceType *float64 `json:"sourceType,omitempty" tf:"source_type,omitempty"` + + // The status of the SNAT rule. + // The status of the SNAT rule. + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // Specifies the network IDs of subnet connected by SNAT rule (VPC side). + // This parameter and cidr are alternative. Changing this will create a new resource. + // The network IDs of subnet connected by SNAT rule (VPC side). + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` +} + +type SnatRuleParameters struct { + + // Specifies the CIDR block connected by SNAT rule (DC side). + // This parameter and subnet_id are alternative. Changing this will create a new resource. + // The CIDR block connected by SNAT rule (DC side). + // +kubebuilder:validation:Optional + Cidr *string `json:"cidr,omitempty" tf:"cidr,omitempty"` + + // Specifies the description of the SNAT rule. + // The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + // The description of the SNAT rule. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // Specifies the IDs of floating IPs connected by SNAT rule. + // Multiple floating IPs are separated using commas (,). The number of floating IP IDs cannot exceed 20. + // The IDs of floating IPs connected by SNAT rule. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/eip/v1alpha1.VpcEip + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + FloatingIPID *string `json:"floatingIpId,omitempty" tf:"floating_ip_id,omitempty"` + + // Reference to a VpcEip in eip to populate floatingIpId. + // +kubebuilder:validation:Optional + FloatingIPIDRef *v1.Reference `json:"floatingIpIdRef,omitempty" tf:"-"` + + // Selector for a VpcEip in eip to populate floatingIpId. + // +kubebuilder:validation:Optional + FloatingIPIDSelector *v1.Selector `json:"floatingIpIdSelector,omitempty" tf:"-"` + + // Specifies the IDs of global EIPs connected by SNAT rule. + // Multiple global EIPs are separated using commas (,). The number of global EIP IDs cannot exceed 20. + // The IDs (separated by commas) of global EIPs connected by SNAT rule. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/eip/v1alpha1.GlobalEip + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + GlobalEIPID *string `json:"globalEipId,omitempty" tf:"global_eip_id,omitempty"` + + // Reference to a GlobalEip in eip to populate globalEipId. + // +kubebuilder:validation:Optional + GlobalEIPIDRef *v1.Reference `json:"globalEipIdRef,omitempty" tf:"-"` + + // Selector for a GlobalEip in eip to populate globalEipId. + // +kubebuilder:validation:Optional + GlobalEIPIDSelector *v1.Selector `json:"globalEipIdSelector,omitempty" tf:"-"` + + // Specifies the ID of the gateway to which the SNAT rule belongs. + // Changing this will create a new resource. + // schema: Required; The ID of the gateway to which the SNAT rule belongs. + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1.Gateway + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + NATGatewayID *string `json:"natGatewayId,omitempty" tf:"nat_gateway_id,omitempty"` + + // Reference to a Gateway in nat to populate natGatewayId. + // +kubebuilder:validation:Optional + NATGatewayIDRef *v1.Reference `json:"natGatewayIdRef,omitempty" tf:"-"` + + // Selector for a Gateway in nat to populate natGatewayId. + // +kubebuilder:validation:Optional + NATGatewayIDSelector *v1.Selector `json:"natGatewayIdSelector,omitempty" tf:"-"` + + // Specifies a resource ID in UUID format. + // +kubebuilder:validation:Optional + NetworkID *string `json:"networkId,omitempty" tf:"network_id,omitempty"` + + // Specifies the region where the SNAT rule is located. + // If omitted, the provider-level region will be used. Changing this will create a new resource. + // The region where the SNAT rule is located. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Specifies the resource scenario. + // The valid values are 0 (VPC scenario) and 1 (Direct Connect scenario), and the default value is 0. + // Only cidr can be specified over a Direct Connect connection. Changing this will create a new resource. + // The resource type of the SNAT rule. + // +kubebuilder:validation:Optional + SourceType *float64 `json:"sourceType,omitempty" tf:"source_type,omitempty"` + + // Specifies the network IDs of subnet connected by SNAT rule (VPC side). + // This parameter and cidr are alternative. Changing this will create a new resource. + // The network IDs of subnet connected by SNAT rule (VPC side). + // +crossplane:generate:reference:type=github.com/huaweicloud/provider-huaweicloud/apis/vpc/v1alpha1.Subnet + // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() + // +kubebuilder:validation:Optional + SubnetID *string `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + // Reference to a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDRef *v1.Reference `json:"subnetIdRef,omitempty" tf:"-"` + + // Selector for a Subnet in vpc to populate subnetId. + // +kubebuilder:validation:Optional + SubnetIDSelector *v1.Selector `json:"subnetIdSelector,omitempty" tf:"-"` +} + +// SnatRuleSpec defines the desired state of SnatRule +type SnatRuleSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider SnatRuleParameters `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 SnatRuleInitParameters `json:"initProvider,omitempty"` +} + +// SnatRuleStatus defines the observed state of SnatRule. +type SnatRuleStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider SnatRuleObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// SnatRule is the Schema for the SnatRules API. "" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,huaweicloud} +type SnatRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec SnatRuleSpec `json:"spec"` + Status SnatRuleStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// SnatRuleList contains a list of SnatRules +type SnatRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []SnatRule `json:"items"` +} + +// Repository type metadata. +var ( + SnatRule_Kind = "SnatRule" + SnatRule_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: SnatRule_Kind}.String() + SnatRule_KindAPIVersion = SnatRule_Kind + "." + CRDGroupVersion.String() + SnatRule_GroupVersionKind = CRDGroupVersion.WithKind(SnatRule_Kind) +) + +func init() { + SchemeBuilder.Register(&SnatRule{}, &SnatRuleList{}) +} diff --git a/apis/zz_register.go b/apis/zz_register.go index cc6f034..67e1b9b 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -18,6 +18,7 @@ import ( v1alpha1evs "github.com/huaweicloud/provider-huaweicloud/apis/evs/v1alpha1" v1alpha1iam "github.com/huaweicloud/provider-huaweicloud/apis/iam/v1alpha1" v1alpha1modelarts "github.com/huaweicloud/provider-huaweicloud/apis/modelarts/v1alpha1" + v1alpha1nat "github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1" v1alpha1obs "github.com/huaweicloud/provider-huaweicloud/apis/obs/v1alpha1" v1alpha1rds "github.com/huaweicloud/provider-huaweicloud/apis/rds/v1alpha1" v1alpha1swr "github.com/huaweicloud/provider-huaweicloud/apis/swr/v1alpha1" @@ -37,6 +38,7 @@ func init() { v1alpha1evs.SchemeBuilder.AddToScheme, v1alpha1iam.SchemeBuilder.AddToScheme, v1alpha1modelarts.SchemeBuilder.AddToScheme, + v1alpha1nat.SchemeBuilder.AddToScheme, v1alpha1obs.SchemeBuilder.AddToScheme, v1alpha1rds.SchemeBuilder.AddToScheme, v1alpha1swr.SchemeBuilder.AddToScheme, diff --git a/config/external_name.go b/config/external_name.go index dc4a177..fa0854e 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -106,6 +106,15 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "huaweicloud_modelarts_service": config.IdentifierFromProvider, "huaweicloud_modelarts_workspace": config.IdentifierFromProvider, + // nat + "huaweicloud_nat_dnat_rule": config.IdentifierFromProvider, + "huaweicloud_nat_gateway": config.IdentifierFromProvider, + "huaweicloud_nat_private_dnat_rule": config.IdentifierFromProvider, + "huaweicloud_nat_private_gateway": config.IdentifierFromProvider, + "huaweicloud_nat_private_snat_rule": config.IdentifierFromProvider, + "huaweicloud_nat_private_transit_ip": config.IdentifierFromProvider, + "huaweicloud_nat_snat_rule": config.IdentifierFromProvider, + // obs "huaweicloud_obs_bucket": config.IdentifierFromProvider, "huaweicloud_obs_bucket_acl": config.IdentifierFromProvider, diff --git a/config/nat/config.go b/config/nat/config.go new file mode 100644 index 0000000..4c77aa8 --- /dev/null +++ b/config/nat/config.go @@ -0,0 +1,136 @@ +package nat + +import ( + "github.com/crossplane/upjet/pkg/config" +) + +const shortGroupNat = "nat" + +// Configure configures individual resources by adding custom ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("huaweicloud_nat_dnat_rule", func(r *config.Resource) { + r.ShortGroup = shortGroupNat + + r.References["nat_gateway_id"] = config.Reference{ + TerraformName: "huaweicloud_nat_gateway", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.References["floating_ip_id"] = config.Reference{ + TerraformName: "huaweicloud_vpc_eip", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.References["global_eip_id"] = config.Reference{ + TerraformName: "huaweicloud_global_eip", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.LateInitializer = config.LateInitializer{ + ConditionalIgnoredFields: []string{"floating_ip_id", "global_eip_id", "internal_service_port", "internal_service_port_range", + "external_service_port", "external_service_port_range", "port_id", "private_ip"}, + } + }) + + p.AddResourceConfigurator("huaweicloud_nat_gateway", func(r *config.Resource) { + r.ShortGroup = shortGroupNat + + r.References["vpc_id"] = config.Reference{ + TerraformName: "huaweicloud_vpc", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.References["subnet_id"] = config.Reference{ + TerraformName: "huaweicloud_vpc_subnet", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + }) + + p.AddResourceConfigurator("huaweicloud_nat_private_dnat_rule", func(r *config.Resource) { + r.ShortGroup = shortGroupNat + + r.References["gateway_id"] = config.Reference{ + TerraformName: "huaweicloud_nat_private_gateway", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.References["transit_ip_id"] = config.Reference{ + TerraformName: "huaweicloud_nat_private_transit_ip", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.LateInitializer = config.LateInitializer{ + ConditionalIgnoredFields: []string{"backend_interface_id", "backend_private_ip"}, + } + }) + + p.AddResourceConfigurator("huaweicloud_nat_private_gateway", func(r *config.Resource) { + r.ShortGroup = shortGroupNat + + r.References["subnet_id"] = config.Reference{ + TerraformName: "huaweicloud_vpc_subnet", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + }) + + p.AddResourceConfigurator("huaweicloud_nat_private_snat_rule", func(r *config.Resource) { + r.ShortGroup = shortGroupNat + + r.References["gateway_id"] = config.Reference{ + TerraformName: "huaweicloud_nat_private_gateway", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.References["subnet_id"] = config.Reference{ + TerraformName: "huaweicloud_vpc_subnet", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.References["transit_ip_id"] = config.Reference{ + TerraformName: "huaweicloud_nat_private_transit_ip", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.LateInitializer = config.LateInitializer{ + ConditionalIgnoredFields: []string{"cidr", "subnet_id"}, + } + }) + + p.AddResourceConfigurator("huaweicloud_nat_private_transit_ip", func(r *config.Resource) { + r.ShortGroup = shortGroupNat + + r.References["subnet_id"] = config.Reference{ + TerraformName: "huaweicloud_vpc_subnet", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + }) + + p.AddResourceConfigurator("huaweicloud_nat_snat_rule", func(r *config.Resource) { + r.ShortGroup = shortGroupNat + + r.References["nat_gateway_id"] = config.Reference{ + TerraformName: "huaweicloud_nat_gateway", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.References["floating_ip_id"] = config.Reference{ + TerraformName: "huaweicloud_vpc_eip", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.References["global_eip_id"] = config.Reference{ + TerraformName: "huaweicloud_global_eip", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.References["subnet_id"] = config.Reference{ + TerraformName: "huaweicloud_vpc_subnet", + Extractor: `github.com/crossplane/upjet/pkg/resource.ExtractResourceID()`, + } + + r.LateInitializer = config.LateInitializer{ + IgnoredFields: []string{"network_id"}, + ConditionalIgnoredFields: []string{"floating_ip_id", "global_eip_id", "subnet_id", "cidr"}, + } + }) +} diff --git a/config/provider.go b/config/provider.go index 13daa63..2099ea5 100644 --- a/config/provider.go +++ b/config/provider.go @@ -16,6 +16,7 @@ import ( "github.com/huaweicloud/provider-huaweicloud/config/evs" "github.com/huaweicloud/provider-huaweicloud/config/iam" "github.com/huaweicloud/provider-huaweicloud/config/modelarts" + "github.com/huaweicloud/provider-huaweicloud/config/nat" "github.com/huaweicloud/provider-huaweicloud/config/obs" "github.com/huaweicloud/provider-huaweicloud/config/rds" "github.com/huaweicloud/provider-huaweicloud/config/swr" @@ -60,6 +61,7 @@ func GetProvider() *ujconfig.Provider { rds.Configure, swr.Configure, evs.Configure, + nat.Configure, } { configure(pc) } diff --git a/examples-generated/nat/v1alpha1/dnatrule.yaml b/examples-generated/nat/v1alpha1/dnatrule.yaml new file mode 100644 index 0000000..61c1870 --- /dev/null +++ b/examples-generated/nat/v1alpha1/dnatrule.yaml @@ -0,0 +1,33 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: DnatRule +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/dnatrule + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + externalServicePort: 8023 + floatingIpIdSelector: + matchLabels: + testing.upbound.io/example-name: example + internalServicePort: 23 + natGatewayIdSelector: + matchLabels: + testing.upbound.io/example-name: example + portId: ${huaweicloud_compute_instance.test.network[0].port} + protocol: tcp + +--- + +apiVersion: ecs.huaweicloud.crossplane.io/v1alpha1 +kind: Instance +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/dnatrule + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: {} diff --git a/examples-generated/nat/v1alpha1/gateway.yaml b/examples-generated/nat/v1alpha1/gateway.yaml new file mode 100644 index 0000000..4692dd0 --- /dev/null +++ b/examples-generated/nat/v1alpha1/gateway.yaml @@ -0,0 +1,19 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: Gateway +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/gateway + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + description: test for terraform + name: ${var.gateway_name} + spec: ${var.gateway_specification} + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/examples-generated/nat/v1alpha1/privatednatrule.yaml b/examples-generated/nat/v1alpha1/privatednatrule.yaml new file mode 100644 index 0000000..8ba55e6 --- /dev/null +++ b/examples-generated/nat/v1alpha1/privatednatrule.yaml @@ -0,0 +1,33 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: PrivateDnatRule +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/privatednatrule + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + backendInterfaceId: ${huaweicloud_compute_instance.test.network[0].port} + gatewayIdSelector: + matchLabels: + testing.upbound.io/example-name: example + internalServicePort: 2000 + protocol: tcp + transitIpIdSelector: + matchLabels: + testing.upbound.io/example-name: example + transitServicePort: 1000 + +--- + +apiVersion: ecs.huaweicloud.crossplane.io/v1alpha1 +kind: Instance +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/privatednatrule + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: {} diff --git a/examples-generated/nat/v1alpha1/privategateway.yaml b/examples-generated/nat/v1alpha1/privategateway.yaml new file mode 100644 index 0000000..1637c58 --- /dev/null +++ b/examples-generated/nat/v1alpha1/privategateway.yaml @@ -0,0 +1,17 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: PrivateGateway +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/privategateway + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + description: Created by terraform script + enterpriseProjectId: "0" + name: ${var.gateway_name} + spec: Small + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/examples-generated/nat/v1alpha1/privatesnatrule.yaml b/examples-generated/nat/v1alpha1/privatesnatrule.yaml new file mode 100644 index 0000000..d19fbc6 --- /dev/null +++ b/examples-generated/nat/v1alpha1/privatesnatrule.yaml @@ -0,0 +1,19 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: PrivateSnatRule +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/privatesnatrule + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + gatewayIdSelector: + matchLabels: + testing.upbound.io/example-name: example + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example + transitIpIdSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/examples-generated/nat/v1alpha1/privatetransitip.yaml b/examples-generated/nat/v1alpha1/privatetransitip.yaml new file mode 100644 index 0000000..a87a786 --- /dev/null +++ b/examples-generated/nat/v1alpha1/privatetransitip.yaml @@ -0,0 +1,17 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: PrivateTransitIP +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/privatetransitip + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + enterpriseProjectId: ${var.enterprise_project_id} + ipAddress: ${var.ipv4_address} + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example + tags: + foo: bar diff --git a/examples-generated/nat/v1alpha1/snatrule.yaml b/examples-generated/nat/v1alpha1/snatrule.yaml new file mode 100644 index 0000000..b86063a --- /dev/null +++ b/examples-generated/nat/v1alpha1/snatrule.yaml @@ -0,0 +1,19 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: SnatRule +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/snatrule + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + floatingIpIdSelector: + matchLabels: + testing.upbound.io/example-name: example + natGatewayIdSelector: + matchLabels: + testing.upbound.io/example-name: example + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: example diff --git a/internal/controller/nat/dnatrule/zz_controller.go b/internal/controller/nat/dnatrule/zz_controller.go new file mode 100755 index 0000000..7ff19e3 --- /dev/null +++ b/internal/controller/nat/dnatrule/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package dnatrule + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles DnatRule managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.DnatRule_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.DnatRule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.DnatRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_nat_dnat_rule"], 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()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.DnatRule + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.DnatRule{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.DnatRule") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.DnatRuleList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.DnatRuleList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.DnatRule_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.DnatRule{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/nat/gateway/zz_controller.go b/internal/controller/nat/gateway/zz_controller.go new file mode 100755 index 0000000..7fc8929 --- /dev/null +++ b/internal/controller/nat/gateway/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package gateway + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles Gateway managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Gateway_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.Gateway_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Gateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_nat_gateway"], 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()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Gateway + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Gateway{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Gateway") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.GatewayList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.GatewayList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Gateway_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Gateway{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/nat/privatednatrule/zz_controller.go b/internal/controller/nat/privatednatrule/zz_controller.go new file mode 100755 index 0000000..b6777f4 --- /dev/null +++ b/internal/controller/nat/privatednatrule/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package privatednatrule + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles PrivateDnatRule managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.PrivateDnatRule_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.PrivateDnatRule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.PrivateDnatRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_nat_private_dnat_rule"], 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()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.PrivateDnatRule + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.PrivateDnatRule{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.PrivateDnatRule") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.PrivateDnatRuleList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.PrivateDnatRuleList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.PrivateDnatRule_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.PrivateDnatRule{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/nat/privategateway/zz_controller.go b/internal/controller/nat/privategateway/zz_controller.go new file mode 100755 index 0000000..30ce04a --- /dev/null +++ b/internal/controller/nat/privategateway/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package privategateway + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles PrivateGateway managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.PrivateGateway_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.PrivateGateway_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.PrivateGateway_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_nat_private_gateway"], 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()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.PrivateGateway + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.PrivateGateway{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.PrivateGateway") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.PrivateGatewayList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.PrivateGatewayList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.PrivateGateway_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.PrivateGateway{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/nat/privatesnatrule/zz_controller.go b/internal/controller/nat/privatesnatrule/zz_controller.go new file mode 100755 index 0000000..473b636 --- /dev/null +++ b/internal/controller/nat/privatesnatrule/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package privatesnatrule + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles PrivateSnatRule managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.PrivateSnatRule_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.PrivateSnatRule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.PrivateSnatRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_nat_private_snat_rule"], 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()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.PrivateSnatRule + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.PrivateSnatRule{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.PrivateSnatRule") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.PrivateSnatRuleList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.PrivateSnatRuleList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.PrivateSnatRule_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.PrivateSnatRule{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/nat/privatetransitip/zz_controller.go b/internal/controller/nat/privatetransitip/zz_controller.go new file mode 100755 index 0000000..763a10e --- /dev/null +++ b/internal/controller/nat/privatetransitip/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package privatetransitip + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles PrivateTransitIP managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.PrivateTransitIP_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.PrivateTransitIP_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.PrivateTransitIP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_nat_private_transit_ip"], 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()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.PrivateTransitIP + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.PrivateTransitIP{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.PrivateTransitIP") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.PrivateTransitIPList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.PrivateTransitIPList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.PrivateTransitIP_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.PrivateTransitIP{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/nat/snatrule/zz_controller.go b/internal/controller/nat/snatrule/zz_controller.go new file mode 100755 index 0000000..7af458b --- /dev/null +++ b/internal/controller/nat/snatrule/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package snatrule + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/huaweicloud/provider-huaweicloud/apis/nat/v1alpha1" + features "github.com/huaweicloud/provider-huaweicloud/internal/features" +) + +// Setup adds a controller that reconciles SnatRule managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.SnatRule_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.SnatRule_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.SnatRule_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["huaweicloud_nat_snat_rule"], 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()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.SnatRule + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.SnatRule{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.SnatRule") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.SnatRuleList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.SnatRuleList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.SnatRule_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.SnatRule{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 1c70638..7aa70a9 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -89,6 +89,13 @@ import ( resourcepool "github.com/huaweicloud/provider-huaweicloud/internal/controller/modelarts/resourcepool" service "github.com/huaweicloud/provider-huaweicloud/internal/controller/modelarts/service" workspace "github.com/huaweicloud/provider-huaweicloud/internal/controller/modelarts/workspace" + dnatrule "github.com/huaweicloud/provider-huaweicloud/internal/controller/nat/dnatrule" + gateway "github.com/huaweicloud/provider-huaweicloud/internal/controller/nat/gateway" + privatednatrule "github.com/huaweicloud/provider-huaweicloud/internal/controller/nat/privatednatrule" + privategateway "github.com/huaweicloud/provider-huaweicloud/internal/controller/nat/privategateway" + privatesnatrule "github.com/huaweicloud/provider-huaweicloud/internal/controller/nat/privatesnatrule" + privatetransitip "github.com/huaweicloud/provider-huaweicloud/internal/controller/nat/privatetransitip" + snatrule "github.com/huaweicloud/provider-huaweicloud/internal/controller/nat/snatrule" bucket "github.com/huaweicloud/provider-huaweicloud/internal/controller/obs/bucket" bucketacl "github.com/huaweicloud/provider-huaweicloud/internal/controller/obs/bucketacl" bucketobject "github.com/huaweicloud/provider-huaweicloud/internal/controller/obs/bucketobject" @@ -238,6 +245,13 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { resourcepool.Setup, service.Setup, workspace.Setup, + dnatrule.Setup, + gateway.Setup, + privatednatrule.Setup, + privategateway.Setup, + privatesnatrule.Setup, + privatetransitip.Setup, + snatrule.Setup, bucket.Setup, bucketacl.Setup, bucketobject.Setup, diff --git a/package/crds/nat.huaweicloud.crossplane.io_dnatrules.yaml b/package/crds/nat.huaweicloud.crossplane.io_dnatrules.yaml new file mode 100644 index 0000000..2308160 --- /dev/null +++ b/package/crds/nat.huaweicloud.crossplane.io_dnatrules.yaml @@ -0,0 +1,1032 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: dnatrules.nat.huaweicloud.crossplane.io +spec: + group: nat.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: DnatRule + listKind: DnatRuleList + plural: dnatrules + singular: dnatrule + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: DnatRule is the Schema for the DnatRules API. "" + 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: DnatRuleSpec defines the desired state of DnatRule + 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: |- + Specifies the description of the DNAT rule. + The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + The description of the DNAT rule. + type: string + externalServicePort: + description: |- + Specifies port used by ECSs or BMSs to provide services for + external systems. + Exactly one of external_service_port and external_service_port_range must be set. + Required if internal_service_port is set. + The port range used by Floating IP provide services for external systems. + type: number + externalServicePortRange: + description: |- + Specifies port range used by ECSs or BMSs to provide + services for external systems. + This parameter and internal_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + Required if internal_service_port_range is set. + The port range used by ECSs or BMSs to provide services for external systems. + type: string + floatingIpId: + description: |- + Specifies the ID of the floating IP address. + The ID of the floating IP address. + type: string + floatingIpIdRef: + description: Reference to a VpcEip in eip to populate floatingIpId. + 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 + floatingIpIdSelector: + description: Selector for a VpcEip in eip to populate floatingIpId. + 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 + globalEipId: + description: |- + Specifies the ID of the global EIP connected by the DNAT rule. + The ID of the global EIP connected by the DNAT rule. + type: string + globalEipIdRef: + description: Reference to a GlobalEip in eip to populate globalEipId. + 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 + globalEipIdSelector: + description: Selector for a GlobalEip in eip to populate globalEipId. + 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 + internalServicePort: + description: |- + Specifies port used by Floating IP provide services for external + systems. + Exactly one of internal_service_port and internal_service_port_range must be set. + The port used by Floating IP provide services for external systems. + type: number + internalServicePortRange: + description: |- + Specifies port range used by Floating IP provide services + for external systems. + This parameter and external_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + The port used by ECSs or BMSs to provide services for external systems. + type: string + natGatewayId: + description: |- + Specifies the ID of the NAT gateway to which the DNAT rule belongs. + Changing this will create a new resource. + The ID of the NAT gateway to which the DNAT rule belongs. + type: string + natGatewayIdRef: + description: Reference to a Gateway in nat to populate natGatewayId. + 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 + natGatewayIdSelector: + description: Selector for a Gateway in nat to populate natGatewayId. + 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 + portId: + description: |- + Specifies the port ID of network. This parameter is mandatory in VPC scenario. + Use huaweicloud_networking_port to get the port if just know a fixed IP addresses + on the port. + The port ID of network. + type: string + privateIp: + description: |- + Specifies the private IP address of a user. This parameter is mandatory in + Direct Connect scenario. + The private IP address of a user. + type: string + protocol: + description: |- + Specifies the protocol type. + The valid values are tcp, udp, and any. + The protocol type. + type: string + region: + description: |- + Specifies the region where the DNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the DNAT rule is located. + type: string + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + description: + description: |- + Specifies the description of the DNAT rule. + The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + The description of the DNAT rule. + type: string + externalServicePort: + description: |- + Specifies port used by ECSs or BMSs to provide services for + external systems. + Exactly one of external_service_port and external_service_port_range must be set. + Required if internal_service_port is set. + The port range used by Floating IP provide services for external systems. + type: number + externalServicePortRange: + description: |- + Specifies port range used by ECSs or BMSs to provide + services for external systems. + This parameter and internal_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + Required if internal_service_port_range is set. + The port range used by ECSs or BMSs to provide services for external systems. + type: string + floatingIpId: + description: |- + Specifies the ID of the floating IP address. + The ID of the floating IP address. + type: string + floatingIpIdRef: + description: Reference to a VpcEip in eip to populate floatingIpId. + 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 + floatingIpIdSelector: + description: Selector for a VpcEip in eip to populate floatingIpId. + 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 + globalEipId: + description: |- + Specifies the ID of the global EIP connected by the DNAT rule. + The ID of the global EIP connected by the DNAT rule. + type: string + globalEipIdRef: + description: Reference to a GlobalEip in eip to populate globalEipId. + 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 + globalEipIdSelector: + description: Selector for a GlobalEip in eip to populate globalEipId. + 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 + internalServicePort: + description: |- + Specifies port used by Floating IP provide services for external + systems. + Exactly one of internal_service_port and internal_service_port_range must be set. + The port used by Floating IP provide services for external systems. + type: number + internalServicePortRange: + description: |- + Specifies port range used by Floating IP provide services + for external systems. + This parameter and external_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + The port used by ECSs or BMSs to provide services for external systems. + type: string + natGatewayId: + description: |- + Specifies the ID of the NAT gateway to which the DNAT rule belongs. + Changing this will create a new resource. + The ID of the NAT gateway to which the DNAT rule belongs. + type: string + natGatewayIdRef: + description: Reference to a Gateway in nat to populate natGatewayId. + 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 + natGatewayIdSelector: + description: Selector for a Gateway in nat to populate natGatewayId. + 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 + portId: + description: |- + Specifies the port ID of network. This parameter is mandatory in VPC scenario. + Use huaweicloud_networking_port to get the port if just know a fixed IP addresses + on the port. + The port ID of network. + type: string + privateIp: + description: |- + Specifies the private IP address of a user. This parameter is mandatory in + Direct Connect scenario. + The private IP address of a user. + type: string + protocol: + description: |- + Specifies the protocol type. + The valid values are tcp, udp, and any. + The protocol type. + type: string + region: + description: |- + Specifies the region where the DNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the DNAT rule is located. + 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.protocol is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.protocol) + || (has(self.initProvider) && has(self.initProvider.protocol))' + status: + description: DnatRuleStatus defines the observed state of DnatRule. + properties: + atProvider: + properties: + createdAt: + description: |- + The creation time of the DNAT rule. + The creation time of the DNAT rule. + type: string + description: + description: |- + Specifies the description of the DNAT rule. + The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + The description of the DNAT rule. + type: string + externalServicePort: + description: |- + Specifies port used by ECSs or BMSs to provide services for + external systems. + Exactly one of external_service_port and external_service_port_range must be set. + Required if internal_service_port is set. + The port range used by Floating IP provide services for external systems. + type: number + externalServicePortRange: + description: |- + Specifies port range used by ECSs or BMSs to provide + services for external systems. + This parameter and internal_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + Required if internal_service_port_range is set. + The port range used by ECSs or BMSs to provide services for external systems. + type: string + floatingIpAddress: + description: |- + The actual floating IP address. + The floating IP address of the DNAT rule. + type: string + floatingIpId: + description: |- + Specifies the ID of the floating IP address. + The ID of the floating IP address. + type: string + globalEipAddress: + description: |- + The global EIP address connected by the DNAT rule. + The global EIP address connected by the DNAT rule. + type: string + globalEipId: + description: |- + Specifies the ID of the global EIP connected by the DNAT rule. + The ID of the global EIP connected by the DNAT rule. + type: string + id: + description: The resource ID in UUID format. + type: string + internalServicePort: + description: |- + Specifies port used by Floating IP provide services for external + systems. + Exactly one of internal_service_port and internal_service_port_range must be set. + The port used by Floating IP provide services for external systems. + type: number + internalServicePortRange: + description: |- + Specifies port range used by Floating IP provide services + for external systems. + This parameter and external_service_port_range are mapped 1:1 in sequence(, ranges must have the same length). + The valid value for range is 1~65535 and the port ranges can only be concatenated with the - character. + The port used by ECSs or BMSs to provide services for external systems. + type: string + natGatewayId: + description: |- + Specifies the ID of the NAT gateway to which the DNAT rule belongs. + Changing this will create a new resource. + The ID of the NAT gateway to which the DNAT rule belongs. + type: string + portId: + description: |- + Specifies the port ID of network. This parameter is mandatory in VPC scenario. + Use huaweicloud_networking_port to get the port if just know a fixed IP addresses + on the port. + The port ID of network. + type: string + privateIp: + description: |- + Specifies the private IP address of a user. This parameter is mandatory in + Direct Connect scenario. + The private IP address of a user. + type: string + protocol: + description: |- + Specifies the protocol type. + The valid values are tcp, udp, and any. + The protocol type. + type: string + region: + description: |- + Specifies the region where the DNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the DNAT rule is located. + type: string + status: + description: |- + The current status of the DNAT rule. + The current status of the DNAT rule. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/nat.huaweicloud.crossplane.io_gateways.yaml b/package/crds/nat.huaweicloud.crossplane.io_gateways.yaml new file mode 100644 index 0000000..300d7dd --- /dev/null +++ b/package/crds/nat.huaweicloud.crossplane.io_gateways.yaml @@ -0,0 +1,879 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: gateways.nat.huaweicloud.crossplane.io +spec: + group: nat.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: Gateway + listKind: GatewayList + plural: gateways + singular: gateway + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Gateway is the Schema for the Gateways API. "" + 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: GatewaySpec defines the desired state of Gateway + 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: + autoRenew: + description: |- + Specifies whether auto-renew is enabled. This parameter is only valid when + charging_mode is set to prePaid. Valid values are true and false. Defaults to false. + type: string + chargingMode: + description: |- + Specifies the charging mode of the NAT gateway. + The valid values are as follows: + type: string + description: + description: |- + Specifies the description of the NAT gateway, which contain maximum of 512 + characters, and angle brackets (<) and (>) are not allowed. + The description of the NAT gateway. + type: string + enterpriseProjectId: + description: |- + Specifies the enterprise project ID of the NAT gateway. + Changing this will create a new resource. + The enterprise project ID of the NAT gateway. + type: string + name: + description: |- + Specifies the NAT gateway name. + The valid length is limited from 1 to 64, only letters, digits, hyphens (-) and underscores (_) are allowed. + The NAT gateway name. + type: string + ngportIpAddress: + description: |- + Specifies the private IP address of the NAT gateway. + The IP address must be one of the IP addresses of the VPC subnet associated with the NAT gateway. + If not spacified, it will be automatically allocated. + Changing this will creates a new resource. + The private IP address of the NAT gateway. + type: string + period: + description: |- + Specifies the charging period of the NAT gateway. + If period_unit is set to month, the value ranges from 1 to 9. + If period_unit is set to year, the value ranges from 1 to 3. + This parameter is mandatory if charging_mode is set to prePaid. + Changing this will create a new resource. + type: number + periodUnit: + description: |- + Specifies the charging period unit of the NAT gateway. + Valid values are month and year. This parameter is mandatory if charging_mode is set to prePaid. + Changing this will create a new resource. + type: string + region: + description: |- + Specifies the region where the NAT gateway is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the NAT gateway is located. + type: string + spec: + description: |- + Specifies the specification of the NAT gateway. The valid values are as follows: + The specification of the NAT gateway. + type: string + subnetId: + description: |- + Specifies the subnet ID of the downstream interface (the next hop of the + DVR) of the NAT gateway. + Changing this will create a new resource. + The network ID of the downstream interface (the next hop of the DVR) of the NAT gateway. + type: string + subnetIdRef: + description: Reference to a Subnet in vpc to populate subnetId. + 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 + subnetIdSelector: + description: Selector for a Subnet in vpc to populate subnetId. + 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 + tags: + additionalProperties: + type: string + description: Specifies the key/value pairs to associate with the + NAT gateway. + type: object + x-kubernetes-map-type: granular + vpcId: + description: |- + Specifies the ID of the VPC to which the NAT gateway belongs. + Changing this will create a new resource. + The ID of the VPC to which the NAT gateway belongs. + type: string + vpcIdRef: + description: Reference to a VPC in vpc to populate vpcId. + 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 + vpcIdSelector: + description: Selector for a VPC in vpc to populate vpcId. + 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: + autoRenew: + description: |- + Specifies whether auto-renew is enabled. This parameter is only valid when + charging_mode is set to prePaid. Valid values are true and false. Defaults to false. + type: string + chargingMode: + description: |- + Specifies the charging mode of the NAT gateway. + The valid values are as follows: + type: string + description: + description: |- + Specifies the description of the NAT gateway, which contain maximum of 512 + characters, and angle brackets (<) and (>) are not allowed. + The description of the NAT gateway. + type: string + enterpriseProjectId: + description: |- + Specifies the enterprise project ID of the NAT gateway. + Changing this will create a new resource. + The enterprise project ID of the NAT gateway. + type: string + name: + description: |- + Specifies the NAT gateway name. + The valid length is limited from 1 to 64, only letters, digits, hyphens (-) and underscores (_) are allowed. + The NAT gateway name. + type: string + ngportIpAddress: + description: |- + Specifies the private IP address of the NAT gateway. + The IP address must be one of the IP addresses of the VPC subnet associated with the NAT gateway. + If not spacified, it will be automatically allocated. + Changing this will creates a new resource. + The private IP address of the NAT gateway. + type: string + period: + description: |- + Specifies the charging period of the NAT gateway. + If period_unit is set to month, the value ranges from 1 to 9. + If period_unit is set to year, the value ranges from 1 to 3. + This parameter is mandatory if charging_mode is set to prePaid. + Changing this will create a new resource. + type: number + periodUnit: + description: |- + Specifies the charging period unit of the NAT gateway. + Valid values are month and year. This parameter is mandatory if charging_mode is set to prePaid. + Changing this will create a new resource. + type: string + region: + description: |- + Specifies the region where the NAT gateway is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the NAT gateway is located. + type: string + spec: + description: |- + Specifies the specification of the NAT gateway. The valid values are as follows: + The specification of the NAT gateway. + type: string + subnetId: + description: |- + Specifies the subnet ID of the downstream interface (the next hop of the + DVR) of the NAT gateway. + Changing this will create a new resource. + The network ID of the downstream interface (the next hop of the DVR) of the NAT gateway. + type: string + subnetIdRef: + description: Reference to a Subnet in vpc to populate subnetId. + 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 + subnetIdSelector: + description: Selector for a Subnet in vpc to populate subnetId. + 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 + tags: + additionalProperties: + type: string + description: Specifies the key/value pairs to associate with the + NAT gateway. + type: object + x-kubernetes-map-type: granular + vpcId: + description: |- + Specifies the ID of the VPC to which the NAT gateway belongs. + Changing this will create a new resource. + The ID of the VPC to which the NAT gateway belongs. + type: string + vpcIdRef: + description: Reference to a VPC in vpc to populate vpcId. + 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 + vpcIdSelector: + description: Selector for a VPC in vpc to populate vpcId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + managementPolicies: + default: + - '*' + 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.name is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.name) + || (has(self.initProvider) && has(self.initProvider.name))' + - message: spec.forProvider.spec is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.spec) + || (has(self.initProvider) && has(self.initProvider.spec))' + status: + description: GatewayStatus defines the observed state of Gateway. + properties: + atProvider: + properties: + autoRenew: + description: |- + Specifies whether auto-renew is enabled. This parameter is only valid when + charging_mode is set to prePaid. Valid values are true and false. Defaults to false. + type: string + chargingMode: + description: |- + Specifies the charging mode of the NAT gateway. + The valid values are as follows: + type: string + description: + description: |- + Specifies the description of the NAT gateway, which contain maximum of 512 + characters, and angle brackets (<) and (>) are not allowed. + The description of the NAT gateway. + type: string + enterpriseProjectId: + description: |- + Specifies the enterprise project ID of the NAT gateway. + Changing this will create a new resource. + The enterprise project ID of the NAT gateway. + type: string + id: + description: The resource ID in UUID format. + type: string + name: + description: |- + Specifies the NAT gateway name. + The valid length is limited from 1 to 64, only letters, digits, hyphens (-) and underscores (_) are allowed. + The NAT gateway name. + type: string + ngportIpAddress: + description: |- + Specifies the private IP address of the NAT gateway. + The IP address must be one of the IP addresses of the VPC subnet associated with the NAT gateway. + If not spacified, it will be automatically allocated. + Changing this will creates a new resource. + The private IP address of the NAT gateway. + type: string + period: + description: |- + Specifies the charging period of the NAT gateway. + If period_unit is set to month, the value ranges from 1 to 9. + If period_unit is set to year, the value ranges from 1 to 3. + This parameter is mandatory if charging_mode is set to prePaid. + Changing this will create a new resource. + type: number + periodUnit: + description: |- + Specifies the charging period unit of the NAT gateway. + Valid values are month and year. This parameter is mandatory if charging_mode is set to prePaid. + Changing this will create a new resource. + type: string + region: + description: |- + Specifies the region where the NAT gateway is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the NAT gateway is located. + type: string + spec: + description: |- + Specifies the specification of the NAT gateway. The valid values are as follows: + The specification of the NAT gateway. + type: string + status: + description: |- + The current status of the NAT gateway. + The current status of the NAT gateway. + type: string + subnetId: + description: |- + Specifies the subnet ID of the downstream interface (the next hop of the + DVR) of the NAT gateway. + Changing this will create a new resource. + The network ID of the downstream interface (the next hop of the DVR) of the NAT gateway. + type: string + tags: + additionalProperties: + type: string + description: Specifies the key/value pairs to associate with the + NAT gateway. + type: object + x-kubernetes-map-type: granular + vpcId: + description: |- + Specifies the ID of the VPC to which the NAT gateway belongs. + Changing this will create a new resource. + The ID of the VPC to which the NAT gateway belongs. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/nat.huaweicloud.crossplane.io_privatednatrules.yaml b/package/crds/nat.huaweicloud.crossplane.io_privatednatrules.yaml new file mode 100644 index 0000000..ebd71da --- /dev/null +++ b/package/crds/nat.huaweicloud.crossplane.io_privatednatrules.yaml @@ -0,0 +1,801 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: privatednatrules.nat.huaweicloud.crossplane.io +spec: + group: nat.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: PrivateDnatRule + listKind: PrivateDnatRuleList + plural: privatednatrules + singular: privatednatrule + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: PrivateDnatRule is the Schema for the PrivateDnatRules API. "" + 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: PrivateDnatRuleSpec defines the desired state of PrivateDnatRule + 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: + backendInterfaceId: + description: |- + Specifies the network interface ID of the transit IP for private NAT. + Exactly one of backend_interface_id and backend_private_ip must be set. + The network interface ID of the transit IP for private NAT. + type: string + backendPrivateIp: + description: |- + Specifies the private IP address of the backend instance. + The private IP address of the backend instance. + type: string + description: + description: |- + Specifies the description of the DNAT rule, which contain maximum of 255 + characters, and angle brackets (< and >) are not allowed. + The description of the DNAT rule. + type: string + gatewayId: + description: |- + Specifies the private NAT gateway ID to which the DNAT rule belongs. + Changing this will create a new resource. + The private NAT gateway ID to which the DNAT rule belongs. + type: string + gatewayIdRef: + description: Reference to a PrivateGateway in nat to populate + gatewayId. + 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 + gatewayIdSelector: + description: Selector for a PrivateGateway in nat to populate + gatewayId. + 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 + internalServicePort: + description: |- + Specifies the port of the backend instance. + The port of the backend instance. + type: number + protocol: + description: |- + Specifies the protocol type. + The valid values are tcp, udp and any. Defaults to any. + The protocol type. + type: string + region: + description: |- + Specifies the region where the DNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the DNAT rule is located. + type: string + transitIpId: + description: |- + Specifies the ID of the transit IP for private NAT. + The ID of the transit IP for private NAT. + type: string + transitIpIdRef: + description: Reference to a PrivateTransitIP in nat to populate + transitIpId. + 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 + transitIpIdSelector: + description: Selector for a PrivateTransitIP in nat to populate + transitIpId. + 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 + transitServicePort: + description: |- + Specifies the port of the transit IP. + The port of the transit IP. + type: number + 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: + backendInterfaceId: + description: |- + Specifies the network interface ID of the transit IP for private NAT. + Exactly one of backend_interface_id and backend_private_ip must be set. + The network interface ID of the transit IP for private NAT. + type: string + backendPrivateIp: + description: |- + Specifies the private IP address of the backend instance. + The private IP address of the backend instance. + type: string + description: + description: |- + Specifies the description of the DNAT rule, which contain maximum of 255 + characters, and angle brackets (< and >) are not allowed. + The description of the DNAT rule. + type: string + gatewayId: + description: |- + Specifies the private NAT gateway ID to which the DNAT rule belongs. + Changing this will create a new resource. + The private NAT gateway ID to which the DNAT rule belongs. + type: string + gatewayIdRef: + description: Reference to a PrivateGateway in nat to populate + gatewayId. + 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 + gatewayIdSelector: + description: Selector for a PrivateGateway in nat to populate + gatewayId. + 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 + internalServicePort: + description: |- + Specifies the port of the backend instance. + The port of the backend instance. + type: number + protocol: + description: |- + Specifies the protocol type. + The valid values are tcp, udp and any. Defaults to any. + The protocol type. + type: string + region: + description: |- + Specifies the region where the DNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the DNAT rule is located. + type: string + transitIpId: + description: |- + Specifies the ID of the transit IP for private NAT. + The ID of the transit IP for private NAT. + type: string + transitIpIdRef: + description: Reference to a PrivateTransitIP in nat to populate + transitIpId. + 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 + transitIpIdSelector: + description: Selector for a PrivateTransitIP in nat to populate + transitIpId. + 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 + transitServicePort: + description: |- + Specifies the port of the transit IP. + The port of the transit IP. + 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: PrivateDnatRuleStatus defines the observed state of PrivateDnatRule. + properties: + atProvider: + properties: + backendInterfaceId: + description: |- + Specifies the network interface ID of the transit IP for private NAT. + Exactly one of backend_interface_id and backend_private_ip must be set. + The network interface ID of the transit IP for private NAT. + type: string + backendPrivateIp: + description: |- + Specifies the private IP address of the backend instance. + The private IP address of the backend instance. + type: string + backendType: + description: |- + The type of backend instance. + The valid values are as follows: + The type of backend instance. + type: string + createdAt: + description: |- + The creation time of the DNAT rule. + The creation time of the DNAT rule. + type: string + description: + description: |- + Specifies the description of the DNAT rule, which contain maximum of 255 + characters, and angle brackets (< and >) are not allowed. + The description of the DNAT rule. + type: string + enterpriseProjectId: + description: |- + The ID of the enterprise project to which the private DNAT rule belongs. + The ID of the enterprise project to which the private DNAT rule belongs. + type: string + gatewayId: + description: |- + Specifies the private NAT gateway ID to which the DNAT rule belongs. + Changing this will create a new resource. + The private NAT gateway ID to which the DNAT rule belongs. + type: string + id: + description: The resource ID in UUID format. + type: string + internalServicePort: + description: |- + Specifies the port of the backend instance. + The port of the backend instance. + type: number + protocol: + description: |- + Specifies the protocol type. + The valid values are tcp, udp and any. Defaults to any. + The protocol type. + type: string + region: + description: |- + Specifies the region where the DNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the DNAT rule is located. + type: string + transitIpId: + description: |- + Specifies the ID of the transit IP for private NAT. + The ID of the transit IP for private NAT. + type: string + transitServicePort: + description: |- + Specifies the port of the transit IP. + The port of the transit IP. + type: number + updatedAt: + description: |- + The latest update time of the DNAT rule. + The latest update time of the DNAT rule. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/nat.huaweicloud.crossplane.io_privategateways.yaml b/package/crds/nat.huaweicloud.crossplane.io_privategateways.yaml new file mode 100644 index 0000000..d4195a4 --- /dev/null +++ b/package/crds/nat.huaweicloud.crossplane.io_privategateways.yaml @@ -0,0 +1,637 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: privategateways.nat.huaweicloud.crossplane.io +spec: + group: nat.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: PrivateGateway + listKind: PrivateGatewayList + plural: privategateways + singular: privategateway + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: PrivateGateway is the Schema for the PrivateGateways API. "" + 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: PrivateGatewaySpec defines the desired state of PrivateGateway + 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: |- + Specifies the description of the private NAT gateway, which contain maximum of + 255 characters, and angle brackets (< and >) are not allowed. + The description of the private NAT gateway. + type: string + enterpriseProjectId: + description: |- + Specifies the ID of the enterprise project to which the private + NAT gateway belongs. + Changing this will create a new resource. + The ID of the enterprise project to which the private NAT gateway belongs. + type: string + name: + description: |- + Specifies the private NAT gateway name. + The valid length is limited from 1 to 64, only English letters, Chinese characters, digits, hyphens (-) and + underscores (_) are allowed. + The name of the private NAT gateway. + type: string + region: + description: |- + Specifies the region where the private NAT gateway is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the private NAT gateway is located. + type: string + spec: + description: |- + Specifies the specification of the private NAT gateway. + The valid values are as follows: + The specification of the private NAT gateway. + type: string + subnetId: + description: |- + Specifies the network ID of the subnet to which the private NAT gateway + belongs. + Changing this will create a new resource. + The network ID of the subnet to which the private NAT gateway belongs. + type: string + subnetIdRef: + description: Reference to a Subnet in vpc to populate subnetId. + 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 + subnetIdSelector: + description: Selector for a Subnet in vpc to populate subnetId. + 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 + tags: + additionalProperties: + type: string + description: Specifies the key/value pairs to associate with the + private NAT gateway. + type: object + x-kubernetes-map-type: granular + 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: |- + Specifies the description of the private NAT gateway, which contain maximum of + 255 characters, and angle brackets (< and >) are not allowed. + The description of the private NAT gateway. + type: string + enterpriseProjectId: + description: |- + Specifies the ID of the enterprise project to which the private + NAT gateway belongs. + Changing this will create a new resource. + The ID of the enterprise project to which the private NAT gateway belongs. + type: string + name: + description: |- + Specifies the private NAT gateway name. + The valid length is limited from 1 to 64, only English letters, Chinese characters, digits, hyphens (-) and + underscores (_) are allowed. + The name of the private NAT gateway. + type: string + region: + description: |- + Specifies the region where the private NAT gateway is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the private NAT gateway is located. + type: string + spec: + description: |- + Specifies the specification of the private NAT gateway. + The valid values are as follows: + The specification of the private NAT gateway. + type: string + subnetId: + description: |- + Specifies the network ID of the subnet to which the private NAT gateway + belongs. + Changing this will create a new resource. + The network ID of the subnet to which the private NAT gateway belongs. + type: string + subnetIdRef: + description: Reference to a Subnet in vpc to populate subnetId. + 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 + subnetIdSelector: + description: Selector for a Subnet in vpc to populate subnetId. + 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 + tags: + additionalProperties: + type: string + description: Specifies the key/value pairs to associate with the + private NAT gateway. + type: object + x-kubernetes-map-type: granular + 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.name is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.name) + || (has(self.initProvider) && has(self.initProvider.name))' + status: + description: PrivateGatewayStatus defines the observed state of PrivateGateway. + properties: + atProvider: + properties: + createdAt: + description: |- + The creation time of the private NAT gateway. + The creation time of the private NAT gateway. + type: string + description: + description: |- + Specifies the description of the private NAT gateway, which contain maximum of + 255 characters, and angle brackets (< and >) are not allowed. + The description of the private NAT gateway. + type: string + enterpriseProjectId: + description: |- + Specifies the ID of the enterprise project to which the private + NAT gateway belongs. + Changing this will create a new resource. + The ID of the enterprise project to which the private NAT gateway belongs. + type: string + id: + description: The resource ID in UUID format. + type: string + name: + description: |- + Specifies the private NAT gateway name. + The valid length is limited from 1 to 64, only English letters, Chinese characters, digits, hyphens (-) and + underscores (_) are allowed. + The name of the private NAT gateway. + type: string + region: + description: |- + Specifies the region where the private NAT gateway is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the private NAT gateway is located. + type: string + spec: + description: |- + Specifies the specification of the private NAT gateway. + The valid values are as follows: + The specification of the private NAT gateway. + type: string + status: + description: |- + The current status of the private NAT gateway. + The current status of the private NAT gateway. + type: string + subnetId: + description: |- + Specifies the network ID of the subnet to which the private NAT gateway + belongs. + Changing this will create a new resource. + The network ID of the subnet to which the private NAT gateway belongs. + type: string + tags: + additionalProperties: + type: string + description: Specifies the key/value pairs to associate with the + private NAT gateway. + type: object + x-kubernetes-map-type: granular + updatedAt: + description: |- + The latest update time of the private NAT gateway. + The latest update time of the private NAT gateway. + type: string + vpcId: + description: |- + The ID of the VPC to which the private NAT gateway belongs. + The ID of the VPC to which the private NAT gateway belongs. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/nat.huaweicloud.crossplane.io_privatesnatrules.yaml b/package/crds/nat.huaweicloud.crossplane.io_privatesnatrules.yaml new file mode 100644 index 0000000..11e4c0e --- /dev/null +++ b/package/crds/nat.huaweicloud.crossplane.io_privatesnatrules.yaml @@ -0,0 +1,906 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: privatesnatrules.nat.huaweicloud.crossplane.io +spec: + group: nat.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: PrivateSnatRule + listKind: PrivateSnatRuleList + plural: privatesnatrules + singular: privatesnatrule + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: PrivateSnatRule is the Schema for the PrivateSnatRules API. "" + 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: PrivateSnatRuleSpec defines the desired state of PrivateSnatRule + 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: + cidr: + description: |- + Specifies the CIDR block of the match rule. + Changing this will create a new resource. + Exactly one of cidr and subnet_id must be set. + The CIDR block of the match rule. + type: string + description: + description: |- + Specifies the description of the SNAT rule, which contain maximum of 255 + characters, and angle brackets (< and >) are not allowed. + The description of the SNAT rule. + type: string + gatewayId: + description: |- + Specifies the private NAT gateway ID to which the SNAT rule belongs. + Changing this will create a new resource. + The private NAT gateway ID to which the SNAT rule belongs. + type: string + gatewayIdRef: + description: Reference to a PrivateGateway in nat to populate + gatewayId. + 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 + gatewayIdSelector: + description: Selector for a PrivateGateway in nat to populate + gatewayId. + 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 + region: + description: |- + Specifies the region where the SNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the SNAT rule is located. + type: string + subnetId: + description: |- + Specifies the subnet ID of the match rule. + Changing this will create a new resource. + The subnet ID of the match rule. + type: string + subnetIdRef: + description: Reference to a Subnet in vpc to populate subnetId. + 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 + subnetIdSelector: + description: Selector for a Subnet in vpc to populate subnetId. + 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 + transitIpId: + description: |- + Specifies the ID of the transit IP associated with SNAT rule. + The ID of the transit IP associated with SNAT rule. + type: string + transitIpIdRef: + description: Reference to a PrivateTransitIP in nat to populate + transitIpId. + 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 + transitIpIdSelector: + description: Selector for a PrivateTransitIP in nat to populate + transitIpId. + 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: + cidr: + description: |- + Specifies the CIDR block of the match rule. + Changing this will create a new resource. + Exactly one of cidr and subnet_id must be set. + The CIDR block of the match rule. + type: string + description: + description: |- + Specifies the description of the SNAT rule, which contain maximum of 255 + characters, and angle brackets (< and >) are not allowed. + The description of the SNAT rule. + type: string + gatewayId: + description: |- + Specifies the private NAT gateway ID to which the SNAT rule belongs. + Changing this will create a new resource. + The private NAT gateway ID to which the SNAT rule belongs. + type: string + gatewayIdRef: + description: Reference to a PrivateGateway in nat to populate + gatewayId. + 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 + gatewayIdSelector: + description: Selector for a PrivateGateway in nat to populate + gatewayId. + 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 + region: + description: |- + Specifies the region where the SNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the SNAT rule is located. + type: string + subnetId: + description: |- + Specifies the subnet ID of the match rule. + Changing this will create a new resource. + The subnet ID of the match rule. + type: string + subnetIdRef: + description: Reference to a Subnet in vpc to populate subnetId. + 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 + subnetIdSelector: + description: Selector for a Subnet in vpc to populate subnetId. + 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 + transitIpId: + description: |- + Specifies the ID of the transit IP associated with SNAT rule. + The ID of the transit IP associated with SNAT rule. + type: string + transitIpIdRef: + description: Reference to a PrivateTransitIP in nat to populate + transitIpId. + 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 + transitIpIdSelector: + description: Selector for a PrivateTransitIP in nat to populate + transitIpId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + managementPolicies: + default: + - '*' + 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: PrivateSnatRuleStatus defines the observed state of PrivateSnatRule. + properties: + atProvider: + properties: + cidr: + description: |- + Specifies the CIDR block of the match rule. + Changing this will create a new resource. + Exactly one of cidr and subnet_id must be set. + The CIDR block of the match rule. + type: string + createdAt: + description: |- + The creation time of the SNAT rule. + The creation time of the SNAT rule. + type: string + description: + description: |- + Specifies the description of the SNAT rule, which contain maximum of 255 + characters, and angle brackets (< and >) are not allowed. + The description of the SNAT rule. + type: string + enterpriseProjectId: + description: |- + The ID of the enterprise project to which the private SNAT rule belongs. + The ID of the enterprise project to which the private SNAT rule belongs. + type: string + gatewayId: + description: |- + Specifies the private NAT gateway ID to which the SNAT rule belongs. + Changing this will create a new resource. + The private NAT gateway ID to which the SNAT rule belongs. + type: string + id: + description: The resource ID in UUID format. + type: string + region: + description: |- + Specifies the region where the SNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the SNAT rule is located. + type: string + subnetId: + description: |- + Specifies the subnet ID of the match rule. + Changing this will create a new resource. + The subnet ID of the match rule. + type: string + transitIpAddress: + description: |- + The address of the transit IP. + The address of the transit IP + type: string + transitIpId: + description: |- + Specifies the ID of the transit IP associated with SNAT rule. + The ID of the transit IP associated with SNAT rule. + type: string + updatedAt: + description: |- + The latest update time of the SNAT rule. + The latest update time of the SNAT rule. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/nat.huaweicloud.crossplane.io_privatetransitips.yaml b/package/crds/nat.huaweicloud.crossplane.io_privatetransitips.yaml new file mode 100644 index 0000000..e1735e0 --- /dev/null +++ b/package/crds/nat.huaweicloud.crossplane.io_privatetransitips.yaml @@ -0,0 +1,591 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: privatetransitips.nat.huaweicloud.crossplane.io +spec: + group: nat.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: PrivateTransitIP + listKind: PrivateTransitIPList + plural: privatetransitips + singular: privatetransitip + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: PrivateTransitIP is the Schema for the PrivateTransitIPs API. + "" + 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: PrivateTransitIPSpec defines the desired state of PrivateTransitIP + 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: + enterpriseProjectId: + description: |- + Specifies the ID of the enterprise project to which the transit + IP belongs. + Changing this will create a new resource. + The ID of the enterprise project to which the transit IP belongs. + type: string + ipAddress: + description: |- + Specifies the IP address of the transit subnet. + Changing this will create a new resource. + The IP address of the transit subnet. + type: string + region: + description: |- + Specifies the region where the transit IP is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the transit IP is located. + type: string + subnetId: + description: |- + Specifies the transit subnet ID to which the transit IP belongs. + Changing this will create a new resource. + The ID of the transit subnet to which the transit IP belongs. + type: string + subnetIdRef: + description: Reference to a Subnet in vpc to populate subnetId. + 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 + subnetIdSelector: + description: Selector for a Subnet in vpc to populate subnetId. + 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 + tags: + additionalProperties: + type: string + description: Specifies the key/value pairs to associate with the + transit IP. + type: object + x-kubernetes-map-type: granular + 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: + enterpriseProjectId: + description: |- + Specifies the ID of the enterprise project to which the transit + IP belongs. + Changing this will create a new resource. + The ID of the enterprise project to which the transit IP belongs. + type: string + ipAddress: + description: |- + Specifies the IP address of the transit subnet. + Changing this will create a new resource. + The IP address of the transit subnet. + type: string + region: + description: |- + Specifies the region where the transit IP is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the transit IP is located. + type: string + subnetId: + description: |- + Specifies the transit subnet ID to which the transit IP belongs. + Changing this will create a new resource. + The ID of the transit subnet to which the transit IP belongs. + type: string + subnetIdRef: + description: Reference to a Subnet in vpc to populate subnetId. + 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 + subnetIdSelector: + description: Selector for a Subnet in vpc to populate subnetId. + 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 + tags: + additionalProperties: + type: string + description: Specifies the key/value pairs to associate with the + transit IP. + type: object + x-kubernetes-map-type: granular + 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: PrivateTransitIPStatus defines the observed state of PrivateTransitIP. + properties: + atProvider: + properties: + createdAt: + description: |- + The creation time of the transit IP for private NAT. + The creation time of the transit IP for private NAT. + type: string + enterpriseProjectId: + description: |- + Specifies the ID of the enterprise project to which the transit + IP belongs. + Changing this will create a new resource. + The ID of the enterprise project to which the transit IP belongs. + type: string + gatewayId: + description: |- + The ID of the private NAT gateway to which the transit IP belongs. + The ID of the private NAT gateway to which the transit IP belongs. + type: string + id: + description: The resource ID in UUID format. + type: string + ipAddress: + description: |- + Specifies the IP address of the transit subnet. + Changing this will create a new resource. + The IP address of the transit subnet. + type: string + networkInterfaceId: + description: |- + The network interface ID of the transit IP for private NAT. + The network interface ID of the transit IP for private NAT. + type: string + region: + description: |- + Specifies the region where the transit IP is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the transit IP is located. + type: string + subnetId: + description: |- + Specifies the transit subnet ID to which the transit IP belongs. + Changing this will create a new resource. + The ID of the transit subnet to which the transit IP belongs. + type: string + tags: + additionalProperties: + type: string + description: Specifies the key/value pairs to associate with the + transit IP. + type: object + x-kubernetes-map-type: granular + updatedAt: + description: |- + The latest update time of the transit IP for private NAT. + The latest update time of the transit IP for private NAT. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/nat.huaweicloud.crossplane.io_snatrules.yaml b/package/crds/nat.huaweicloud.crossplane.io_snatrules.yaml new file mode 100644 index 0000000..c9290c3 --- /dev/null +++ b/package/crds/nat.huaweicloud.crossplane.io_snatrules.yaml @@ -0,0 +1,1089 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: snatrules.nat.huaweicloud.crossplane.io +spec: + group: nat.huaweicloud.crossplane.io + names: + categories: + - crossplane + - managed + - huaweicloud + kind: SnatRule + listKind: SnatRuleList + plural: snatrules + singular: snatrule + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: SnatRule is the Schema for the SnatRules API. "" + 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: SnatRuleSpec defines the desired state of SnatRule + 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: + cidr: + description: |- + Specifies the CIDR block connected by SNAT rule (DC side). + This parameter and subnet_id are alternative. Changing this will create a new resource. + The CIDR block connected by SNAT rule (DC side). + type: string + description: + description: |- + Specifies the description of the SNAT rule. + The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + The description of the SNAT rule. + type: string + floatingIpId: + description: |- + Specifies the IDs of floating IPs connected by SNAT rule. + Multiple floating IPs are separated using commas (,). The number of floating IP IDs cannot exceed 20. + The IDs of floating IPs connected by SNAT rule. + type: string + floatingIpIdRef: + description: Reference to a VpcEip in eip to populate floatingIpId. + 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 + floatingIpIdSelector: + description: Selector for a VpcEip in eip to populate floatingIpId. + 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 + globalEipId: + description: |- + Specifies the IDs of global EIPs connected by SNAT rule. + Multiple global EIPs are separated using commas (,). The number of global EIP IDs cannot exceed 20. + The IDs (separated by commas) of global EIPs connected by SNAT rule. + type: string + globalEipIdRef: + description: Reference to a GlobalEip in eip to populate globalEipId. + 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 + globalEipIdSelector: + description: Selector for a GlobalEip in eip to populate globalEipId. + 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 + natGatewayId: + description: |- + Specifies the ID of the gateway to which the SNAT rule belongs. + Changing this will create a new resource. + schema: Required; The ID of the gateway to which the SNAT rule belongs. + type: string + natGatewayIdRef: + description: Reference to a Gateway in nat to populate natGatewayId. + 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 + natGatewayIdSelector: + description: Selector for a Gateway in nat to populate natGatewayId. + 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 + networkId: + description: Specifies a resource ID in UUID format. + type: string + region: + description: |- + Specifies the region where the SNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the SNAT rule is located. + type: string + sourceType: + description: |- + Specifies the resource scenario. + The valid values are 0 (VPC scenario) and 1 (Direct Connect scenario), and the default value is 0. + Only cidr can be specified over a Direct Connect connection. Changing this will create a new resource. + The resource type of the SNAT rule. + type: number + subnetId: + description: |- + Specifies the network IDs of subnet connected by SNAT rule (VPC side). + This parameter and cidr are alternative. Changing this will create a new resource. + The network IDs of subnet connected by SNAT rule (VPC side). + type: string + subnetIdRef: + description: Reference to a Subnet in vpc to populate subnetId. + 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 + subnetIdSelector: + description: Selector for a Subnet in vpc to populate subnetId. + 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: + cidr: + description: |- + Specifies the CIDR block connected by SNAT rule (DC side). + This parameter and subnet_id are alternative. Changing this will create a new resource. + The CIDR block connected by SNAT rule (DC side). + type: string + description: + description: |- + Specifies the description of the SNAT rule. + The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + The description of the SNAT rule. + type: string + floatingIpId: + description: |- + Specifies the IDs of floating IPs connected by SNAT rule. + Multiple floating IPs are separated using commas (,). The number of floating IP IDs cannot exceed 20. + The IDs of floating IPs connected by SNAT rule. + type: string + floatingIpIdRef: + description: Reference to a VpcEip in eip to populate floatingIpId. + 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 + floatingIpIdSelector: + description: Selector for a VpcEip in eip to populate floatingIpId. + 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 + globalEipId: + description: |- + Specifies the IDs of global EIPs connected by SNAT rule. + Multiple global EIPs are separated using commas (,). The number of global EIP IDs cannot exceed 20. + The IDs (separated by commas) of global EIPs connected by SNAT rule. + type: string + globalEipIdRef: + description: Reference to a GlobalEip in eip to populate globalEipId. + 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 + globalEipIdSelector: + description: Selector for a GlobalEip in eip to populate globalEipId. + 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 + natGatewayId: + description: |- + Specifies the ID of the gateway to which the SNAT rule belongs. + Changing this will create a new resource. + schema: Required; The ID of the gateway to which the SNAT rule belongs. + type: string + natGatewayIdRef: + description: Reference to a Gateway in nat to populate natGatewayId. + 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 + natGatewayIdSelector: + description: Selector for a Gateway in nat to populate natGatewayId. + 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 + networkId: + description: Specifies a resource ID in UUID format. + type: string + region: + description: |- + Specifies the region where the SNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the SNAT rule is located. + type: string + sourceType: + description: |- + Specifies the resource scenario. + The valid values are 0 (VPC scenario) and 1 (Direct Connect scenario), and the default value is 0. + Only cidr can be specified over a Direct Connect connection. Changing this will create a new resource. + The resource type of the SNAT rule. + type: number + subnetId: + description: |- + Specifies the network IDs of subnet connected by SNAT rule (VPC side). + This parameter and cidr are alternative. Changing this will create a new resource. + The network IDs of subnet connected by SNAT rule (VPC side). + type: string + subnetIdRef: + description: Reference to a Subnet in vpc to populate subnetId. + 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 + subnetIdSelector: + description: Selector for a Subnet in vpc to populate subnetId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + managementPolicies: + default: + - '*' + 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: SnatRuleStatus defines the observed state of SnatRule. + properties: + atProvider: + properties: + cidr: + description: |- + Specifies the CIDR block connected by SNAT rule (DC side). + This parameter and subnet_id are alternative. Changing this will create a new resource. + The CIDR block connected by SNAT rule (DC side). + type: string + description: + description: |- + Specifies the description of the SNAT rule. + The value is a string of no more than 255 characters, and angle brackets (<>) are not allowed. + The description of the SNAT rule. + type: string + floatingIpAddress: + description: |- + The actual floating IP address. + The floating IP addresses (separated by commas) connected by SNAT rule. + type: string + floatingIpId: + description: |- + Specifies the IDs of floating IPs connected by SNAT rule. + Multiple floating IPs are separated using commas (,). The number of floating IP IDs cannot exceed 20. + The IDs of floating IPs connected by SNAT rule. + type: string + globalEipAddress: + description: |- + The global EIP addresses (separated by commas) connected by SNAT rule. + The global EIP addresses (separated by commas) connected by SNAT rule. + type: string + globalEipId: + description: |- + Specifies the IDs of global EIPs connected by SNAT rule. + Multiple global EIPs are separated using commas (,). The number of global EIP IDs cannot exceed 20. + The IDs (separated by commas) of global EIPs connected by SNAT rule. + type: string + id: + description: Specifies a resource ID in UUID format. + type: string + natGatewayId: + description: |- + Specifies the ID of the gateway to which the SNAT rule belongs. + Changing this will create a new resource. + schema: Required; The ID of the gateway to which the SNAT rule belongs. + type: string + networkId: + description: Specifies a resource ID in UUID format. + type: string + region: + description: |- + Specifies the region where the SNAT rule is located. + If omitted, the provider-level region will be used. Changing this will create a new resource. + The region where the SNAT rule is located. + type: string + sourceType: + description: |- + Specifies the resource scenario. + The valid values are 0 (VPC scenario) and 1 (Direct Connect scenario), and the default value is 0. + Only cidr can be specified over a Direct Connect connection. Changing this will create a new resource. + The resource type of the SNAT rule. + type: number + status: + description: |- + The status of the SNAT rule. + The status of the SNAT rule. + type: string + subnetId: + description: |- + Specifies the network IDs of subnet connected by SNAT rule (VPC side). + This parameter and cidr are alternative. Changing this will create a new resource. + The network IDs of subnet connected by SNAT rule (VPC side). + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} From 056d6d4dd3b532e4d2f86b0490af0cb99846405a Mon Sep 17 00:00:00 2001 From: Jason Zhang Date: Wed, 25 Dec 2024 16:12:40 +0800 Subject: [PATCH 2/2] add nat examples --- docs/configuration.md | 4 +-- examples/ecs/instance.yaml | 4 +-- examples/install.yaml | 2 +- examples/nat/dnatrule.yaml | 42 +++++++++++++++++++++++ examples/nat/gateway.yaml | 54 ++++++++++++++++++++++++++++++ examples/nat/privatednatrule.yaml | 22 ++++++++++++ examples/nat/privategateway.yaml | 17 ++++++++++ examples/nat/privatesnatrule.yaml | 21 ++++++++++++ examples/nat/privatetransitip.yaml | 52 ++++++++++++++++++++++++++++ examples/nat/snatrule.yaml | 19 +++++++++++ 10 files changed, 232 insertions(+), 5 deletions(-) create mode 100644 examples/nat/dnatrule.yaml create mode 100644 examples/nat/gateway.yaml create mode 100644 examples/nat/privatednatrule.yaml create mode 100644 examples/nat/privategateway.yaml create mode 100644 examples/nat/privatesnatrule.yaml create mode 100644 examples/nat/privatetransitip.yaml create mode 100644 examples/nat/snatrule.yaml diff --git a/docs/configuration.md b/docs/configuration.md index 92517e6..04e0563 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -10,7 +10,7 @@ kind: Provider metadata: name: provider-huaweicloud spec: - package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.7 + package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.8 ``` Define the provider version with `spec.package`. @@ -22,7 +22,7 @@ Verify the configuration with `kubectl get providers`. ```shell $ kubectl get providers NAME INSTALLED HEALTHY PACKAGE AGE -provider-huaweicloud True True xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.7 54s +provider-huaweicloud True True xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.8 54s ``` View the Crossplane [Provider CRD definition](https://doc.crds.dev/github.com/huaweicloud/provider-huaweicloud) to view all available `Provider` options. diff --git a/examples/ecs/instance.yaml b/examples/ecs/instance.yaml index a18e4a2..e76e19a 100644 --- a/examples/ecs/instance.yaml +++ b/examples/ecs/instance.yaml @@ -13,6 +13,6 @@ spec: imageId: 89ac6e18-d938-4b0d-b038-bcdb03a1b87f name: basic network: - - uuid: fcc7de56-f312-4534-abe3-70943f5c8f51 + - uuid: 534b6d1b-b532-4e32-9e98-1329562a8f4e securityGroupIds: - - e46c940a-fc5e-411f-8d61-2ef918be855c + - 07d8d2fa-c206-4794-8804-8de5b22fb0cc diff --git a/examples/install.yaml b/examples/install.yaml index 08928e6..91c8b34 100644 --- a/examples/install.yaml +++ b/examples/install.yaml @@ -3,7 +3,7 @@ kind: Provider metadata: name: provider-huaweicloud spec: - package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.0-7 + package: xpkg.upbound.io/hcs/provider-huaweicloud:v0.0.8 controllerConfigRef: name: debug-config diff --git a/examples/nat/dnatrule.yaml b/examples/nat/dnatrule.yaml new file mode 100644 index 0000000..ee35c8a --- /dev/null +++ b/examples/nat/dnatrule.yaml @@ -0,0 +1,42 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: DnatRule +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/dnatrule + labels: + testing.upbound.io/example-name: test + name: test +spec: + initProvider: + privateIp: "" + forProvider: + externalServicePort: 8023 + floatingIpIdSelector: + matchLabels: + testing.upbound.io/example-name: dedicated + internalServicePort: 23 + natGatewayIdSelector: + matchLabels: + testing.upbound.io/example-name: test + portId: 0939e3e6-ffaa-467a-930b-fd17ec82d3f5 + protocol: tcp + +--- + +apiVersion: eip.huaweicloud.crossplane.io/v1alpha1 +kind: VpcEip +metadata: + annotations: + meta.upbound.io/example-id: eip/v1alpha1/vpceip + labels: + testing.upbound.io/example-name: dedicated + name: dedicated +spec: + forProvider: + bandwidth: + - chargeMode: traffic + name: crossplane-test + shareType: PER + size: 10 + publicip: + - type: 5_bgp \ No newline at end of file diff --git a/examples/nat/gateway.yaml b/examples/nat/gateway.yaml new file mode 100644 index 0000000..f3d9203 --- /dev/null +++ b/examples/nat/gateway.yaml @@ -0,0 +1,54 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: Gateway +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/gateway + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + description: test for crossplane + name: crossplane-test + spec: "1" + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: subnet + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: vpc + +--- + +apiVersion: vpc.huaweicloud.crossplane.io/v1alpha1 +kind: Subnet +metadata: + annotations: + meta.upbound.io/example-id: vpc/v1alpha1/subnet + labels: + testing.upbound.io/example-name: subnet + name: subnet +spec: + forProvider: + availabilityZone: cn-north-4a + cidr: 192.168.0.0/24 + gatewayIp: 192.168.0.1 + name: crossplane_test + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: vpc + +--- + +apiVersion: vpc.huaweicloud.crossplane.io/v1alpha1 +kind: VPC +metadata: + annotations: + meta.upbound.io/example-id: vpc/v1alpha1/vpc + labels: + testing.upbound.io/example-name: vpc + name: vpc +spec: + forProvider: + cidr: 192.168.0.0/16 + name: crossplane_test diff --git a/examples/nat/privatednatrule.yaml b/examples/nat/privatednatrule.yaml new file mode 100644 index 0000000..b214509 --- /dev/null +++ b/examples/nat/privatednatrule.yaml @@ -0,0 +1,22 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: PrivateDnatRule +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/privatednatrule + labels: + testing.upbound.io/example-name: test + name: test +spec: + initProvider: + backendPrivateIp: "" + forProvider: + backendInterfaceId: 0939e3e6-ffaa-467a-930b-fd17ec82d3f5 + gatewayIdSelector: + matchLabels: + testing.upbound.io/example-name: test-private + internalServicePort: 2000 + protocol: tcp + transitIpIdSelector: + matchLabels: + testing.upbound.io/example-name: test + transitServicePort: 1000 diff --git a/examples/nat/privategateway.yaml b/examples/nat/privategateway.yaml new file mode 100644 index 0000000..9365667 --- /dev/null +++ b/examples/nat/privategateway.yaml @@ -0,0 +1,17 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: PrivateGateway +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/privategateway + labels: + testing.upbound.io/example-name: test-private + name: test-private +spec: + forProvider: + description: Created by crossplane + enterpriseProjectId: "0" + name: crossplane-test + spec: Small + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: subnet diff --git a/examples/nat/privatesnatrule.yaml b/examples/nat/privatesnatrule.yaml new file mode 100644 index 0000000..0068b73 --- /dev/null +++ b/examples/nat/privatesnatrule.yaml @@ -0,0 +1,21 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: PrivateSnatRule +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/privatesnatrule + labels: + testing.upbound.io/example-name: test + name: test +spec: + initProvider: + cidr: "" + forProvider: + gatewayIdSelector: + matchLabels: + testing.upbound.io/example-name: test-private + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: subnet1 + transitIpIdSelector: + matchLabels: + testing.upbound.io/example-name: test diff --git a/examples/nat/privatetransitip.yaml b/examples/nat/privatetransitip.yaml new file mode 100644 index 0000000..f1fba6b --- /dev/null +++ b/examples/nat/privatetransitip.yaml @@ -0,0 +1,52 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: PrivateTransitIP +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/privatetransitip + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + enterpriseProjectId: "0" + ipAddress: 192.168.0.100 + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: subnet1 + tags: + foo: bar + +--- + +apiVersion: vpc.huaweicloud.crossplane.io/v1alpha1 +kind: Subnet +metadata: + annotations: + meta.upbound.io/example-id: vpc/v1alpha1/subnet + labels: + testing.upbound.io/example-name: subnet1 + name: subnet1 +spec: + forProvider: + availabilityZone: cn-north-4a + cidr: 192.168.0.0/24 + gatewayIp: 192.168.0.1 + name: crossplane_test1 + vpcIdSelector: + matchLabels: + testing.upbound.io/example-name: vpc1 + +--- + +apiVersion: vpc.huaweicloud.crossplane.io/v1alpha1 +kind: VPC +metadata: + annotations: + meta.upbound.io/example-id: vpc/v1alpha1/vpc + labels: + testing.upbound.io/example-name: vpc1 + name: vpc1 +spec: + forProvider: + cidr: 192.168.0.0/16 + name: crossplane_test1 \ No newline at end of file diff --git a/examples/nat/snatrule.yaml b/examples/nat/snatrule.yaml new file mode 100644 index 0000000..2ced6d2 --- /dev/null +++ b/examples/nat/snatrule.yaml @@ -0,0 +1,19 @@ +apiVersion: nat.huaweicloud.crossplane.io/v1alpha1 +kind: SnatRule +metadata: + annotations: + meta.upbound.io/example-id: nat/v1alpha1/snatrule + labels: + testing.upbound.io/example-name: test + name: test +spec: + forProvider: + floatingIpIdSelector: + matchLabels: + testing.upbound.io/example-name: dedicated + natGatewayIdSelector: + matchLabels: + testing.upbound.io/example-name: test + subnetIdSelector: + matchLabels: + testing.upbound.io/example-name: subnet