diff --git a/apis/ec2/v1beta1/zz_generated.conversion_hubs.go b/apis/ec2/v1beta1/zz_generated.conversion_hubs.go index 3cfa19be6c..d26d9f88a8 100755 --- a/apis/ec2/v1beta1/zz_generated.conversion_hubs.go +++ b/apis/ec2/v1beta1/zz_generated.conversion_hubs.go @@ -199,6 +199,9 @@ func (tr *NetworkInterfaceSgAttachment) Hub() {} // Hub marks this type as a conversion hub. func (tr *PlacementGroup) Hub() {} +// Hub marks this type as a conversion hub. +func (tr *RouteTable) Hub() {} + // Hub marks this type as a conversion hub. func (tr *RouteTableAssociation) Hub() {} diff --git a/apis/ec2/v1beta1/zz_generated.conversion_spokes.go b/apis/ec2/v1beta1/zz_generated.conversion_spokes.go index 82eddfb65f..61240c2d3c 100755 --- a/apis/ec2/v1beta1/zz_generated.conversion_spokes.go +++ b/apis/ec2/v1beta1/zz_generated.conversion_spokes.go @@ -32,19 +32,3 @@ func (tr *Route) ConvertFrom(srcRaw conversion.Hub) error { } return nil } - -// ConvertTo converts this RouteTable to the hub type. -func (tr *RouteTable) ConvertTo(dstRaw conversion.Hub) error { - if err := ujconversion.RoundTrip(dstRaw.(resource.Terraformed), tr); err != nil { - return errors.Wrapf(err, "cannot convert from the spoke version %q to the hub version %q", tr.GetObjectKind().GroupVersionKind().Version, dstRaw.GetObjectKind().GroupVersionKind().Version) - } - return nil -} - -// ConvertFrom converts from the hub type to the RouteTable type. -func (tr *RouteTable) ConvertFrom(srcRaw conversion.Hub) error { - if err := ujconversion.RoundTrip(tr, srcRaw.(resource.Terraformed)); err != nil { - return errors.Wrapf(err, "cannot convert from the hub version %q to the spoke version %q", srcRaw.GetObjectKind().GroupVersionKind().Version, tr.GetObjectKind().GroupVersionKind().Version) - } - return nil -} diff --git a/apis/ec2/v1beta1/zz_generated.deepcopy.go b/apis/ec2/v1beta1/zz_generated.deepcopy.go index 63e8ba6f93..784687fd2d 100644 --- a/apis/ec2/v1beta1/zz_generated.deepcopy.go +++ b/apis/ec2/v1beta1/zz_generated.deepcopy.go @@ -30926,11 +30926,6 @@ func (in *RouteTableRouteObservation_2) DeepCopyInto(out *RouteTableRouteObserva *out = new(string) **out = **in } - if in.InstanceID != nil { - in, out := &in.InstanceID, &out.InstanceID - *out = new(string) - **out = **in - } if in.LocalGatewayID != nil { in, out := &in.LocalGatewayID, &out.LocalGatewayID *out = new(string) diff --git a/apis/ec2/v1beta1/zz_generated.resolvers.go b/apis/ec2/v1beta1/zz_generated.resolvers.go index 300d566d6f..770ac2d9bb 100644 --- a/apis/ec2/v1beta1/zz_generated.resolvers.go +++ b/apis/ec2/v1beta1/zz_generated.resolvers.go @@ -5828,7 +5828,7 @@ func (mg *VPCEndpointRouteTableAssociation) ResolveReferences(ctx context.Contex var rsp reference.ResolutionResponse var err error { - m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta2", "RouteTable", "RouteTableList") + m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta1", "RouteTable", "RouteTableList") if err != nil { return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") } @@ -5866,7 +5866,7 @@ func (mg *VPCEndpointRouteTableAssociation) ResolveReferences(ctx context.Contex mg.Spec.ForProvider.VPCEndpointID = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.VPCEndpointIDRef = rsp.ResolvedReference { - m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta2", "RouteTable", "RouteTableList") + m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta1", "RouteTable", "RouteTableList") if err != nil { return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") } @@ -6970,7 +6970,7 @@ func (mg *VPNGatewayRoutePropagation) ResolveReferences(ctx context.Context, c c var rsp reference.ResolutionResponse var err error { - m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta2", "RouteTable", "RouteTableList") + m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta1", "RouteTable", "RouteTableList") if err != nil { return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") } @@ -7008,7 +7008,7 @@ func (mg *VPNGatewayRoutePropagation) ResolveReferences(ctx context.Context, c c mg.Spec.ForProvider.VPNGatewayID = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.VPNGatewayIDRef = rsp.ResolvedReference { - m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta2", "RouteTable", "RouteTableList") + m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta1", "RouteTable", "RouteTableList") if err != nil { return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") } diff --git a/apis/ec2/v1beta1/zz_routetable_types.go b/apis/ec2/v1beta1/zz_routetable_types.go index d310493beb..a893bc0732 100755 --- a/apis/ec2/v1beta1/zz_routetable_types.go +++ b/apis/ec2/v1beta1/zz_routetable_types.go @@ -113,15 +113,12 @@ type RouteTableRouteObservation_2 struct { // Identifier of a VPC Egress Only Internet Gateway. EgressOnlyGatewayID *string `json:"egressOnlyGatewayId,omitempty" tf:"egress_only_gateway_id,omitempty"` - // Identifier of a VPC internet gateway or a virtual private gateway. + // Identifier of a VPC internet gateway, virtual private gateway, or local. local routes cannot be created but can be adopted or imported. See the example above. GatewayID *string `json:"gatewayId,omitempty" tf:"gateway_id,omitempty"` // The Ipv6 CIDR block of the route. IPv6CidrBlock *string `json:"ipv6CidrBlock,omitempty" tf:"ipv6_cidr_block,omitempty"` - // Identifier of an EC2 instance. - InstanceID *string `json:"instanceId,omitempty" tf:"instance_id,omitempty"` - // Identifier of a Outpost local gateway. LocalGatewayID *string `json:"localGatewayId,omitempty" tf:"local_gateway_id,omitempty"` @@ -169,6 +166,7 @@ type RouteTableStatus struct { // +kubebuilder:object:root=true // +kubebuilder:subresource:status +// +kubebuilder:storageversion // RouteTable is the Schema for the RouteTables API. Provides a resource to create a VPC routing table. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" diff --git a/apis/ec2/v1beta1/zz_vpcendpointroutetableassociation_types.go b/apis/ec2/v1beta1/zz_vpcendpointroutetableassociation_types.go index c30b95a4ed..98b7d66f2f 100755 --- a/apis/ec2/v1beta1/zz_vpcendpointroutetableassociation_types.go +++ b/apis/ec2/v1beta1/zz_vpcendpointroutetableassociation_types.go @@ -20,7 +20,7 @@ import ( type VPCEndpointRouteTableAssociationInitParameters struct { // Identifier of the EC2 Route Table to be associated with the VPC Endpoint. - // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta2.RouteTable + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta1.RouteTable // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() RouteTableID *string `json:"routeTableId,omitempty" tf:"route_table_id,omitempty"` @@ -66,7 +66,7 @@ type VPCEndpointRouteTableAssociationParameters struct { Region *string `json:"region" tf:"-"` // Identifier of the EC2 Route Table to be associated with the VPC Endpoint. - // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta2.RouteTable + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta1.RouteTable // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional RouteTableID *string `json:"routeTableId,omitempty" tf:"route_table_id,omitempty"` diff --git a/apis/ec2/v1beta1/zz_vpngatewayroutepropagation_types.go b/apis/ec2/v1beta1/zz_vpngatewayroutepropagation_types.go index 614ac151b0..e6264e411c 100755 --- a/apis/ec2/v1beta1/zz_vpngatewayroutepropagation_types.go +++ b/apis/ec2/v1beta1/zz_vpngatewayroutepropagation_types.go @@ -20,7 +20,7 @@ import ( type VPNGatewayRoutePropagationInitParameters struct { // The id of the aws_route_table to propagate routes into. - // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta2.RouteTable + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta1.RouteTable // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() RouteTableID *string `json:"routeTableId,omitempty" tf:"route_table_id,omitempty"` @@ -64,7 +64,7 @@ type VPNGatewayRoutePropagationParameters struct { Region *string `json:"region" tf:"-"` // The id of the aws_route_table to propagate routes into. - // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta2.RouteTable + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta1.RouteTable // +crossplane:generate:reference:extractor=github.com/crossplane/upjet/pkg/resource.ExtractResourceID() // +kubebuilder:validation:Optional RouteTableID *string `json:"routeTableId,omitempty" tf:"route_table_id,omitempty"` diff --git a/apis/ec2/v1beta2/zz_generated.conversion_hubs.go b/apis/ec2/v1beta2/zz_generated.conversion_hubs.go index 30cf15f9d4..759989fcc4 100755 --- a/apis/ec2/v1beta2/zz_generated.conversion_hubs.go +++ b/apis/ec2/v1beta2/zz_generated.conversion_hubs.go @@ -12,6 +12,3 @@ package v1beta2 // Hub marks this type as a conversion hub. func (tr *Route) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *RouteTable) Hub() {} diff --git a/apis/ec2/v1beta2/zz_generated.deepcopy.go b/apis/ec2/v1beta2/zz_generated.deepcopy.go index dcdbac6743..8ad6797970 100644 --- a/apis/ec2/v1beta2/zz_generated.deepcopy.go +++ b/apis/ec2/v1beta2/zz_generated.deepcopy.go @@ -571,389 +571,3 @@ func (in *RouteStatus) DeepCopy() *RouteStatus { in.DeepCopyInto(out) return out } - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RouteTable) DeepCopyInto(out *RouteTable) { - *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 RouteTable. -func (in *RouteTable) DeepCopy() *RouteTable { - if in == nil { - return nil - } - out := new(RouteTable) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RouteTable) 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 *RouteTableInitParameters) DeepCopyInto(out *RouteTableInitParameters) { - *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 - } - 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 RouteTableInitParameters. -func (in *RouteTableInitParameters) DeepCopy() *RouteTableInitParameters { - if in == nil { - return nil - } - out := new(RouteTableInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RouteTableList) DeepCopyInto(out *RouteTableList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]RouteTable, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTableList. -func (in *RouteTableList) DeepCopy() *RouteTableList { - if in == nil { - return nil - } - out := new(RouteTableList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *RouteTableList) 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 *RouteTableObservation) DeepCopyInto(out *RouteTableObservation) { - *out = *in - if in.Arn != nil { - in, out := &in.Arn, &out.Arn - *out = new(string) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.OwnerID != nil { - in, out := &in.OwnerID, &out.OwnerID - *out = new(string) - **out = **in - } - if in.PropagatingVgws != nil { - in, out := &in.PropagatingVgws, &out.PropagatingVgws - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } - if in.Route != nil { - in, out := &in.Route, &out.Route - *out = make([]RouteTableRouteObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - 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.TagsAll != nil { - in, out := &in.TagsAll, &out.TagsAll - *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 RouteTableObservation. -func (in *RouteTableObservation) DeepCopy() *RouteTableObservation { - if in == nil { - return nil - } - out := new(RouteTableObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RouteTableParameters) DeepCopyInto(out *RouteTableParameters) { - *out = *in - if in.Region != nil { - in, out := &in.Region, &out.Region - *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 - } - 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 RouteTableParameters. -func (in *RouteTableParameters) DeepCopy() *RouteTableParameters { - if in == nil { - return nil - } - out := new(RouteTableParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RouteTableRouteInitParameters) DeepCopyInto(out *RouteTableRouteInitParameters) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTableRouteInitParameters. -func (in *RouteTableRouteInitParameters) DeepCopy() *RouteTableRouteInitParameters { - if in == nil { - return nil - } - out := new(RouteTableRouteInitParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RouteTableRouteObservation) DeepCopyInto(out *RouteTableRouteObservation) { - *out = *in - if in.CarrierGatewayID != nil { - in, out := &in.CarrierGatewayID, &out.CarrierGatewayID - *out = new(string) - **out = **in - } - if in.CidrBlock != nil { - in, out := &in.CidrBlock, &out.CidrBlock - *out = new(string) - **out = **in - } - if in.CoreNetworkArn != nil { - in, out := &in.CoreNetworkArn, &out.CoreNetworkArn - *out = new(string) - **out = **in - } - if in.DestinationPrefixListID != nil { - in, out := &in.DestinationPrefixListID, &out.DestinationPrefixListID - *out = new(string) - **out = **in - } - if in.EgressOnlyGatewayID != nil { - in, out := &in.EgressOnlyGatewayID, &out.EgressOnlyGatewayID - *out = new(string) - **out = **in - } - if in.GatewayID != nil { - in, out := &in.GatewayID, &out.GatewayID - *out = new(string) - **out = **in - } - if in.IPv6CidrBlock != nil { - in, out := &in.IPv6CidrBlock, &out.IPv6CidrBlock - *out = new(string) - **out = **in - } - if in.LocalGatewayID != nil { - in, out := &in.LocalGatewayID, &out.LocalGatewayID - *out = new(string) - **out = **in - } - if in.NATGatewayID != nil { - in, out := &in.NATGatewayID, &out.NATGatewayID - *out = new(string) - **out = **in - } - if in.NetworkInterfaceID != nil { - in, out := &in.NetworkInterfaceID, &out.NetworkInterfaceID - *out = new(string) - **out = **in - } - if in.TransitGatewayID != nil { - in, out := &in.TransitGatewayID, &out.TransitGatewayID - *out = new(string) - **out = **in - } - if in.VPCEndpointID != nil { - in, out := &in.VPCEndpointID, &out.VPCEndpointID - *out = new(string) - **out = **in - } - if in.VPCPeeringConnectionID != nil { - in, out := &in.VPCPeeringConnectionID, &out.VPCPeeringConnectionID - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTableRouteObservation. -func (in *RouteTableRouteObservation) DeepCopy() *RouteTableRouteObservation { - if in == nil { - return nil - } - out := new(RouteTableRouteObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RouteTableRouteParameters) DeepCopyInto(out *RouteTableRouteParameters) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTableRouteParameters. -func (in *RouteTableRouteParameters) DeepCopy() *RouteTableRouteParameters { - if in == nil { - return nil - } - out := new(RouteTableRouteParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RouteTableSpec) DeepCopyInto(out *RouteTableSpec) { - *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 RouteTableSpec. -func (in *RouteTableSpec) DeepCopy() *RouteTableSpec { - if in == nil { - return nil - } - out := new(RouteTableSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RouteTableStatus) DeepCopyInto(out *RouteTableStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTableStatus. -func (in *RouteTableStatus) DeepCopy() *RouteTableStatus { - if in == nil { - return nil - } - out := new(RouteTableStatus) - in.DeepCopyInto(out) - return out -} diff --git a/apis/ec2/v1beta2/zz_generated.managed.go b/apis/ec2/v1beta2/zz_generated.managed.go index 7161a2fdc3..1fdf175abe 100644 --- a/apis/ec2/v1beta2/zz_generated.managed.go +++ b/apis/ec2/v1beta2/zz_generated.managed.go @@ -66,63 +66,3 @@ func (mg *Route) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsT func (mg *Route) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } - -// GetCondition of this RouteTable. -func (mg *RouteTable) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this RouteTable. -func (mg *RouteTable) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicies of this RouteTable. -func (mg *RouteTable) GetManagementPolicies() xpv1.ManagementPolicies { - return mg.Spec.ManagementPolicies -} - -// GetProviderConfigReference of this RouteTable. -func (mg *RouteTable) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -// GetPublishConnectionDetailsTo of this RouteTable. -func (mg *RouteTable) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this RouteTable. -func (mg *RouteTable) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this RouteTable. -func (mg *RouteTable) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this RouteTable. -func (mg *RouteTable) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicies of this RouteTable. -func (mg *RouteTable) SetManagementPolicies(r xpv1.ManagementPolicies) { - mg.Spec.ManagementPolicies = r -} - -// SetProviderConfigReference of this RouteTable. -func (mg *RouteTable) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -// SetPublishConnectionDetailsTo of this RouteTable. -func (mg *RouteTable) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this RouteTable. -func (mg *RouteTable) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} diff --git a/apis/ec2/v1beta2/zz_generated.managedlist.go b/apis/ec2/v1beta2/zz_generated.managedlist.go index f4bbc9abeb..18c5571d1e 100644 --- a/apis/ec2/v1beta2/zz_generated.managedlist.go +++ b/apis/ec2/v1beta2/zz_generated.managedlist.go @@ -15,12 +15,3 @@ func (l *RouteList) GetItems() []resource.Managed { } return items } - -// GetItems of this RouteTableList. -func (l *RouteTableList) 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/ec2/v1beta2/zz_generated.resolvers.go b/apis/ec2/v1beta2/zz_generated.resolvers.go index b48e12243a..f327e46866 100644 --- a/apis/ec2/v1beta2/zz_generated.resolvers.go +++ b/apis/ec2/v1beta2/zz_generated.resolvers.go @@ -122,7 +122,7 @@ func (mg *Route) ResolveReferences(ctx context.Context, c client.Reader) error { mg.Spec.ForProvider.NetworkInterfaceID = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.ForProvider.NetworkInterfaceIDRef = rsp.ResolvedReference { - m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta2", "RouteTable", "RouteTableList") + m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta1", "RouteTable", "RouteTableList") if err != nil { return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") } @@ -293,7 +293,7 @@ func (mg *Route) ResolveReferences(ctx context.Context, c client.Reader) error { mg.Spec.InitProvider.NetworkInterfaceID = reference.ToPtrValue(rsp.ResolvedValue) mg.Spec.InitProvider.NetworkInterfaceIDRef = rsp.ResolvedReference { - m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta2", "RouteTable", "RouteTableList") + m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta1", "RouteTable", "RouteTableList") if err != nil { return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") } @@ -371,53 +371,3 @@ func (mg *Route) ResolveReferences(ctx context.Context, c client.Reader) error { return nil } - -// ResolveReferences of this RouteTable. -func (mg *RouteTable) ResolveReferences(ctx context.Context, c client.Reader) error { - var m xpresource.Managed - var l xpresource.ManagedList - r := reference.NewAPIResolver(c, mg) - - var rsp reference.ResolutionResponse - var err error - { - m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta1", "VPC", "VPCList") - if err != nil { - return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") - } - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.VPCID), - Extract: reference.ExternalName(), - Reference: mg.Spec.ForProvider.VPCIDRef, - Selector: mg.Spec.ForProvider.VPCIDSelector, - To: reference.To{List: l, Managed: m}, - }) - } - 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 - { - m, l, err = apisresolver.GetManagedResource("ec2.aws.upbound.io", "v1beta1", "VPC", "VPCList") - if err != nil { - return errors.Wrap(err, "failed to get the reference target managed resource and its list for reference resolution") - } - - rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ - CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.VPCID), - Extract: reference.ExternalName(), - Reference: mg.Spec.InitProvider.VPCIDRef, - Selector: mg.Spec.InitProvider.VPCIDSelector, - To: reference.To{List: l, Managed: m}, - }) - } - 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 -} diff --git a/apis/ec2/v1beta2/zz_route_types.go b/apis/ec2/v1beta2/zz_route_types.go index b0e8465f45..36f65d5ae4 100755 --- a/apis/ec2/v1beta2/zz_route_types.go +++ b/apis/ec2/v1beta2/zz_route_types.go @@ -96,7 +96,7 @@ type RouteInitParameters struct { NetworkInterfaceIDSelector *v1.Selector `json:"networkInterfaceIdSelector,omitempty" tf:"-"` // The ID of the routing table. - // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta2.RouteTable + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta1.RouteTable RouteTableID *string `json:"routeTableId,omitempty" tf:"route_table_id,omitempty"` // Reference to a RouteTable in ec2 to populate routeTableId. @@ -298,7 +298,7 @@ type RouteParameters struct { Region *string `json:"region" tf:"-"` // The ID of the routing table. - // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta2.RouteTable + // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta1.RouteTable // +kubebuilder:validation:Optional RouteTableID *string `json:"routeTableId,omitempty" tf:"route_table_id,omitempty"` diff --git a/apis/ec2/v1beta2/zz_routetable_terraformed.go b/apis/ec2/v1beta2/zz_routetable_terraformed.go deleted file mode 100755 index a52406ac4d..0000000000 --- a/apis/ec2/v1beta2/zz_routetable_terraformed.go +++ /dev/null @@ -1,133 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1beta2 - -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 RouteTable -func (mg *RouteTable) GetTerraformResourceType() string { - return "aws_route_table" -} - -// GetConnectionDetailsMapping for this RouteTable -func (tr *RouteTable) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this RouteTable -func (tr *RouteTable) 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 RouteTable -func (tr *RouteTable) 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 RouteTable -func (tr *RouteTable) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this RouteTable -func (tr *RouteTable) 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 RouteTable -func (tr *RouteTable) 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 RouteTable -func (tr *RouteTable) 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 RouteTable -func (tr *RouteTable) 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 RouteTable using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *RouteTable) LateInitialize(attrs []byte) (bool, error) { - params := &RouteTableParameters{} - 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 *RouteTable) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/ec2/v1beta2/zz_routetable_types.go b/apis/ec2/v1beta2/zz_routetable_types.go deleted file mode 100755 index 5c0c30e786..0000000000 --- a/apis/ec2/v1beta2/zz_routetable_types.go +++ /dev/null @@ -1,203 +0,0 @@ -// SPDX-FileCopyrightText: 2023 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1beta2 - -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 RouteTableInitParameters struct { - - // Key-value map of resource tags. - // +mapType=granular - Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` - - // The VPC ID. - // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta1.VPC - VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` - - // Reference to a VPC in ec2 to populate vpcId. - // +kubebuilder:validation:Optional - VPCIDRef *v1.Reference `json:"vpcIdRef,omitempty" tf:"-"` - - // Selector for a VPC in ec2 to populate vpcId. - // +kubebuilder:validation:Optional - VPCIDSelector *v1.Selector `json:"vpcIdSelector,omitempty" tf:"-"` -} - -type RouteTableObservation struct { - - // The ARN of the route table. - Arn *string `json:"arn,omitempty" tf:"arn,omitempty"` - - // The ID of the routing table. - ID *string `json:"id,omitempty" tf:"id,omitempty"` - - // The ID of the AWS account that owns the route table. - OwnerID *string `json:"ownerId,omitempty" tf:"owner_id,omitempty"` - - // A list of virtual gateways for propagation. - // +listType=set - PropagatingVgws []*string `json:"propagatingVgws,omitempty" tf:"propagating_vgws,omitempty"` - - // A list of route objects. Their keys are documented below. This argument is processed in attribute-as-blocks mode. - // This means that omitting this argument is interpreted as ignoring any existing routes. To remove all managed routes an empty list should be specified. See the example above. - Route []RouteTableRouteObservation `json:"route,omitempty" tf:"route,omitempty"` - - // Key-value map of resource tags. - // +mapType=granular - Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` - - // A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block. - // +mapType=granular - TagsAll map[string]*string `json:"tagsAll,omitempty" tf:"tags_all,omitempty"` - - // The VPC ID. - VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` -} - -type RouteTableParameters struct { - - // Region is the region you'd like your resource to be created in. - // +upjet:crd:field:TFTag=- - // +kubebuilder:validation:Required - Region *string `json:"region" tf:"-"` - - // Key-value map of resource tags. - // +kubebuilder:validation:Optional - // +mapType=granular - Tags map[string]*string `json:"tags,omitempty" tf:"tags,omitempty"` - - // The VPC ID. - // +crossplane:generate:reference:type=github.com/upbound/provider-aws/apis/ec2/v1beta1.VPC - // +kubebuilder:validation:Optional - VPCID *string `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` - - // Reference to a VPC in ec2 to populate vpcId. - // +kubebuilder:validation:Optional - VPCIDRef *v1.Reference `json:"vpcIdRef,omitempty" tf:"-"` - - // Selector for a VPC in ec2 to populate vpcId. - // +kubebuilder:validation:Optional - VPCIDSelector *v1.Selector `json:"vpcIdSelector,omitempty" tf:"-"` -} - -type RouteTableRouteInitParameters struct { -} - -type RouteTableRouteObservation struct { - - // Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone. - CarrierGatewayID *string `json:"carrierGatewayId,omitempty" tf:"carrier_gateway_id,omitempty"` - - // The CIDR block of the route. - CidrBlock *string `json:"cidrBlock,omitempty" tf:"cidr_block,omitempty"` - - // The Amazon Resource Name (ARN) of a core network. - CoreNetworkArn *string `json:"coreNetworkArn,omitempty" tf:"core_network_arn,omitempty"` - - // The ID of a managed prefix list destination of the route. - DestinationPrefixListID *string `json:"destinationPrefixListId,omitempty" tf:"destination_prefix_list_id,omitempty"` - - // Identifier of a VPC Egress Only Internet Gateway. - EgressOnlyGatewayID *string `json:"egressOnlyGatewayId,omitempty" tf:"egress_only_gateway_id,omitempty"` - - // Identifier of a VPC internet gateway, virtual private gateway, or local. local routes cannot be created but can be adopted or imported. See the example above. - GatewayID *string `json:"gatewayId,omitempty" tf:"gateway_id,omitempty"` - - // The Ipv6 CIDR block of the route. - IPv6CidrBlock *string `json:"ipv6CidrBlock,omitempty" tf:"ipv6_cidr_block,omitempty"` - - // Identifier of a Outpost local gateway. - LocalGatewayID *string `json:"localGatewayId,omitempty" tf:"local_gateway_id,omitempty"` - - // Identifier of a VPC NAT gateway. - NATGatewayID *string `json:"natGatewayId,omitempty" tf:"nat_gateway_id,omitempty"` - - // Identifier of an EC2 network interface. - NetworkInterfaceID *string `json:"networkInterfaceId,omitempty" tf:"network_interface_id,omitempty"` - - // Identifier of an EC2 Transit Gateway. - TransitGatewayID *string `json:"transitGatewayId,omitempty" tf:"transit_gateway_id,omitempty"` - - // Identifier of a VPC Endpoint. - VPCEndpointID *string `json:"vpcEndpointId,omitempty" tf:"vpc_endpoint_id,omitempty"` - - // Identifier of a VPC peering connection. - VPCPeeringConnectionID *string `json:"vpcPeeringConnectionId,omitempty" tf:"vpc_peering_connection_id,omitempty"` -} - -type RouteTableRouteParameters struct { -} - -// RouteTableSpec defines the desired state of RouteTable -type RouteTableSpec struct { - v1.ResourceSpec `json:",inline"` - ForProvider RouteTableParameters `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 RouteTableInitParameters `json:"initProvider,omitempty"` -} - -// RouteTableStatus defines the observed state of RouteTable. -type RouteTableStatus struct { - v1.ResourceStatus `json:",inline"` - AtProvider RouteTableObservation `json:"atProvider,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -// +kubebuilder:storageversion - -// RouteTable is the Schema for the RouteTables API. Provides a resource to create a VPC routing table. -// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" -// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" -// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" -// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" -// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,aws} -type RouteTable struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec RouteTableSpec `json:"spec"` - Status RouteTableStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// RouteTableList contains a list of RouteTables -type RouteTableList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []RouteTable `json:"items"` -} - -// Repository type metadata. -var ( - RouteTable_Kind = "RouteTable" - RouteTable_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: RouteTable_Kind}.String() - RouteTable_KindAPIVersion = RouteTable_Kind + "." + CRDGroupVersion.String() - RouteTable_GroupVersionKind = CRDGroupVersion.WithKind(RouteTable_Kind) -) - -func init() { - SchemeBuilder.Register(&RouteTable{}, &RouteTableList{}) -} diff --git a/apis/zz_register.go b/apis/zz_register.go index 2e40e83bfc..8d260e8e83 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -250,7 +250,6 @@ func init() { v1beta1dynamodb.SchemeBuilder.AddToScheme, v1beta1ec2.SchemeBuilder.AddToScheme, v1beta1ec2.SchemeBuilder.AddToScheme, - v1beta1ec2.SchemeBuilder.AddToScheme, v1beta2ec2.SchemeBuilder.AddToScheme, v1beta1ecr.SchemeBuilder.AddToScheme, v1beta1ecrpublic.SchemeBuilder.AddToScheme, diff --git a/config/field-rename.yaml b/config/field-rename.yaml index 8f10e22294..0564529b9c 100644 --- a/config/field-rename.yaml +++ b/config/field-rename.yaml @@ -26,5 +26,3 @@ aws_route: spec.forProvider.instanceId: spec.forProvider.networkInterfaceId spec.initProvider.instanceId: spec.initProvider.networkInterfaceId - aws_route_table: - status.atProvider.route.instanceId: status.atProvider.route.networkInterfaceId \ No newline at end of file diff --git a/internal/controller/ec2/routetable/zz_controller.go b/internal/controller/ec2/routetable/zz_controller.go index 5b9bac8e90..8a66ed0c32 100755 --- a/internal/controller/ec2/routetable/zz_controller.go +++ b/internal/controller/ec2/routetable/zz_controller.go @@ -24,13 +24,13 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - v1beta2 "github.com/upbound/provider-aws/apis/ec2/v1beta2" + v1beta1 "github.com/upbound/provider-aws/apis/ec2/v1beta1" features "github.com/upbound/provider-aws/internal/features" ) // Setup adds a controller that reconciles RouteTable managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1beta2.RouteTable_GroupVersionKind.String()) + name := managed.ControllerName(v1beta1.RouteTable_GroupVersionKind.String()) var initializers managed.InitializerChain for _, i := range o.Provider.Resources["aws_route_table"].InitializerFns { initializers = append(initializers, i(mgr.GetClient())) @@ -39,15 +39,15 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { 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", v1beta2.RouteTable_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta2.RouteTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.RouteTable_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.RouteTable_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ managed.WithExternalConnecter( tjcontroller.NewTerraformPluginSDKAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["aws_route_table"], tjcontroller.WithTerraformPluginSDKAsyncLogger(o.Logger), tjcontroller.WithTerraformPluginSDKAsyncConnectorEventHandler(eventHandler), tjcontroller.WithTerraformPluginSDKAsyncCallbackProvider(ac), - tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta2.RouteTable_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginSDKAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.RouteTable_GroupVersionKind, mgr, o.PollInterval)), tjcontroller.WithTerraformPluginSDKAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -64,22 +64,22 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { opts = append(opts, managed.WithManagementPolicies()) } - // register webhooks for the kind v1beta2.RouteTable + // register webhooks for the kind v1beta1.RouteTable // if they're enabled. if o.StartWebhooks { if err := ctrl.NewWebhookManagedBy(mgr). - For(&v1beta2.RouteTable{}). + For(&v1beta1.RouteTable{}). Complete(); err != nil { - return errors.Wrap(err, "cannot register webhook for the kind v1beta2.RouteTable") + return errors.Wrap(err, "cannot register webhook for the kind v1beta1.RouteTable") } } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta2.RouteTable_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1beta1.RouteTable_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). WithEventFilter(xpresource.DesiredStateChanged()). - Watches(&v1beta2.RouteTable{}, eventHandler). + Watches(&v1beta1.RouteTable{}, eventHandler). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/package/crds/ec2.aws.upbound.io_routetables.yaml b/package/crds/ec2.aws.upbound.io_routetables.yaml index 8eb40be8d2..beaa8c1737 100644 --- a/package/crds/ec2.aws.upbound.io_routetables.yaml +++ b/package/crds/ec2.aws.upbound.io_routetables.yaml @@ -411,537 +411,6 @@ spec: required: - forProvider type: object - status: - description: RouteTableStatus defines the observed state of RouteTable. - properties: - atProvider: - properties: - arn: - description: The ARN of the route table. - type: string - id: - description: The ID of the routing table. - type: string - ownerId: - description: The ID of the AWS account that owns the route table. - type: string - propagatingVgws: - description: A list of virtual gateways for propagation. - items: - type: string - type: array - x-kubernetes-list-type: set - route: - description: A list of route objects. Their keys are documented - below. This argument is processed in attribute-as-blocks mode. - This means that omitting this argument is interpreted as ignoring - any existing routes. To remove all managed routes an empty list - should be specified. See the example above. - items: - properties: - carrierGatewayId: - description: Identifier of a carrier gateway. This attribute - can only be used when the VPC contains a subnet which - is associated with a Wavelength Zone. - type: string - cidrBlock: - description: The CIDR block of the route. - type: string - coreNetworkArn: - description: The Amazon Resource Name (ARN) of a core network. - type: string - destinationPrefixListId: - description: The ID of a managed prefix list destination - of the route. - type: string - egressOnlyGatewayId: - description: Identifier of a VPC Egress Only Internet Gateway. - type: string - gatewayId: - description: Identifier of a VPC internet gateway or a virtual - private gateway. - type: string - instanceId: - description: Identifier of an EC2 instance. - type: string - ipv6CidrBlock: - description: The Ipv6 CIDR block of the route. - type: string - localGatewayId: - description: Identifier of a Outpost local gateway. - type: string - natGatewayId: - description: Identifier of a VPC NAT gateway. - type: string - networkInterfaceId: - description: Identifier of an EC2 network interface. - type: string - transitGatewayId: - description: Identifier of an EC2 Transit Gateway. - type: string - vpcEndpointId: - description: Identifier of a VPC Endpoint. - type: string - vpcPeeringConnectionId: - description: Identifier of a VPC peering connection. - type: string - type: object - type: array - tags: - additionalProperties: - type: string - description: Key-value map of resource tags. - type: object - x-kubernetes-map-type: granular - tagsAll: - additionalProperties: - type: string - description: A map of tags assigned to the resource, including - those inherited from the provider default_tags configuration - block. - type: object - x-kubernetes-map-type: granular - vpcId: - description: The VPC ID. - type: string - type: object - conditions: - description: Conditions of the resource. - items: - description: A Condition that may apply to a resource. - properties: - lastTransitionTime: - description: LastTransitionTime is the last time this condition - transitioned from one status to another. - format: date-time - type: string - message: - description: A Message containing details about this condition's - last transition from one status to another, if any. - type: string - reason: - description: A Reason for this condition's last transition from - one status to another. - type: string - status: - description: Status of this condition; is it currently True, - False, or Unknown? - type: string - type: - description: Type of this condition. At most one of each condition - type may apply to a resource at any point in time. - type: string - required: - - lastTransitionTime - - reason - - status - - type - type: object - type: array - x-kubernetes-list-map-keys: - - type - x-kubernetes-list-type: map - type: object - required: - - spec - type: object - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - jsonPath: .status.conditions[?(@.type=='Ready')].status - name: READY - type: string - - jsonPath: .status.conditions[?(@.type=='Synced')].status - name: SYNCED - type: string - - jsonPath: .metadata.annotations.crossplane\.io/external-name - name: EXTERNAL-NAME - type: string - - jsonPath: .metadata.creationTimestamp - name: AGE - type: date - name: v1beta2 - schema: - openAPIV3Schema: - description: RouteTable is the Schema for the RouteTables API. Provides a - resource to create a VPC routing table. - 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: RouteTableSpec defines the desired state of RouteTable - 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: - region: - description: Region is the region you'd like your resource to - be created in. - type: string - tags: - additionalProperties: - type: string - description: Key-value map of resource tags. - type: object - x-kubernetes-map-type: granular - vpcId: - description: The VPC ID. - type: string - vpcIdRef: - description: Reference to a VPC in ec2 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 ec2 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 - required: - - region - 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: - tags: - additionalProperties: - type: string - description: Key-value map of resource tags. - type: object - x-kubernetes-map-type: granular - vpcId: - description: The VPC ID. - type: string - vpcIdRef: - description: Reference to a VPC in ec2 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 ec2 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 status: description: RouteTableStatus defines the observed state of RouteTable. properties: