diff --git a/pkg/controller/ec2/address/controller.go b/pkg/controller/ec2/address/controller.go index c65ce766b6..6981cbf2ef 100644 --- a/pkg/controller/ec2/address/controller.go +++ b/pkg/controller/ec2/address/controller.go @@ -19,6 +19,7 @@ package address import ( "context" "sort" + "time" "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" @@ -66,6 +67,7 @@ func SetupAddress(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateLimiter) Complete(managed.NewReconciler(mgr, resource.ManagedKind(v1beta1.AddressGroupVersionKind), managed.WithExternalConnecter(&connector{kube: mgr.GetClient()}), + managed.WithCreationGracePeriod(3*time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), managed.WithInitializers(managed.NewDefaultProviderConfig(mgr.GetClient()), &tagger{kube: mgr.GetClient()}), diff --git a/pkg/controller/ec2/internetgateway/controller.go b/pkg/controller/ec2/internetgateway/controller.go index 2f62f95511..51daa932fc 100644 --- a/pkg/controller/ec2/internetgateway/controller.go +++ b/pkg/controller/ec2/internetgateway/controller.go @@ -18,6 +18,7 @@ package internetgateway import ( "context" + "time" "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" @@ -67,6 +68,7 @@ func SetupInternetGateway(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateL Complete(managed.NewReconciler(mgr, resource.ManagedKind(v1beta1.InternetGatewayGroupVersionKind), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewInternetGatewayClient}), + managed.WithCreationGracePeriod(3*time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewDefaultProviderConfig(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/ec2/natgateway/controller.go b/pkg/controller/ec2/natgateway/controller.go index 1ce91f9ddb..d3026f2fb8 100644 --- a/pkg/controller/ec2/natgateway/controller.go +++ b/pkg/controller/ec2/natgateway/controller.go @@ -2,6 +2,7 @@ package natgateway import ( "context" + "time" "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" @@ -47,6 +48,7 @@ func SetupNatGateway(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateLimite Complete(managed.NewReconciler(mgr, resource.ManagedKind(v1beta1.NATGatewayGroupVersionKind), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewNatGatewayClient}), + managed.WithCreationGracePeriod(3*time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewDefaultProviderConfig(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/ec2/routetable/controller.go b/pkg/controller/ec2/routetable/controller.go index 614d5ebba6..e3e34f87e8 100644 --- a/pkg/controller/ec2/routetable/controller.go +++ b/pkg/controller/ec2/routetable/controller.go @@ -18,6 +18,7 @@ package routetable import ( "context" + "time" "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" @@ -71,6 +72,7 @@ func SetupRouteTable(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateLimite Complete(managed.NewReconciler(mgr, resource.ManagedKind(v1beta1.RouteTableGroupVersionKind), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewRouteTableClient}), + managed.WithCreationGracePeriod(3*time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewDefaultProviderConfig(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/ec2/securitygroup/controller.go b/pkg/controller/ec2/securitygroup/controller.go index f4a5c3fd68..fa0b1bc9bd 100644 --- a/pkg/controller/ec2/securitygroup/controller.go +++ b/pkg/controller/ec2/securitygroup/controller.go @@ -18,6 +18,7 @@ package securitygroup import ( "context" + "time" "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" @@ -73,6 +74,7 @@ func SetupSecurityGroup(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateLim Complete(managed.NewReconciler(mgr, resource.ManagedKind(v1beta1.SecurityGroupGroupVersionKind), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewSecurityGroupClient}), + managed.WithCreationGracePeriod(3*time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewDefaultProviderConfig(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/ec2/subnet/controller.go b/pkg/controller/ec2/subnet/controller.go index 75712a9977..9fd9624cb4 100644 --- a/pkg/controller/ec2/subnet/controller.go +++ b/pkg/controller/ec2/subnet/controller.go @@ -18,6 +18,7 @@ package subnet import ( "context" + "time" "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" @@ -64,6 +65,7 @@ func SetupSubnet(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateLimiter) e Complete(managed.NewReconciler(mgr, resource.ManagedKind(v1beta1.SubnetGroupVersionKind), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewSubnetClient}), + managed.WithCreationGracePeriod(3*time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewDefaultProviderConfig(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/ec2/vpc/controller.go b/pkg/controller/ec2/vpc/controller.go index 4d052ee896..4bdea55a9b 100644 --- a/pkg/controller/ec2/vpc/controller.go +++ b/pkg/controller/ec2/vpc/controller.go @@ -19,6 +19,7 @@ package vpc import ( "context" "sort" + "time" "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" @@ -67,6 +68,7 @@ func SetupVPC(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateLimiter) erro Complete(managed.NewReconciler(mgr, resource.ManagedKind(v1beta1.VPCGroupVersionKind), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewVPCClient}), + managed.WithCreationGracePeriod(3*time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), managed.WithInitializers(managed.NewDefaultProviderConfig(mgr.GetClient()), &tagger{kube: mgr.GetClient()}), diff --git a/pkg/controller/ec2/vpccidrblock/controller.go b/pkg/controller/ec2/vpccidrblock/controller.go index d09a189d50..af38c4c4ad 100644 --- a/pkg/controller/ec2/vpccidrblock/controller.go +++ b/pkg/controller/ec2/vpccidrblock/controller.go @@ -18,6 +18,7 @@ package vpccidrblock import ( "context" + "time" "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" @@ -60,6 +61,7 @@ func SetupVPCCIDRBlock(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateLimi Complete(managed.NewReconciler(mgr, resource.ManagedKind(v1alpha1.VPCCIDRBlockGroupVersionKind), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewVPCCIDRBlockClient}), + managed.WithCreationGracePeriod(3*time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), managed.WithInitializers(managed.NewDefaultProviderConfig(mgr.GetClient())),