From 1543aa468d2ace35d12677d13f29e3a5f0d8b4a7 Mon Sep 17 00:00:00 2001 From: "Maximilian Blatt (external expert on behalf of DB Netz)" Date: Thu, 3 Aug 2023 19:39:14 +0200 Subject: [PATCH] refactor: Setup function per api group Signed-off-by: Maximilian Blatt (external expert on behalf of DB Netz) --- pkg/controller/acm/setup.go | 33 ++ pkg/controller/acmpca/setup.go | 36 ++ pkg/controller/apigateway/setup.go | 38 ++ pkg/controller/apigatewayv2/setup.go | 56 +++ pkg/controller/athena/setup.go | 34 ++ pkg/controller/autoscaling/setup.go | 34 ++ pkg/controller/aws.go | 435 ++++-------------- .../batch/computeenvironment/setup.go | 2 +- pkg/controller/batch/job/controller.go | 2 +- .../batch/jobdefinition/controller.go | 2 +- pkg/controller/batch/jobqueue/setup.go | 2 +- pkg/controller/batch/setup.go | 40 ++ pkg/controller/batch/{ => utils}/tags.go | 2 +- .../cache/{ => replicationgroup}/managed.go | 2 +- .../{ => replicationgroup}/managed_test.go | 2 +- pkg/controller/cache/setup.go | 38 ++ .../cloudfront/cachepolicy/setup.go | 2 +- .../cloudfront/responseheaderspolicy/setup.go | 2 +- pkg/controller/cloudfront/setup.go | 40 ++ .../cloudfront/{ => utils}/lateinit.go | 2 +- .../cloudfront/{ => utils}/lateinit_test.go | 2 +- pkg/controller/cloudsearch/setup.go | 34 ++ pkg/controller/cloudwatchlogs/setup.go | 34 ++ pkg/controller/cognitoidentity/setup.go | 34 ++ .../cognitoidentityprovider/setup.go | 46 ++ .../database/{ => rdsinstance}/rdsinstance.go | 2 +- .../{ => rdsinstance}/rdsinstance_test.go | 2 +- pkg/controller/database/setup.go | 36 ++ pkg/controller/dax/setup.go | 38 ++ pkg/controller/docdb/dbcluster/setup.go | 2 +- pkg/controller/docdb/dbcluster/setup_test.go | 2 +- .../docdb/dbclusterparametergroup/setup.go | 2 +- .../dbclusterparametergroup/setup_test.go | 2 +- pkg/controller/docdb/dbinstance/setup.go | 2 +- pkg/controller/docdb/dbsubnetgroup/setup.go | 2 +- pkg/controller/docdb/setup.go | 40 ++ pkg/controller/docdb/{ => utils}/tags.go | 2 +- pkg/controller/dynamodb/setup.go | 38 ++ pkg/controller/ec2/setup.go | 76 +++ pkg/controller/ecr/setup.go | 38 ++ pkg/controller/ecs/setup.go | 38 ++ pkg/controller/efs/filesystem/setup.go | 2 +- pkg/controller/efs/setup.go | 38 ++ pkg/controller/efs/{ => utils}/tags.go | 2 +- pkg/controller/eks/{ => cluster}/cluster.go | 2 +- .../eks/{ => cluster}/cluster_test.go | 2 +- pkg/controller/eks/setup.go | 42 ++ pkg/controller/elasticache/setup.go | 34 ++ pkg/controller/elasticloadbalancing/setup.go | 36 ++ pkg/controller/elbv2/setup.go | 40 ++ pkg/controller/emrcontainers/setup.go | 36 ++ pkg/controller/glue/connection/setup.go | 2 +- pkg/controller/glue/crawler/setup.go | 2 +- pkg/controller/glue/job/setup.go | 2 +- pkg/controller/glue/setup.go | 44 ++ pkg/controller/glue/{ => utils}/tags.go | 2 +- pkg/controller/iam/setup.go | 56 +++ pkg/controller/iot/setup.go | 36 ++ pkg/controller/kafka/setup.go | 36 ++ pkg/controller/kinesis/setup.go | 34 ++ pkg/controller/kms/setup.go | 36 ++ pkg/controller/lambda/setup.go | 38 ++ pkg/controller/mq/setup.go | 34 ++ pkg/controller/mwaa/setup.go | 36 ++ pkg/controller/neptune/setup.go | 34 ++ pkg/controller/opensearchservice/setup.go | 34 ++ pkg/controller/prometheusservice/setup.go | 38 ++ pkg/controller/ram/setup.go | 34 ++ pkg/controller/rds/optiongroup/setup.go | 2 +- pkg/controller/rds/setup.go | 46 ++ pkg/controller/rds/{ => utils}/tags.go | 2 +- .../redshift/{ => cluster}/controller.go | 2 +- .../redshift/{ => cluster}/controller_test.go | 2 +- pkg/controller/redshift/setup.go | 34 ++ pkg/controller/route53/setup.go | 36 ++ pkg/controller/route53resolver/setup.go | 38 ++ .../s3/bucket/accelerateConfig_test.go | 3 - pkg/controller/s3/{ => bucket}/bucket.go | 13 +- pkg/controller/s3/{ => bucket}/bucket_test.go | 9 +- pkg/controller/s3/setup.go | 36 ++ pkg/controller/s3control/setup.go | 34 ++ pkg/controller/secretsmanager/setup.go | 34 ++ pkg/controller/servicediscovery/setup.go | 40 ++ .../sesv2/configurationset/setup.go | 2 +- pkg/controller/sesv2/emailidentity/setup.go | 2 +- pkg/controller/sesv2/setup.go | 38 ++ pkg/controller/sesv2/{ => utils}/tags.go | 2 +- pkg/controller/sfn/setup.go | 36 ++ pkg/controller/sns/setup.go | 36 ++ pkg/controller/sqs/setup.go | 34 ++ pkg/controller/transfer/setup.go | 36 ++ pkg/utils/setup/setup_controller.go | 37 ++ 92 files changed, 2176 insertions(+), 386 deletions(-) create mode 100644 pkg/controller/acm/setup.go create mode 100644 pkg/controller/acmpca/setup.go create mode 100644 pkg/controller/apigateway/setup.go create mode 100644 pkg/controller/apigatewayv2/setup.go create mode 100644 pkg/controller/athena/setup.go create mode 100644 pkg/controller/autoscaling/setup.go create mode 100644 pkg/controller/batch/setup.go rename pkg/controller/batch/{ => utils}/tags.go (99%) rename pkg/controller/cache/{ => replicationgroup}/managed.go (99%) rename pkg/controller/cache/{ => replicationgroup}/managed_test.go (99%) create mode 100644 pkg/controller/cache/setup.go create mode 100644 pkg/controller/cloudfront/setup.go rename pkg/controller/cloudfront/{ => utils}/lateinit.go (99%) rename pkg/controller/cloudfront/{ => utils}/lateinit_test.go (99%) create mode 100644 pkg/controller/cloudsearch/setup.go create mode 100644 pkg/controller/cloudwatchlogs/setup.go create mode 100644 pkg/controller/cognitoidentity/setup.go create mode 100644 pkg/controller/cognitoidentityprovider/setup.go rename pkg/controller/database/{ => rdsinstance}/rdsinstance.go (99%) rename pkg/controller/database/{ => rdsinstance}/rdsinstance_test.go (99%) create mode 100644 pkg/controller/database/setup.go create mode 100644 pkg/controller/dax/setup.go create mode 100644 pkg/controller/docdb/setup.go rename pkg/controller/docdb/{ => utils}/tags.go (99%) create mode 100644 pkg/controller/dynamodb/setup.go create mode 100644 pkg/controller/ec2/setup.go create mode 100644 pkg/controller/ecr/setup.go create mode 100644 pkg/controller/ecs/setup.go create mode 100644 pkg/controller/efs/setup.go rename pkg/controller/efs/{ => utils}/tags.go (99%) rename pkg/controller/eks/{ => cluster}/cluster.go (99%) rename pkg/controller/eks/{ => cluster}/cluster_test.go (99%) create mode 100644 pkg/controller/eks/setup.go create mode 100644 pkg/controller/elasticache/setup.go create mode 100644 pkg/controller/elasticloadbalancing/setup.go create mode 100644 pkg/controller/elbv2/setup.go create mode 100644 pkg/controller/emrcontainers/setup.go create mode 100644 pkg/controller/glue/setup.go rename pkg/controller/glue/{ => utils}/tags.go (99%) create mode 100644 pkg/controller/iam/setup.go create mode 100644 pkg/controller/iot/setup.go create mode 100644 pkg/controller/kafka/setup.go create mode 100644 pkg/controller/kinesis/setup.go create mode 100644 pkg/controller/kms/setup.go create mode 100644 pkg/controller/lambda/setup.go create mode 100644 pkg/controller/mq/setup.go create mode 100644 pkg/controller/mwaa/setup.go create mode 100644 pkg/controller/neptune/setup.go create mode 100644 pkg/controller/opensearchservice/setup.go create mode 100644 pkg/controller/prometheusservice/setup.go create mode 100644 pkg/controller/ram/setup.go create mode 100644 pkg/controller/rds/setup.go rename pkg/controller/rds/{ => utils}/tags.go (99%) rename pkg/controller/redshift/{ => cluster}/controller.go (99%) rename pkg/controller/redshift/{ => cluster}/controller_test.go (99%) create mode 100644 pkg/controller/redshift/setup.go create mode 100644 pkg/controller/route53/setup.go create mode 100644 pkg/controller/route53resolver/setup.go rename pkg/controller/s3/{ => bucket}/bucket.go (96%) rename pkg/controller/s3/{ => bucket}/bucket_test.go (98%) create mode 100644 pkg/controller/s3/setup.go create mode 100644 pkg/controller/s3control/setup.go create mode 100644 pkg/controller/secretsmanager/setup.go create mode 100644 pkg/controller/servicediscovery/setup.go create mode 100644 pkg/controller/sesv2/setup.go rename pkg/controller/sesv2/{ => utils}/tags.go (99%) create mode 100644 pkg/controller/sfn/setup.go create mode 100644 pkg/controller/sns/setup.go create mode 100644 pkg/controller/sqs/setup.go create mode 100644 pkg/controller/transfer/setup.go create mode 100644 pkg/utils/setup/setup_controller.go diff --git a/pkg/controller/acm/setup.go b/pkg/controller/acm/setup.go new file mode 100644 index 0000000000..a45779f578 --- /dev/null +++ b/pkg/controller/acm/setup.go @@ -0,0 +1,33 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package acm + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup acm controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + SetupCertificate, + ) +} diff --git a/pkg/controller/acmpca/setup.go b/pkg/controller/acmpca/setup.go new file mode 100644 index 0000000000..a5add71d9a --- /dev/null +++ b/pkg/controller/acmpca/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package acmpca + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/acmpca/certificateauthority" + "github.com/crossplane-contrib/provider-aws/pkg/controller/acmpca/certificateauthoritypermission" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup acm controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + certificateauthority.SetupCertificateAuthority, + certificateauthoritypermission.SetupCertificateAuthorityPermission, + ) +} diff --git a/pkg/controller/apigateway/setup.go b/pkg/controller/apigateway/setup.go new file mode 100644 index 0000000000..ea23ebdf4f --- /dev/null +++ b/pkg/controller/apigateway/setup.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package apigateway + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway/method" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway/resource" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway/restapi" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup apigateway controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + method.SetupMethod, + resource.SetupResource, + restapi.SetupRestAPI, + ) +} diff --git a/pkg/controller/apigatewayv2/setup.go b/pkg/controller/apigatewayv2/setup.go new file mode 100644 index 0000000000..714cc57f49 --- /dev/null +++ b/pkg/controller/apigatewayv2/setup.go @@ -0,0 +1,56 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package apigatewayv2 + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/api" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/apimapping" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/authorizer" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/deployment" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/domainname" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/integration" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/integrationresponse" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/model" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/route" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/routeresponse" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/stage" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/vpclink" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup apigatewayv2 controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + api.SetupAPI, + apimapping.SetupAPIMapping, + authorizer.SetupAuthorizer, + deployment.SetupDeployment, + domainname.SetupDomainName, + integration.SetupIntegration, + integrationresponse.SetupIntegrationResponse, + model.SetupModel, + route.SetupRoute, + routeresponse.SetupRouteResponse, + stage.SetupStage, + vpclink.SetupVPCLink, + ) +} diff --git a/pkg/controller/athena/setup.go b/pkg/controller/athena/setup.go new file mode 100644 index 0000000000..24feabd2f4 --- /dev/null +++ b/pkg/controller/athena/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package athena + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/athena/workgroup" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup athena controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + workgroup.SetupWorkGroup, + ) +} diff --git a/pkg/controller/autoscaling/setup.go b/pkg/controller/autoscaling/setup.go new file mode 100644 index 0000000000..8d0d168b37 --- /dev/null +++ b/pkg/controller/autoscaling/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package autoscaling + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/autoscaling/autoscalinggroup" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup autoscaling controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + autoscalinggroup.SetupAutoScalingGroup, + ) +} diff --git a/pkg/controller/aws.go b/pkg/controller/aws.go index d0aa9642a5..5d2caf7b78 100644 --- a/pkg/controller/aws.go +++ b/pkg/controller/aws.go @@ -22,351 +22,114 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane-contrib/provider-aws/pkg/controller/acm" - "github.com/crossplane-contrib/provider-aws/pkg/controller/acmpca/certificateauthority" - "github.com/crossplane-contrib/provider-aws/pkg/controller/acmpca/certificateauthoritypermission" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway/method" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway/resource" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway/restapi" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/api" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/apimapping" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/authorizer" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/deployment" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/domainname" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/integration" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/integrationresponse" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/model" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/route" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/routeresponse" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/stage" - "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/vpclink" - athenaworkgroup "github.com/crossplane-contrib/provider-aws/pkg/controller/athena/workgroup" - "github.com/crossplane-contrib/provider-aws/pkg/controller/autoscaling/autoscalinggroup" - "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/computeenvironment" - batchjob "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/job" - "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/jobdefinition" - "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/jobqueue" + "github.com/crossplane-contrib/provider-aws/pkg/controller/acmpca" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway" + "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2" + "github.com/crossplane-contrib/provider-aws/pkg/controller/athena" + "github.com/crossplane-contrib/provider-aws/pkg/controller/autoscaling" + "github.com/crossplane-contrib/provider-aws/pkg/controller/batch" "github.com/crossplane-contrib/provider-aws/pkg/controller/cache" - "github.com/crossplane-contrib/provider-aws/pkg/controller/cache/cachesubnetgroup" - "github.com/crossplane-contrib/provider-aws/pkg/controller/cache/cluster" - "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/cachepolicy" - cloudfrontorginaccessidentity "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/cloudfrontoriginaccessidentity" - "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/distribution" - cloudfrontresponseheaderspolicy "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/responseheaderspolicy" - domain "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudsearch/domain" - cwloggroup "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudwatchlogs/loggroup" - cognitoidentitypool "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentity/identitypool" - cognitogroup "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/group" - cognitogroupusermembership "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/groupusermembership" - cognitoidentityprovider "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/identityprovider" - cognitoresourceserver "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/resourceserver" - cognitouserpool "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/userpool" - cognitouserpoolclient "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/userpoolclient" - cognitouserpooldomain "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/userpooldomain" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudsearch" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudwatchlogs" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider" "github.com/crossplane-contrib/provider-aws/pkg/controller/config" "github.com/crossplane-contrib/provider-aws/pkg/controller/database" - "github.com/crossplane-contrib/provider-aws/pkg/controller/database/dbsubnetgroup" - daxcluster "github.com/crossplane-contrib/provider-aws/pkg/controller/dax/cluster" - daxparametergroup "github.com/crossplane-contrib/provider-aws/pkg/controller/dax/parametergroup" - daxsubnetgroup "github.com/crossplane-contrib/provider-aws/pkg/controller/dax/subnetgroup" - docdbcluster "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/dbcluster" - docdbclusterparametergroup "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/dbclusterparametergroup" - docdbinstance "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/dbinstance" - docdbsubnetgroup "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/dbsubnetgroup" - "github.com/crossplane-contrib/provider-aws/pkg/controller/dynamodb/backup" - "github.com/crossplane-contrib/provider-aws/pkg/controller/dynamodb/globaltable" - "github.com/crossplane-contrib/provider-aws/pkg/controller/dynamodb/table" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/address" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/flowlog" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/instance" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/internetgateway" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/launchtemplate" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/launchtemplateversion" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/natgateway" - ec2route "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/route" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/routetable" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/securitygroup" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/securitygrouprule" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/subnet" - transitgateway "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/transitgateway" - transitgatewayroute "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/transitgatewayroute" - transitgatewayroutetable "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/transitgatewayroutetable" - transitgatewayvpcattachment "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/transitgatewayvpcattachment" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/volume" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/vpc" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/vpccidrblock" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/vpcendpoint" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/vpcendpointserviceconfiguration" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/vpcpeeringconnection" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ecr/lifecyclepolicy" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ecr/repository" - "github.com/crossplane-contrib/provider-aws/pkg/controller/ecr/repositorypolicy" - ecscluster "github.com/crossplane-contrib/provider-aws/pkg/controller/ecs/cluster" - ecsservice "github.com/crossplane-contrib/provider-aws/pkg/controller/ecs/service" - ecstask "github.com/crossplane-contrib/provider-aws/pkg/controller/ecs/taskdefinition" - "github.com/crossplane-contrib/provider-aws/pkg/controller/efs/accesspoint" - "github.com/crossplane-contrib/provider-aws/pkg/controller/efs/filesystem" - efsmounttarget "github.com/crossplane-contrib/provider-aws/pkg/controller/efs/mounttarget" + "github.com/crossplane-contrib/provider-aws/pkg/controller/dax" + "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ecr" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ecs" + "github.com/crossplane-contrib/provider-aws/pkg/controller/efs" "github.com/crossplane-contrib/provider-aws/pkg/controller/eks" - eksaddon "github.com/crossplane-contrib/provider-aws/pkg/controller/eks/addon" - "github.com/crossplane-contrib/provider-aws/pkg/controller/eks/fargateprofile" - "github.com/crossplane-contrib/provider-aws/pkg/controller/eks/identityproviderconfig" - "github.com/crossplane-contrib/provider-aws/pkg/controller/eks/nodegroup" - "github.com/crossplane-contrib/provider-aws/pkg/controller/elasticache/cacheparametergroup" - "github.com/crossplane-contrib/provider-aws/pkg/controller/elasticloadbalancing/elb" - "github.com/crossplane-contrib/provider-aws/pkg/controller/elasticloadbalancing/elbattachment" - "github.com/crossplane-contrib/provider-aws/pkg/controller/elbv2/listener" - "github.com/crossplane-contrib/provider-aws/pkg/controller/elbv2/loadbalancer" - "github.com/crossplane-contrib/provider-aws/pkg/controller/elbv2/target" - "github.com/crossplane-contrib/provider-aws/pkg/controller/elbv2/targetgroup" - emrcontainersjobrun "github.com/crossplane-contrib/provider-aws/pkg/controller/emrcontainers/jobrun" - emrcontainersvirtualcluster "github.com/crossplane-contrib/provider-aws/pkg/controller/emrcontainers/virtualcluster" - glueclassifier "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/classifier" - glueconnection "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/connection" - gluecrawler "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/crawler" - glueDatabase "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/database" - gluejob "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/job" - gluesecurityconfiguration "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/securityconfiguration" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/accesskey" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/group" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/grouppolicyattachment" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/groupusermembership" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/instanceprofile" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/openidconnectprovider" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/policy" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/role" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/rolepolicyattachment" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/servicelinkedrole" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/user" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/userpolicyattachment" - iotpolicy "github.com/crossplane-contrib/provider-aws/pkg/controller/iot/policy" - "github.com/crossplane-contrib/provider-aws/pkg/controller/iot/thing" - kafkacluster "github.com/crossplane-contrib/provider-aws/pkg/controller/kafka/cluster" - kafkaconfiguration "github.com/crossplane-contrib/provider-aws/pkg/controller/kafka/configuration" - kinesisstream "github.com/crossplane-contrib/provider-aws/pkg/controller/kinesis/stream" - "github.com/crossplane-contrib/provider-aws/pkg/controller/kms/alias" - "github.com/crossplane-contrib/provider-aws/pkg/controller/kms/key" - lambdafunction "github.com/crossplane-contrib/provider-aws/pkg/controller/lambda/function" - lambdaurlconfig "github.com/crossplane-contrib/provider-aws/pkg/controller/lambda/functionurlconfig" - lambdapermission "github.com/crossplane-contrib/provider-aws/pkg/controller/lambda/permission" - mqbroker "github.com/crossplane-contrib/provider-aws/pkg/controller/mq/broker" - mquser "github.com/crossplane-contrib/provider-aws/pkg/controller/mq/user" - mwaaenvironment "github.com/crossplane-contrib/provider-aws/pkg/controller/mwaa/environment" - neptunecluster "github.com/crossplane-contrib/provider-aws/pkg/controller/neptune/dbcluster" - opensearchdomain "github.com/crossplane-contrib/provider-aws/pkg/controller/opensearchservice/domain" - prometheusservicealertmanagerdefinition "github.com/crossplane-contrib/provider-aws/pkg/controller/prometheusservice/alertmanagerdefinition" - prometheusservicerulegroupnamespace "github.com/crossplane-contrib/provider-aws/pkg/controller/prometheusservice/rulegroupsnamespace" - prometheusserviceworkspace "github.com/crossplane-contrib/provider-aws/pkg/controller/prometheusservice/workspace" - resourceshare "github.com/crossplane-contrib/provider-aws/pkg/controller/ram/resourceshare" - "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbcluster" - "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbclusterparametergroup" - "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbinstance" - "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbinstanceroleassociation" - "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbparametergroup" - "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/globalcluster" - optiongroup "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/optiongroup" + "github.com/crossplane-contrib/provider-aws/pkg/controller/elasticache" + "github.com/crossplane-contrib/provider-aws/pkg/controller/elasticloadbalancing" + "github.com/crossplane-contrib/provider-aws/pkg/controller/elbv2" + "github.com/crossplane-contrib/provider-aws/pkg/controller/emrcontainers" + "github.com/crossplane-contrib/provider-aws/pkg/controller/glue" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iot" + "github.com/crossplane-contrib/provider-aws/pkg/controller/kafka" + "github.com/crossplane-contrib/provider-aws/pkg/controller/kinesis" + "github.com/crossplane-contrib/provider-aws/pkg/controller/kms" + "github.com/crossplane-contrib/provider-aws/pkg/controller/lambda" + "github.com/crossplane-contrib/provider-aws/pkg/controller/mq" + "github.com/crossplane-contrib/provider-aws/pkg/controller/mwaa" + "github.com/crossplane-contrib/provider-aws/pkg/controller/neptune" + "github.com/crossplane-contrib/provider-aws/pkg/controller/opensearchservice" + "github.com/crossplane-contrib/provider-aws/pkg/controller/prometheusservice" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ram" + "github.com/crossplane-contrib/provider-aws/pkg/controller/rds" "github.com/crossplane-contrib/provider-aws/pkg/controller/redshift" - "github.com/crossplane-contrib/provider-aws/pkg/controller/route53/hostedzone" - "github.com/crossplane-contrib/provider-aws/pkg/controller/route53/resourcerecordset" - "github.com/crossplane-contrib/provider-aws/pkg/controller/route53resolver/resolverendpoint" - "github.com/crossplane-contrib/provider-aws/pkg/controller/route53resolver/resolverrule" - "github.com/crossplane-contrib/provider-aws/pkg/controller/route53resolver/resolverruleassociation" + "github.com/crossplane-contrib/provider-aws/pkg/controller/route53" + "github.com/crossplane-contrib/provider-aws/pkg/controller/route53resolver" "github.com/crossplane-contrib/provider-aws/pkg/controller/s3" - "github.com/crossplane-contrib/provider-aws/pkg/controller/s3/bucketpolicy" - s3control "github.com/crossplane-contrib/provider-aws/pkg/controller/s3control/accesspoint" - "github.com/crossplane-contrib/provider-aws/pkg/controller/secretsmanager/secret" - "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/httpnamespace" - "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/privatednsnamespace" - "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/publicdnsnamespace" - servicediscoveryservice "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/service" - "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/configurationset" - "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/emailidentity" - "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/emailtemplate" - "github.com/crossplane-contrib/provider-aws/pkg/controller/sfn/activity" - "github.com/crossplane-contrib/provider-aws/pkg/controller/sfn/statemachine" - "github.com/crossplane-contrib/provider-aws/pkg/controller/sns/subscription" - "github.com/crossplane-contrib/provider-aws/pkg/controller/sns/topic" - "github.com/crossplane-contrib/provider-aws/pkg/controller/sqs/queue" - transferserver "github.com/crossplane-contrib/provider-aws/pkg/controller/transfer/server" - transferuser "github.com/crossplane-contrib/provider-aws/pkg/controller/transfer/user" + "github.com/crossplane-contrib/provider-aws/pkg/controller/s3control" + "github.com/crossplane-contrib/provider-aws/pkg/controller/secretsmanager" + "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery" + "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2" + "github.com/crossplane-contrib/provider-aws/pkg/controller/sfn" + "github.com/crossplane-contrib/provider-aws/pkg/controller/sns" + "github.com/crossplane-contrib/provider-aws/pkg/controller/sqs" + "github.com/crossplane-contrib/provider-aws/pkg/controller/transfer" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" ) // Setup creates all AWS controllers with the supplied logger and adds them to // the supplied manager. func Setup(mgr ctrl.Manager, o controller.Options) error { - for _, setup := range []func(ctrl.Manager, controller.Options) error{ - cache.SetupReplicationGroup, - cachesubnetgroup.SetupCacheSubnetGroup, - cacheparametergroup.SetupCacheParameterGroup, - cluster.SetupCacheCluster, - database.SetupRDSInstance, - daxcluster.SetupCluster, - daxparametergroup.SetupParameterGroup, - daxsubnetgroup.SetupSubnetGroup, - domain.SetupDomain, - docdbinstance.SetupDBInstance, - docdbcluster.SetupDBCluster, - docdbclusterparametergroup.SetupDBClusterParameterGroup, - docdbsubnetgroup.SetupDBSubnetGroup, - ecscluster.SetupCluster, - ecsservice.SetupService, - ecstask.SetupTaskDefinition, - eks.SetupCluster, - eksaddon.SetupAddon, - identityproviderconfig.SetupIdentityProviderConfig, - instanceprofile.SetupInstanceProfile, - elb.SetupELB, - elbattachment.SetupELBAttachment, - nodegroup.SetupNodeGroup, - s3.SetupBucket, - bucketpolicy.SetupBucketPolicy, - accesskey.SetupAccessKey, - user.SetupUser, - group.SetupGroup, - policy.SetupPolicy, - role.SetupRole, - groupusermembership.SetupGroupUserMembership, - userpolicyattachment.SetupUserPolicyAttachment, - grouppolicyattachment.SetupGroupPolicyAttachment, - rolepolicyattachment.SetupRolePolicyAttachment, - vpc.SetupVPC, - subnet.SetupSubnet, - securitygroup.SetupSecurityGroup, - securitygrouprule.SetupSecurityGroupRule, - internetgateway.SetupInternetGateway, - launchtemplate.SetupLaunchTemplate, - launchtemplateversion.SetupLaunchTemplateVersion, - natgateway.SetupNatGateway, - routetable.SetupRouteTable, - dbsubnetgroup.SetupDBSubnetGroup, - certificateauthority.SetupCertificateAuthority, - certificateauthoritypermission.SetupCertificateAuthorityPermission, - acm.SetupCertificate, - resourcerecordset.SetupResourceRecordSet, - hostedzone.SetupHostedZone, - secret.SetupSecret, - topic.SetupSNSTopic, - subscription.SetupSubscription, - queue.SetupQueue, - redshift.SetupCluster, - address.SetupAddress, - repository.SetupRepository, - repositorypolicy.SetupRepositoryPolicy, - lifecyclepolicy.SetupLifecyclePolicy, - api.SetupAPI, - stage.SetupStage, - route.SetupRoute, - authorizer.SetupAuthorizer, - integration.SetupIntegration, - deployment.SetupDeployment, - domainname.SetupDomainName, - integrationresponse.SetupIntegrationResponse, - model.SetupModel, - apimapping.SetupAPIMapping, - routeresponse.SetupRouteResponse, - vpclink.SetupVPCLink, - fargateprofile.SetupFargateProfile, - activity.SetupActivity, - statemachine.SetupStateMachine, - table.SetupTable, - backup.SetupBackup, - globaltable.SetupGlobalTable, - key.SetupKey, - alias.SetupAlias, - accesspoint.SetupAccessPoint, - filesystem.SetupFileSystem, - dbcluster.SetupDBCluster, - dbclusterparametergroup.SetupDBClusterParameterGroup, - dbinstance.SetupDBInstance, - dbinstanceroleassociation.SetupDBInstanceRoleAssociation, - dbparametergroup.SetupDBParameterGroup, - globalcluster.SetupGlobalCluster, - vpccidrblock.SetupVPCCIDRBlock, - privatednsnamespace.SetupPrivateDNSNamespace, - publicdnsnamespace.SetupPublicDNSNamespace, - httpnamespace.SetupHTTPNamespace, - lambdafunction.SetupFunction, - lambdapermission.SetupPermission, - lambdaurlconfig.SetupFunctionURL, - openidconnectprovider.SetupOpenIDConnectProvider, - distribution.SetupDistribution, - cachepolicy.SetupCachePolicy, - cloudfrontorginaccessidentity.SetupCloudFrontOriginAccessIdentity, - cloudfrontresponseheaderspolicy.SetupResponseHeadersPolicy, - resolverendpoint.SetupResolverEndpoint, - resolverrule.SetupResolverRule, - vpcpeeringconnection.SetupVPCPeeringConnection, - vpcendpoint.SetupVPCEndpoint, - kafkacluster.SetupCluster, - efsmounttarget.SetupMountTarget, - transferserver.SetupServer, - transferuser.SetupUser, - instance.SetupInstance, - gluejob.SetupJob, - gluesecurityconfiguration.SetupSecurityConfiguration, - glueconnection.SetupConnection, - glueDatabase.SetupDatabase, - gluecrawler.SetupCrawler, - glueclassifier.SetupClassifier, - mqbroker.SetupBroker, - mquser.SetupUser, - mwaaenvironment.SetupEnvironment, - cwloggroup.SetupLogGroup, - volume.SetupVolume, - transitgateway.SetupTransitGateway, - transitgatewayvpcattachment.SetupTransitGatewayVPCAttachment, - thing.SetupThing, - iotpolicy.SetupPolicy, - ec2route.SetupRoute, - athenaworkgroup.SetupWorkGroup, - resourceshare.SetupResourceShare, - kafkaconfiguration.SetupConfiguration, - listener.SetupListener, - loadbalancer.SetupLoadBalancer, - targetgroup.SetupTargetGroup, - target.SetupTarget, - transitgatewayroute.SetupTransitGatewayRoute, - transitgatewayroutetable.SetupTransitGatewayRouteTable, - vpcendpointserviceconfiguration.SetupVPCEndpointServiceConfiguration, - kinesisstream.SetupStream, - resolverruleassociation.SetupResolverRuleAssociation, - cognitouserpool.SetupUserPool, - cognitouserpooldomain.SetupUserPoolDomain, - cognitogroup.SetupGroup, - cognitouserpoolclient.SetupUserPoolClient, - cognitoidentityprovider.SetupIdentityProvider, - cognitoresourceserver.SetupResourceServer, - cognitogroupusermembership.SetupGroupUserMembership, - neptunecluster.SetupDBCluster, - topic.SetupSNSTopic, - subscription.SetupSubscription, - prometheusserviceworkspace.SetupWorkspace, - prometheusservicerulegroupnamespace.SetupRuleGroupsNamespace, - prometheusservicealertmanagerdefinition.SetupAlertManagerDefinition, - resource.SetupResource, - restapi.SetupRestAPI, - method.SetupMethod, - cognitoidentitypool.SetupIdentityPool, - flowlog.SetupFlowLog, - opensearchdomain.SetupDomain, - computeenvironment.SetupComputeEnvironment, - jobqueue.SetupJobQueue, - jobdefinition.SetupJobDefinition, - batchjob.SetupJob, - emrcontainersjobrun.SetupJobRun, - emrcontainersvirtualcluster.SetupVirtualCluster, - optiongroup.SetupOptionGroup, - autoscalinggroup.SetupAutoScalingGroup, - s3control.SetupAccessPoint, - servicediscoveryservice.SetupService, - configurationset.SetupConfigurationSet, - servicelinkedrole.SetupServiceLinkedRole, - emailidentity.SetupEmailIdentity, - emailtemplate.SetupEmailTemplate, - } { - if err := setup(mgr, o); err != nil { - return err - } - } - - return config.Setup(mgr, o) + return setup.SetupControllers( + mgr, o, + acm.Setup, + acmpca.Setup, + apigateway.Setup, + apigatewayv2.Setup, + athena.Setup, + autoscaling.Setup, + batch.Setup, + cache.Setup, + cloudfront.Setup, + cloudsearch.Setup, + cloudwatchlogs.Setup, + cognitoidentityprovider.Setup, + config.Setup, + database.Setup, + dax.Setup, + docdb.Setup, + ec2.Setup, + ecr.Setup, + ecs.Setup, + efs.Setup, + eks.Setup, + elasticache.Setup, + elasticloadbalancing.Setup, + elbv2.Setup, + emrcontainers.Setup, + glue.Setup, + iam.Setup, + iot.Setup, + kafka.Setup, + kinesis.Setup, + kms.Setup, + lambda.Setup, + mq.Setup, + mwaa.Setup, + neptune.Setup, + opensearchservice.Setup, + prometheusservice.Setup, + ram.Setup, + rds.Setup, + redshift.Setup, + route53.Setup, + route53resolver.Setup, + s3.Setup, + s3control.Setup, + secretsmanager.Setup, + servicediscovery.Setup, + sesv2.Setup, + sfn.Setup, + sns.Setup, + sqs.Setup, + transfer.Setup, + ) } diff --git a/pkg/controller/batch/computeenvironment/setup.go b/pkg/controller/batch/computeenvironment/setup.go index 2bb90f7dac..3a8824b563 100644 --- a/pkg/controller/batch/computeenvironment/setup.go +++ b/pkg/controller/batch/computeenvironment/setup.go @@ -32,7 +32,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/batch/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/batch" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/utils" ) // SetupComputeEnvironment adds a controller that reconciles a ComputeEnvironment. diff --git a/pkg/controller/batch/job/controller.go b/pkg/controller/batch/job/controller.go index 4bca5ac707..52f2c8a468 100644 --- a/pkg/controller/batch/job/controller.go +++ b/pkg/controller/batch/job/controller.go @@ -39,7 +39,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/batch/manualv1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/batch" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/batch/jobdefinition/controller.go b/pkg/controller/batch/jobdefinition/controller.go index d64fc3c2a4..c57e0283bf 100644 --- a/pkg/controller/batch/jobdefinition/controller.go +++ b/pkg/controller/batch/jobdefinition/controller.go @@ -39,7 +39,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/batch/manualv1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/batch" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/batch/jobqueue/setup.go b/pkg/controller/batch/jobqueue/setup.go index 0d27d13cb6..678ffa8c44 100644 --- a/pkg/controller/batch/jobqueue/setup.go +++ b/pkg/controller/batch/jobqueue/setup.go @@ -34,7 +34,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/batch/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/batch" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/utils" ) const ( diff --git a/pkg/controller/batch/setup.go b/pkg/controller/batch/setup.go new file mode 100644 index 0000000000..876afe33d3 --- /dev/null +++ b/pkg/controller/batch/setup.go @@ -0,0 +1,40 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package batch + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/computeenvironment" + "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/job" + "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/jobdefinition" + "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/jobqueue" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup batch controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + computeenvironment.SetupComputeEnvironment, + job.SetupJob, + jobdefinition.SetupJobDefinition, + jobqueue.SetupJobQueue, + ) +} diff --git a/pkg/controller/batch/tags.go b/pkg/controller/batch/utils/tags.go similarity index 99% rename from pkg/controller/batch/tags.go rename to pkg/controller/batch/utils/tags.go index 65161f8268..714154bd99 100644 --- a/pkg/controller/batch/tags.go +++ b/pkg/controller/batch/utils/tags.go @@ -14,7 +14,7 @@ See the License for the specific language governing permission and limitations under the License. */ -package batch +package utils import ( "context" diff --git a/pkg/controller/cache/managed.go b/pkg/controller/cache/replicationgroup/managed.go similarity index 99% rename from pkg/controller/cache/managed.go rename to pkg/controller/cache/replicationgroup/managed.go index f8d82c24d4..a56b36fcc2 100644 --- a/pkg/controller/cache/managed.go +++ b/pkg/controller/cache/replicationgroup/managed.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package cache +package replicationgroup import ( "context" diff --git a/pkg/controller/cache/managed_test.go b/pkg/controller/cache/replicationgroup/managed_test.go similarity index 99% rename from pkg/controller/cache/managed_test.go rename to pkg/controller/cache/replicationgroup/managed_test.go index 489c7d3bc0..a291bc422b 100644 --- a/pkg/controller/cache/managed_test.go +++ b/pkg/controller/cache/replicationgroup/managed_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package cache +package replicationgroup import ( "context" diff --git a/pkg/controller/cache/setup.go b/pkg/controller/cache/setup.go new file mode 100644 index 0000000000..1960762631 --- /dev/null +++ b/pkg/controller/cache/setup.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cache + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/cache/cachesubnetgroup" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cache/cluster" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cache/replicationgroup" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup cache controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + cachesubnetgroup.SetupCacheSubnetGroup, + cluster.SetupCacheCluster, + replicationgroup.SetupReplicationGroup, + ) +} diff --git a/pkg/controller/cloudfront/cachepolicy/setup.go b/pkg/controller/cloudfront/cachepolicy/setup.go index cb94de00c2..03a7cb787b 100644 --- a/pkg/controller/cloudfront/cachepolicy/setup.go +++ b/pkg/controller/cloudfront/cachepolicy/setup.go @@ -32,7 +32,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cloudfront/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" - "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront" + cloudfront "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/cloudfront/responseheaderspolicy/setup.go b/pkg/controller/cloudfront/responseheaderspolicy/setup.go index f9072e5d1c..d1fcea51a5 100644 --- a/pkg/controller/cloudfront/responseheaderspolicy/setup.go +++ b/pkg/controller/cloudfront/responseheaderspolicy/setup.go @@ -33,7 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cloudfront/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" - "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront" + cloudfront "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/cloudfront/setup.go b/pkg/controller/cloudfront/setup.go new file mode 100644 index 0000000000..adee7d0398 --- /dev/null +++ b/pkg/controller/cloudfront/setup.go @@ -0,0 +1,40 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cloudfront + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/cachepolicy" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/cloudfrontoriginaccessidentity" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/distribution" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/responseheaderspolicy" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup cloudfront controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + cachepolicy.SetupCachePolicy, + cloudfrontoriginaccessidentity.SetupCloudFrontOriginAccessIdentity, + distribution.SetupDistribution, + responseheaderspolicy.SetupResponseHeadersPolicy, + ) +} diff --git a/pkg/controller/cloudfront/lateinit.go b/pkg/controller/cloudfront/utils/lateinit.go similarity index 99% rename from pkg/controller/cloudfront/lateinit.go rename to pkg/controller/cloudfront/utils/lateinit.go index f1d71652fa..659575b19f 100644 --- a/pkg/controller/cloudfront/lateinit.go +++ b/pkg/controller/cloudfront/utils/lateinit.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package cloudfront +package utils import ( "encoding/json" diff --git a/pkg/controller/cloudfront/lateinit_test.go b/pkg/controller/cloudfront/utils/lateinit_test.go similarity index 99% rename from pkg/controller/cloudfront/lateinit_test.go rename to pkg/controller/cloudfront/utils/lateinit_test.go index 9288208840..bf0c40d647 100644 --- a/pkg/controller/cloudfront/lateinit_test.go +++ b/pkg/controller/cloudfront/utils/lateinit_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package cloudfront +package utils import ( "reflect" diff --git a/pkg/controller/cloudsearch/setup.go b/pkg/controller/cloudsearch/setup.go new file mode 100644 index 0000000000..c560d25c42 --- /dev/null +++ b/pkg/controller/cloudsearch/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cloudsearch + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudsearch/domain" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup cloudsearch controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + domain.SetupDomain, + ) +} diff --git a/pkg/controller/cloudwatchlogs/setup.go b/pkg/controller/cloudwatchlogs/setup.go new file mode 100644 index 0000000000..0f56f9d6ef --- /dev/null +++ b/pkg/controller/cloudwatchlogs/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cloudwatchlogs + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudwatchlogs/loggroup" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup cloudwatchlogs controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + loggroup.SetupLogGroup, + ) +} diff --git a/pkg/controller/cognitoidentity/setup.go b/pkg/controller/cognitoidentity/setup.go new file mode 100644 index 0000000000..2a232782a6 --- /dev/null +++ b/pkg/controller/cognitoidentity/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cognitoidentity + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentity/identitypool" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup cognitoidentity controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + identitypool.SetupIdentityPool, + ) +} diff --git a/pkg/controller/cognitoidentityprovider/setup.go b/pkg/controller/cognitoidentityprovider/setup.go new file mode 100644 index 0000000000..99d8dab458 --- /dev/null +++ b/pkg/controller/cognitoidentityprovider/setup.go @@ -0,0 +1,46 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cognitoidentityprovider + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/group" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/groupusermembership" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/identityprovider" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/resourceserver" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/userpool" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/userpoolclient" + "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/userpooldomain" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup cognitoidentityprovider controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + group.SetupGroup, + groupusermembership.SetupGroupUserMembership, + identityprovider.SetupIdentityProvider, + resourceserver.SetupResourceServer, + userpool.SetupUserPool, + userpoolclient.SetupUserPoolClient, + userpooldomain.SetupUserPoolDomain, + ) +} diff --git a/pkg/controller/database/rdsinstance.go b/pkg/controller/database/rdsinstance/rdsinstance.go similarity index 99% rename from pkg/controller/database/rdsinstance.go rename to pkg/controller/database/rdsinstance/rdsinstance.go index c701c4a2e2..85b7d37770 100644 --- a/pkg/controller/database/rdsinstance.go +++ b/pkg/controller/database/rdsinstance/rdsinstance.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package database +package rdsinstance import ( "context" diff --git a/pkg/controller/database/rdsinstance_test.go b/pkg/controller/database/rdsinstance/rdsinstance_test.go similarity index 99% rename from pkg/controller/database/rdsinstance_test.go rename to pkg/controller/database/rdsinstance/rdsinstance_test.go index d3def7e845..079a5e4767 100644 --- a/pkg/controller/database/rdsinstance_test.go +++ b/pkg/controller/database/rdsinstance/rdsinstance_test.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package database +package rdsinstance import ( "context" diff --git a/pkg/controller/database/setup.go b/pkg/controller/database/setup.go new file mode 100644 index 0000000000..502e2c9a5a --- /dev/null +++ b/pkg/controller/database/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package database + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/database/dbsubnetgroup" + "github.com/crossplane-contrib/provider-aws/pkg/controller/database/rdsinstance" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup database controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + rdsinstance.SetupRDSInstance, + dbsubnetgroup.SetupDBSubnetGroup, + ) +} diff --git a/pkg/controller/dax/setup.go b/pkg/controller/dax/setup.go new file mode 100644 index 0000000000..b5bc234ec8 --- /dev/null +++ b/pkg/controller/dax/setup.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package dax + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/dax/cluster" + "github.com/crossplane-contrib/provider-aws/pkg/controller/dax/parametergroup" + "github.com/crossplane-contrib/provider-aws/pkg/controller/dax/subnetgroup" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup dax controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + cluster.SetupCluster, + parametergroup.SetupParameterGroup, + subnetgroup.SetupSubnetGroup, + ) +} diff --git a/pkg/controller/docdb/dbcluster/setup.go b/pkg/controller/docdb/dbcluster/setup.go index 46b32fb372..5017748d16 100644 --- a/pkg/controller/docdb/dbcluster/setup.go +++ b/pkg/controller/docdb/dbcluster/setup.go @@ -43,7 +43,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/docdb/dbcluster/setup_test.go b/pkg/controller/docdb/dbcluster/setup_test.go index 9492539ac5..195f96dbfc 100644 --- a/pkg/controller/docdb/dbcluster/setup_test.go +++ b/pkg/controller/docdb/dbcluster/setup_test.go @@ -40,7 +40,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/docdb/fake" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/utils" ) var ( diff --git a/pkg/controller/docdb/dbclusterparametergroup/setup.go b/pkg/controller/docdb/dbclusterparametergroup/setup.go index 0263d271ed..bdedf5a69e 100644 --- a/pkg/controller/docdb/dbclusterparametergroup/setup.go +++ b/pkg/controller/docdb/dbclusterparametergroup/setup.go @@ -37,7 +37,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/docdb/dbclusterparametergroup/setup_test.go b/pkg/controller/docdb/dbclusterparametergroup/setup_test.go index fa47973f35..4ee13a8c0e 100644 --- a/pkg/controller/docdb/dbclusterparametergroup/setup_test.go +++ b/pkg/controller/docdb/dbclusterparametergroup/setup_test.go @@ -35,7 +35,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/docdb/fake" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/utils" ) const ( diff --git a/pkg/controller/docdb/dbinstance/setup.go b/pkg/controller/docdb/dbinstance/setup.go index 3eeba7b806..0c612c3a04 100644 --- a/pkg/controller/docdb/dbinstance/setup.go +++ b/pkg/controller/docdb/dbinstance/setup.go @@ -37,7 +37,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/docdb/dbsubnetgroup/setup.go b/pkg/controller/docdb/dbsubnetgroup/setup.go index 765cf276d2..4d8b16e24c 100644 --- a/pkg/controller/docdb/dbsubnetgroup/setup.go +++ b/pkg/controller/docdb/dbsubnetgroup/setup.go @@ -36,7 +36,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/docdb/setup.go b/pkg/controller/docdb/setup.go new file mode 100644 index 0000000000..568d23f555 --- /dev/null +++ b/pkg/controller/docdb/setup.go @@ -0,0 +1,40 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package docdb + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/dbcluster" + "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/dbclusterparametergroup" + "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/dbinstance" + "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/dbsubnetgroup" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup docdb controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + dbcluster.SetupDBCluster, + dbclusterparametergroup.SetupDBClusterParameterGroup, + dbinstance.SetupDBInstance, + dbsubnetgroup.SetupDBSubnetGroup, + ) +} diff --git a/pkg/controller/docdb/tags.go b/pkg/controller/docdb/utils/tags.go similarity index 99% rename from pkg/controller/docdb/tags.go rename to pkg/controller/docdb/utils/tags.go index d6eaaa22ef..1708c5d11a 100644 --- a/pkg/controller/docdb/tags.go +++ b/pkg/controller/docdb/utils/tags.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package docdb +package utils import ( "sort" diff --git a/pkg/controller/dynamodb/setup.go b/pkg/controller/dynamodb/setup.go new file mode 100644 index 0000000000..6c52608b86 --- /dev/null +++ b/pkg/controller/dynamodb/setup.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package dynamodb + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/dynamodb/backup" + "github.com/crossplane-contrib/provider-aws/pkg/controller/dynamodb/globaltable" + "github.com/crossplane-contrib/provider-aws/pkg/controller/dynamodb/table" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup dynamodb controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + backup.SetupBackup, + globaltable.SetupGlobalTable, + table.SetupTable, + ) +} diff --git a/pkg/controller/ec2/setup.go b/pkg/controller/ec2/setup.go new file mode 100644 index 0000000000..cca3b3fa68 --- /dev/null +++ b/pkg/controller/ec2/setup.go @@ -0,0 +1,76 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ec2 + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/address" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/flowlog" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/instance" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/internetgateway" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/launchtemplate" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/launchtemplateversion" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/natgateway" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/route" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/routetable" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/securitygroup" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/securitygrouprule" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/subnet" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/transitgateway" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/transitgatewayroute" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/transitgatewayroutetable" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/transitgatewayvpcattachment" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/volume" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/vpc" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/vpccidrblock" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/vpcendpoint" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/vpcendpointserviceconfiguration" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/vpcpeeringconnection" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup ec2 controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + address.SetupAddress, + flowlog.SetupFlowLog, + instance.SetupInstance, + internetgateway.SetupInternetGateway, + launchtemplate.SetupLaunchTemplate, + launchtemplateversion.SetupLaunchTemplateVersion, + natgateway.SetupNatGateway, + route.SetupRoute, + routetable.SetupRouteTable, + securitygroup.SetupSecurityGroup, + securitygrouprule.SetupSecurityGroupRule, + subnet.SetupSubnet, + transitgateway.SetupTransitGateway, + transitgatewayroute.SetupTransitGatewayRoute, + transitgatewayroutetable.SetupTransitGatewayRouteTable, + transitgatewayvpcattachment.SetupTransitGatewayVPCAttachment, + volume.SetupVolume, + vpc.SetupVPC, + vpccidrblock.SetupVPCCIDRBlock, + vpcendpoint.SetupVPCEndpoint, + vpcendpointserviceconfiguration.SetupVPCEndpointServiceConfiguration, + vpcpeeringconnection.SetupVPCPeeringConnection, + ) +} diff --git a/pkg/controller/ecr/setup.go b/pkg/controller/ecr/setup.go new file mode 100644 index 0000000000..073a0d2b4d --- /dev/null +++ b/pkg/controller/ecr/setup.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ecr + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/ecr/lifecyclepolicy" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ecr/repository" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ecr/repositorypolicy" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup ecr controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + lifecyclepolicy.SetupLifecyclePolicy, + repository.SetupRepository, + repositorypolicy.SetupRepositoryPolicy, + ) +} diff --git a/pkg/controller/ecs/setup.go b/pkg/controller/ecs/setup.go new file mode 100644 index 0000000000..2045b1b11f --- /dev/null +++ b/pkg/controller/ecs/setup.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ecs + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/ecs/cluster" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ecs/service" + "github.com/crossplane-contrib/provider-aws/pkg/controller/ecs/taskdefinition" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup ecs controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + cluster.SetupCluster, + service.SetupService, + taskdefinition.SetupTaskDefinition, + ) +} diff --git a/pkg/controller/efs/filesystem/setup.go b/pkg/controller/efs/filesystem/setup.go index 8dbc9a0cfe..4090d2c3e8 100644 --- a/pkg/controller/efs/filesystem/setup.go +++ b/pkg/controller/efs/filesystem/setup.go @@ -22,7 +22,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/efs/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/efs" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/efs/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/efs/setup.go b/pkg/controller/efs/setup.go new file mode 100644 index 0000000000..9e14449c2f --- /dev/null +++ b/pkg/controller/efs/setup.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package efs + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/efs/accesspoint" + "github.com/crossplane-contrib/provider-aws/pkg/controller/efs/filesystem" + "github.com/crossplane-contrib/provider-aws/pkg/controller/efs/mounttarget" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup efs controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + accesspoint.SetupAccessPoint, + filesystem.SetupFileSystem, + mounttarget.SetupMountTarget, + ) +} diff --git a/pkg/controller/efs/tags.go b/pkg/controller/efs/utils/tags.go similarity index 99% rename from pkg/controller/efs/tags.go rename to pkg/controller/efs/utils/tags.go index 2a38f1271f..14ce60c677 100644 --- a/pkg/controller/efs/tags.go +++ b/pkg/controller/efs/utils/tags.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package efs +package utils import ( "sort" diff --git a/pkg/controller/eks/cluster.go b/pkg/controller/eks/cluster/cluster.go similarity index 99% rename from pkg/controller/eks/cluster.go rename to pkg/controller/eks/cluster/cluster.go index 50c1fd13a2..82850b6a4e 100644 --- a/pkg/controller/eks/cluster.go +++ b/pkg/controller/eks/cluster/cluster.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package eks +package cluster import ( "context" diff --git a/pkg/controller/eks/cluster_test.go b/pkg/controller/eks/cluster/cluster_test.go similarity index 99% rename from pkg/controller/eks/cluster_test.go rename to pkg/controller/eks/cluster/cluster_test.go index 5ed8212b25..ee492fc8d1 100644 --- a/pkg/controller/eks/cluster_test.go +++ b/pkg/controller/eks/cluster/cluster_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package eks +package cluster import ( "context" diff --git a/pkg/controller/eks/setup.go b/pkg/controller/eks/setup.go new file mode 100644 index 0000000000..75b3b55ee2 --- /dev/null +++ b/pkg/controller/eks/setup.go @@ -0,0 +1,42 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package eks + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/eks/addon" + "github.com/crossplane-contrib/provider-aws/pkg/controller/eks/cluster" + "github.com/crossplane-contrib/provider-aws/pkg/controller/eks/fargateprofile" + "github.com/crossplane-contrib/provider-aws/pkg/controller/eks/identityproviderconfig" + "github.com/crossplane-contrib/provider-aws/pkg/controller/eks/nodegroup" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup eks controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + addon.SetupAddon, + cluster.SetupCluster, + fargateprofile.SetupFargateProfile, + identityproviderconfig.SetupIdentityProviderConfig, + nodegroup.SetupNodeGroup, + ) +} diff --git a/pkg/controller/elasticache/setup.go b/pkg/controller/elasticache/setup.go new file mode 100644 index 0000000000..61163daf0a --- /dev/null +++ b/pkg/controller/elasticache/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package elasticache + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/elasticache/cacheparametergroup" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup elasticache controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + cacheparametergroup.SetupCacheParameterGroup, + ) +} diff --git a/pkg/controller/elasticloadbalancing/setup.go b/pkg/controller/elasticloadbalancing/setup.go new file mode 100644 index 0000000000..2559a03fa0 --- /dev/null +++ b/pkg/controller/elasticloadbalancing/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package elasticloadbalancing + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/elasticloadbalancing/elb" + "github.com/crossplane-contrib/provider-aws/pkg/controller/elasticloadbalancing/elbattachment" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup elasticloadbalancing controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + elb.SetupELB, + elbattachment.SetupELBAttachment, + ) +} diff --git a/pkg/controller/elbv2/setup.go b/pkg/controller/elbv2/setup.go new file mode 100644 index 0000000000..d98fa5d64d --- /dev/null +++ b/pkg/controller/elbv2/setup.go @@ -0,0 +1,40 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package elbv2 + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/elbv2/listener" + "github.com/crossplane-contrib/provider-aws/pkg/controller/elbv2/loadbalancer" + "github.com/crossplane-contrib/provider-aws/pkg/controller/elbv2/target" + "github.com/crossplane-contrib/provider-aws/pkg/controller/elbv2/targetgroup" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup elbv2 controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + listener.SetupListener, + loadbalancer.SetupLoadBalancer, + target.SetupTarget, + targetgroup.SetupTargetGroup, + ) +} diff --git a/pkg/controller/emrcontainers/setup.go b/pkg/controller/emrcontainers/setup.go new file mode 100644 index 0000000000..796f4b0440 --- /dev/null +++ b/pkg/controller/emrcontainers/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package emrcontainers + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/emrcontainers/jobrun" + "github.com/crossplane-contrib/provider-aws/pkg/controller/emrcontainers/virtualcluster" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup emrcontainers controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + jobrun.SetupJobRun, + virtualcluster.SetupVirtualCluster, + ) +} diff --git a/pkg/controller/glue/connection/setup.go b/pkg/controller/glue/connection/setup.go index ebc0edc740..9c1632ab87 100644 --- a/pkg/controller/glue/connection/setup.go +++ b/pkg/controller/glue/connection/setup.go @@ -39,7 +39,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/glue/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/glue" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/glue/crawler/setup.go b/pkg/controller/glue/crawler/setup.go index 472f547bff..05cb1574c0 100644 --- a/pkg/controller/glue/crawler/setup.go +++ b/pkg/controller/glue/crawler/setup.go @@ -40,7 +40,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/glue/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/glue" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/glue/job/setup.go b/pkg/controller/glue/job/setup.go index cdf8f968df..d26430f6e0 100644 --- a/pkg/controller/glue/job/setup.go +++ b/pkg/controller/glue/job/setup.go @@ -39,7 +39,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/glue/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/glue" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/glue/setup.go b/pkg/controller/glue/setup.go new file mode 100644 index 0000000000..e2f7fe87a9 --- /dev/null +++ b/pkg/controller/glue/setup.go @@ -0,0 +1,44 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package glue + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/classifier" + "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/connection" + "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/crawler" + "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/database" + "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/job" + "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/securityconfiguration" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup emrcontainers controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + classifier.SetupClassifier, + connection.SetupConnection, + crawler.SetupCrawler, + database.SetupDatabase, + job.SetupJob, + securityconfiguration.SetupSecurityConfiguration, + ) +} diff --git a/pkg/controller/glue/tags.go b/pkg/controller/glue/utils/tags.go similarity index 99% rename from pkg/controller/glue/tags.go rename to pkg/controller/glue/utils/tags.go index f46ab15efb..2fb4912b8b 100644 --- a/pkg/controller/glue/tags.go +++ b/pkg/controller/glue/utils/tags.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package glue +package utils import ( "context" diff --git a/pkg/controller/iam/setup.go b/pkg/controller/iam/setup.go new file mode 100644 index 0000000000..b503f94721 --- /dev/null +++ b/pkg/controller/iam/setup.go @@ -0,0 +1,56 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package iam + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/accesskey" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/group" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/grouppolicyattachment" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/groupusermembership" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/instanceprofile" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/openidconnectprovider" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/policy" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/role" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/rolepolicyattachment" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/servicelinkedrole" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/user" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/userpolicyattachment" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup iam controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + accesskey.SetupAccessKey, + group.SetupGroup, + grouppolicyattachment.SetupGroupPolicyAttachment, + groupusermembership.SetupGroupUserMembership, + instanceprofile.SetupInstanceProfile, + openidconnectprovider.SetupOpenIDConnectProvider, + policy.SetupPolicy, + role.SetupRole, + rolepolicyattachment.SetupRolePolicyAttachment, + servicelinkedrole.SetupServiceLinkedRole, + user.SetupUser, + userpolicyattachment.SetupUserPolicyAttachment, + ) +} diff --git a/pkg/controller/iot/setup.go b/pkg/controller/iot/setup.go new file mode 100644 index 0000000000..4d6463e722 --- /dev/null +++ b/pkg/controller/iot/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package iot + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/iot/policy" + "github.com/crossplane-contrib/provider-aws/pkg/controller/iot/thing" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup iot controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + thing.SetupThing, + policy.SetupPolicy, + ) +} diff --git a/pkg/controller/kafka/setup.go b/pkg/controller/kafka/setup.go new file mode 100644 index 0000000000..5092bb31bb --- /dev/null +++ b/pkg/controller/kafka/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package kafka + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/kafka/cluster" + "github.com/crossplane-contrib/provider-aws/pkg/controller/kafka/configuration" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup kafka controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + cluster.SetupCluster, + configuration.SetupConfiguration, + ) +} diff --git a/pkg/controller/kinesis/setup.go b/pkg/controller/kinesis/setup.go new file mode 100644 index 0000000000..90bba8f19d --- /dev/null +++ b/pkg/controller/kinesis/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package kinesis + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/kinesis/stream" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup kinesis controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + stream.SetupStream, + ) +} diff --git a/pkg/controller/kms/setup.go b/pkg/controller/kms/setup.go new file mode 100644 index 0000000000..2b2ebdb3b5 --- /dev/null +++ b/pkg/controller/kms/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package kms + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/kms/alias" + "github.com/crossplane-contrib/provider-aws/pkg/controller/kms/key" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup kinesis controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + alias.SetupAlias, + key.SetupKey, + ) +} diff --git a/pkg/controller/lambda/setup.go b/pkg/controller/lambda/setup.go new file mode 100644 index 0000000000..4ceb442952 --- /dev/null +++ b/pkg/controller/lambda/setup.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package lambda + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/lambda/function" + "github.com/crossplane-contrib/provider-aws/pkg/controller/lambda/functionurlconfig" + "github.com/crossplane-contrib/provider-aws/pkg/controller/lambda/permission" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup lambda controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + function.SetupFunction, + functionurlconfig.SetupFunctionURL, + permission.SetupPermission, + ) +} diff --git a/pkg/controller/mq/setup.go b/pkg/controller/mq/setup.go new file mode 100644 index 0000000000..9ddca13e37 --- /dev/null +++ b/pkg/controller/mq/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mwaa + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/mwaa/environment" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup mwaa controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + environment.SetupEnvironment, + ) +} diff --git a/pkg/controller/mwaa/setup.go b/pkg/controller/mwaa/setup.go new file mode 100644 index 0000000000..4bb6264736 --- /dev/null +++ b/pkg/controller/mwaa/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package mq + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/mq/broker" + "github.com/crossplane-contrib/provider-aws/pkg/controller/mq/user" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup mq controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + broker.SetupBroker, + user.SetupUser, + ) +} diff --git a/pkg/controller/neptune/setup.go b/pkg/controller/neptune/setup.go new file mode 100644 index 0000000000..0dcc156912 --- /dev/null +++ b/pkg/controller/neptune/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package neptune + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/neptune/dbcluster" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup neptune controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + dbcluster.SetupDBCluster, + ) +} diff --git a/pkg/controller/opensearchservice/setup.go b/pkg/controller/opensearchservice/setup.go new file mode 100644 index 0000000000..819f9a6f08 --- /dev/null +++ b/pkg/controller/opensearchservice/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package opensearchservice + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/opensearchservice/domain" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup opensearchservice controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + domain.SetupDomain, + ) +} diff --git a/pkg/controller/prometheusservice/setup.go b/pkg/controller/prometheusservice/setup.go new file mode 100644 index 0000000000..e11e148082 --- /dev/null +++ b/pkg/controller/prometheusservice/setup.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package prometheusservice + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/prometheusservice/alertmanagerdefinition" + "github.com/crossplane-contrib/provider-aws/pkg/controller/prometheusservice/rulegroupsnamespace" + "github.com/crossplane-contrib/provider-aws/pkg/controller/prometheusservice/workspace" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup prometheusservice controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + alertmanagerdefinition.SetupAlertManagerDefinition, + rulegroupsnamespace.SetupRuleGroupsNamespace, + workspace.SetupWorkspace, + ) +} diff --git a/pkg/controller/ram/setup.go b/pkg/controller/ram/setup.go new file mode 100644 index 0000000000..3e309a4224 --- /dev/null +++ b/pkg/controller/ram/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ram + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/ram/resourceshare" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup prometheusservice controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + resourceshare.SetupResourceShare, + ) +} diff --git a/pkg/controller/rds/optiongroup/setup.go b/pkg/controller/rds/optiongroup/setup.go index 433abc9978..e15feb7ef0 100644 --- a/pkg/controller/rds/optiongroup/setup.go +++ b/pkg/controller/rds/optiongroup/setup.go @@ -19,7 +19,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/rds/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" aws "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/rds" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" ) diff --git a/pkg/controller/rds/setup.go b/pkg/controller/rds/setup.go new file mode 100644 index 0000000000..b24f0edccc --- /dev/null +++ b/pkg/controller/rds/setup.go @@ -0,0 +1,46 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rds + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbcluster" + "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbclusterparametergroup" + "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbinstance" + "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbinstanceroleassociation" + "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbparametergroup" + "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/globalcluster" + "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/optiongroup" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup prometheusservice controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + dbcluster.SetupDBCluster, + dbclusterparametergroup.SetupDBClusterParameterGroup, + dbinstance.SetupDBInstance, + dbinstanceroleassociation.SetupDBInstanceRoleAssociation, + dbparametergroup.SetupDBParameterGroup, + globalcluster.SetupGlobalCluster, + optiongroup.SetupOptionGroup, + ) +} diff --git a/pkg/controller/rds/tags.go b/pkg/controller/rds/utils/tags.go similarity index 99% rename from pkg/controller/rds/tags.go rename to pkg/controller/rds/utils/tags.go index 19a623ea60..05b0fef02e 100644 --- a/pkg/controller/rds/tags.go +++ b/pkg/controller/rds/utils/tags.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package rds +package utils import ( "sort" diff --git a/pkg/controller/redshift/controller.go b/pkg/controller/redshift/cluster/controller.go similarity index 99% rename from pkg/controller/redshift/controller.go rename to pkg/controller/redshift/cluster/controller.go index 589749d9dd..7bd0296921 100644 --- a/pkg/controller/redshift/controller.go +++ b/pkg/controller/redshift/cluster/controller.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package redshift +package cluster import ( "context" diff --git a/pkg/controller/redshift/controller_test.go b/pkg/controller/redshift/cluster/controller_test.go similarity index 99% rename from pkg/controller/redshift/controller_test.go rename to pkg/controller/redshift/cluster/controller_test.go index df2003c8f3..bdf6db870f 100644 --- a/pkg/controller/redshift/controller_test.go +++ b/pkg/controller/redshift/cluster/controller_test.go @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package redshift +package cluster import ( "context" diff --git a/pkg/controller/redshift/setup.go b/pkg/controller/redshift/setup.go new file mode 100644 index 0000000000..c913b04f16 --- /dev/null +++ b/pkg/controller/redshift/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package redshift + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/redshift/cluster" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup redshift controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + cluster.SetupCluster, + ) +} diff --git a/pkg/controller/route53/setup.go b/pkg/controller/route53/setup.go new file mode 100644 index 0000000000..fba9dea003 --- /dev/null +++ b/pkg/controller/route53/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package route53 + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/route53/hostedzone" + "github.com/crossplane-contrib/provider-aws/pkg/controller/route53/resourcerecordset" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup route53 controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + hostedzone.SetupHostedZone, + resourcerecordset.SetupResourceRecordSet, + ) +} diff --git a/pkg/controller/route53resolver/setup.go b/pkg/controller/route53resolver/setup.go new file mode 100644 index 0000000000..d52696eedc --- /dev/null +++ b/pkg/controller/route53resolver/setup.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package route53resolver + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/route53resolver/resolverendpoint" + "github.com/crossplane-contrib/provider-aws/pkg/controller/route53resolver/resolverrule" + "github.com/crossplane-contrib/provider-aws/pkg/controller/route53resolver/resolverruleassociation" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup route53resolver controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + resolverendpoint.SetupResolverEndpoint, + resolverrule.SetupResolverRule, + resolverruleassociation.SetupResolverRuleAssociation, + ) +} diff --git a/pkg/controller/s3/bucket/accelerateConfig_test.go b/pkg/controller/s3/bucket/accelerateConfig_test.go index 41d84b7d7d..6d68f73cbe 100644 --- a/pkg/controller/s3/bucket/accelerateConfig_test.go +++ b/pkg/controller/s3/bucket/accelerateConfig_test.go @@ -25,7 +25,6 @@ import ( "github.com/aws/smithy-go" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -39,8 +38,6 @@ const ( suspended = "Suspended" ) -var errBoom = errors.New("boom") - var _ SubresourceClient = &AccelerateConfigurationClient{} func TestAccelerateObserve(t *testing.T) { diff --git a/pkg/controller/s3/bucket.go b/pkg/controller/s3/bucket/bucket.go similarity index 96% rename from pkg/controller/s3/bucket.go rename to pkg/controller/s3/bucket/bucket.go index 8d87a235b8..43b28eb26d 100644 --- a/pkg/controller/s3/bucket.go +++ b/pkg/controller/s3/bucket/bucket.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package s3 +package bucket import ( "context" @@ -40,7 +40,6 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/s3" - "github.com/crossplane-contrib/provider-aws/pkg/controller/s3/bucket" "github.com/crossplane-contrib/provider-aws/pkg/features" ) @@ -93,14 +92,14 @@ func (c *connector) Connect(ctx context.Context, mg resource.Managed) (managed.E return nil, err } s3client := c.newClientFn(*cfg) - return &external{s3client: s3client, subresourceClients: bucket.NewSubresourceClients(s3client), kube: c.kube, logger: c.logger}, nil + return &external{s3client: s3client, subresourceClients: NewSubresourceClients(s3client), kube: c.kube, logger: c.logger}, nil } type external struct { kube client.Client s3client s3.BucketClient logger logging.Logger - subresourceClients []bucket.SubresourceClient + subresourceClients []SubresourceClient } func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.ExternalObservation, error) { // nolint: gocyclo @@ -145,7 +144,7 @@ func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.Ex if err != nil { return managed.ExternalObservation{}, err } - if obs != bucket.Updated { + if obs != Updated { return managed.ExternalObservation{ResourceExists: true, ResourceUpToDate: false, ResourceLateInitialized: lateInit}, nil } } @@ -229,12 +228,12 @@ func (e *external) Update(ctx context.Context, mg resource.Managed) (managed.Ext return managed.ExternalUpdate{}, err } switch status { //nolint:exhaustive - case bucket.NeedsDeletion: + case NeedsDeletion: err = awsClient.Delete(ctx, cr) if err != nil { return managed.ExternalUpdate{}, awsclient.Wrap(err, errDelete) } - case bucket.NeedsUpdate: + case NeedsUpdate: if err := awsClient.CreateOrUpdate(ctx, cr); err != nil { return managed.ExternalUpdate{}, awsclient.Wrap(err, errCreateOrUpdate) } diff --git a/pkg/controller/s3/bucket_test.go b/pkg/controller/s3/bucket/bucket_test.go similarity index 98% rename from pkg/controller/s3/bucket_test.go rename to pkg/controller/s3/bucket/bucket_test.go index 45752ddf9f..e6d816a79b 100644 --- a/pkg/controller/s3/bucket_test.go +++ b/pkg/controller/s3/bucket/bucket_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package s3 +package bucket import ( "context" @@ -40,7 +40,6 @@ import ( awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" clients3 "github.com/crossplane-contrib/provider-aws/pkg/clients/s3" "github.com/crossplane-contrib/provider-aws/pkg/clients/s3/fake" - "github.com/crossplane-contrib/provider-aws/pkg/controller/s3/bucket" s3Testing "github.com/crossplane-contrib/provider-aws/pkg/controller/s3/testing" ) @@ -264,7 +263,7 @@ func TestObserve(t *testing.T) { for name, tc := range cases { t.Run(name, func(t *testing.T) { - e := &external{s3client: tc.s3, subresourceClients: bucket.NewSubresourceClients(tc.s3), kube: tc.kube} + e := &external{s3client: tc.s3, subresourceClients: NewSubresourceClients(tc.s3), kube: tc.kube} o, err := e.Observe(context.Background(), tc.args.cr) if diff := cmp.Diff(tc.want.err, err, test.EquateErrors()); diff != "" { @@ -461,7 +460,7 @@ func TestCreate(t *testing.T) { for name, tc := range cases { noop := logging.NewNopLogger() t.Run(name, func(t *testing.T) { - e := &external{s3client: tc.s3, kube: tc.kube, logger: noop, subresourceClients: bucket.NewSubresourceClients(tc.s3)} + e := &external{s3client: tc.s3, kube: tc.kube, logger: noop, subresourceClients: NewSubresourceClients(tc.s3)} o, err := e.Create(context.Background(), tc.args.cr) if diff := cmp.Diff(tc.want.err, err, test.EquateErrors()); diff != "" { @@ -659,7 +658,7 @@ func TestUpdate(t *testing.T) { for name, tc := range cases { t.Run(name, func(t *testing.T) { - e := &external{s3client: tc.s3, subresourceClients: bucket.NewSubresourceClients(tc.s3)} + e := &external{s3client: tc.s3, subresourceClients: NewSubresourceClients(tc.s3)} o, err := e.Update(context.Background(), tc.args.cr) if diff := cmp.Diff(tc.want.err, err, test.EquateErrors()); diff != "" { diff --git a/pkg/controller/s3/setup.go b/pkg/controller/s3/setup.go new file mode 100644 index 0000000000..5817a9872c --- /dev/null +++ b/pkg/controller/s3/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package s3 + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/s3/bucket" + "github.com/crossplane-contrib/provider-aws/pkg/controller/s3/bucketpolicy" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup s3 controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + bucket.SetupBucket, + bucketpolicy.SetupBucketPolicy, + ) +} diff --git a/pkg/controller/s3control/setup.go b/pkg/controller/s3control/setup.go new file mode 100644 index 0000000000..24d66b1319 --- /dev/null +++ b/pkg/controller/s3control/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package s3control + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/s3control/accesspoint" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup s3 controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + accesspoint.SetupAccessPoint, + ) +} diff --git a/pkg/controller/secretsmanager/setup.go b/pkg/controller/secretsmanager/setup.go new file mode 100644 index 0000000000..11cd3422cc --- /dev/null +++ b/pkg/controller/secretsmanager/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package secretsmanager + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/secretsmanager/secret" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup secretsmanager controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + secret.SetupSecret, + ) +} diff --git a/pkg/controller/servicediscovery/setup.go b/pkg/controller/servicediscovery/setup.go new file mode 100644 index 0000000000..3a2296f44c --- /dev/null +++ b/pkg/controller/servicediscovery/setup.go @@ -0,0 +1,40 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package servicediscovery + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/httpnamespace" + "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/privatednsnamespace" + "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/publicdnsnamespace" + "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/service" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup servicediscovery controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + service.SetupService, + httpnamespace.SetupHTTPNamespace, + privatednsnamespace.SetupPrivateDNSNamespace, + publicdnsnamespace.SetupPublicDNSNamespace, + ) +} diff --git a/pkg/controller/sesv2/configurationset/setup.go b/pkg/controller/sesv2/configurationset/setup.go index 36219156fd..d6a8c4b032 100644 --- a/pkg/controller/sesv2/configurationset/setup.go +++ b/pkg/controller/sesv2/configurationset/setup.go @@ -37,7 +37,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sesv2/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/utils" "github.com/pkg/errors" ) diff --git a/pkg/controller/sesv2/emailidentity/setup.go b/pkg/controller/sesv2/emailidentity/setup.go index 33477f08fc..587a0fe560 100644 --- a/pkg/controller/sesv2/emailidentity/setup.go +++ b/pkg/controller/sesv2/emailidentity/setup.go @@ -37,7 +37,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sesv2/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" - svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2" + svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/utils" "github.com/pkg/errors" ) diff --git a/pkg/controller/sesv2/setup.go b/pkg/controller/sesv2/setup.go new file mode 100644 index 0000000000..a7ece3f433 --- /dev/null +++ b/pkg/controller/sesv2/setup.go @@ -0,0 +1,38 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package sesv2 + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/configurationset" + "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/emailidentity" + "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/emailtemplate" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup sesv2 controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + configurationset.SetupConfigurationSet, + emailidentity.SetupEmailIdentity, + emailtemplate.SetupEmailTemplate, + ) +} diff --git a/pkg/controller/sesv2/tags.go b/pkg/controller/sesv2/utils/tags.go similarity index 99% rename from pkg/controller/sesv2/tags.go rename to pkg/controller/sesv2/utils/tags.go index d44f78e667..9bc9064e7c 100644 --- a/pkg/controller/sesv2/tags.go +++ b/pkg/controller/sesv2/utils/tags.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package sesv2 +package utils import ( "sort" diff --git a/pkg/controller/sfn/setup.go b/pkg/controller/sfn/setup.go new file mode 100644 index 0000000000..1edf2b6d5d --- /dev/null +++ b/pkg/controller/sfn/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package sfn + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/sfn/activity" + "github.com/crossplane-contrib/provider-aws/pkg/controller/sfn/statemachine" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup sfn controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + activity.SetupActivity, + statemachine.SetupStateMachine, + ) +} diff --git a/pkg/controller/sns/setup.go b/pkg/controller/sns/setup.go new file mode 100644 index 0000000000..4951912a02 --- /dev/null +++ b/pkg/controller/sns/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package sns + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/sns/subscription" + "github.com/crossplane-contrib/provider-aws/pkg/controller/sns/topic" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup sns controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + subscription.SetupSubscription, + topic.SetupSNSTopic, + ) +} diff --git a/pkg/controller/sqs/setup.go b/pkg/controller/sqs/setup.go new file mode 100644 index 0000000000..2e14cceb74 --- /dev/null +++ b/pkg/controller/sqs/setup.go @@ -0,0 +1,34 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package sqs + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/sqs/queue" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup sqs controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + queue.SetupQueue, + ) +} diff --git a/pkg/controller/transfer/setup.go b/pkg/controller/transfer/setup.go new file mode 100644 index 0000000000..c8555b6cb3 --- /dev/null +++ b/pkg/controller/transfer/setup.go @@ -0,0 +1,36 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transfer + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" + + "github.com/crossplane-contrib/provider-aws/pkg/controller/transfer/server" + "github.com/crossplane-contrib/provider-aws/pkg/controller/transfer/user" + "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" +) + +// Setup transfer controllers. +func Setup(mgr ctrl.Manager, o controller.Options) error { + return setup.SetupControllers( + mgr, o, + server.SetupServer, + user.SetupUser, + ) +} diff --git a/pkg/utils/setup/setup_controller.go b/pkg/utils/setup/setup_controller.go new file mode 100644 index 0000000000..8644ccc209 --- /dev/null +++ b/pkg/utils/setup/setup_controller.go @@ -0,0 +1,37 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package setup + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/crossplane-runtime/pkg/controller" +) + +// SetupControllerFn is a delegate to initialize a controller. +type SetupControllerFn func(ctrl.Manager, controller.Options) error //nolint:golint + +// SetupControllers is a shortcut to call a list of SetupControllerFns with mgr +// and o. +func SetupControllers(mgr ctrl.Manager, o controller.Options, setups ...SetupControllerFn) error { //nolint:golint + for _, setup := range setups { + if err := setup(mgr, o); err != nil { + return err + } + } + return nil +}