diff --git a/config/externalname.go b/config/externalname.go index 442cf3e4c3..f6940b5a5d 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -1767,6 +1767,9 @@ var NoForkExternalNameConfigs = map[string]config.ExternalName{ // AppConfig Extension Associations can be imported using their extension association ID // ID is a provider-generated "aws_appconfig_extension_association": config.IdentifierFromProvider, + // AppConfig Environments can be imported by using the environment ID and application ID separated by a colon (:) + // terraform-plugin-framework + "aws_appconfig_environment": config.IdentifierFromProvider, // appintegrations // @@ -2654,9 +2657,6 @@ var CLIReconciledExternalNameConfigs = map[string]config.ExternalName{ "aws_vpc_security_group_egress_rule": vpcSecurityGroupRule(), // Imported by using the id: sgr-02108b27edd666983 "aws_vpc_security_group_ingress_rule": vpcSecurityGroupRule(), - // AppConfig Environments can be imported by using the environment ID and application ID separated by a colon (:) - // terraform-plugin-framework - "aws_appconfig_environment": config.IdentifierFromProvider, // us-west-2_abc123/3ho4ek12345678909nh3fmhpko "aws_cognito_user_pool_client": FormattedIdentifierFromProvider("", "name"), // simpledb diff --git a/internal/controller/appconfig/environment/zz_controller.go b/internal/controller/appconfig/environment/zz_controller.go index 467f9a131f..48f89bc9e3 100755 --- a/internal/controller/appconfig/environment/zz_controller.go +++ b/internal/controller/appconfig/environment/zz_controller.go @@ -20,7 +20,7 @@ import ( xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" tjcontroller "github.com/crossplane/upjet/pkg/controller" "github.com/crossplane/upjet/pkg/controller/handler" - "github.com/crossplane/upjet/pkg/terraform" + "github.com/crossplane/upjet/pkg/metrics" ctrl "sigs.k8s.io/controller-runtime" v1beta1 "github.com/upbound/provider-aws/apis/appconfig/v1beta1" @@ -39,14 +39,18 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) } eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1beta1.Environment_GroupVersionKind))) - ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Environment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1beta1.Environment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) opts := []managed.ReconcilerOption{ - managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["aws_appconfig_environment"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), - tjcontroller.WithCallbackProvider(ac), - )), + managed.WithExternalConnecter( + tjcontroller.NewNoForkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["aws_appconfig_environment"], + tjcontroller.WithNoForkAsyncLogger(o.Logger), + tjcontroller.WithNoForkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithNoForkAsyncCallbackProvider(ac), + tjcontroller.WithNoForkAsyncMetricRecorder(metrics.NewMetricRecorder(v1beta1.Environment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithNoForkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), - managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithFinalizer(tjcontroller.NewNoForkFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), managed.WithTimeout(3 * time.Minute), managed.WithInitializers(initializers), managed.WithConnectionPublishers(cps...),