diff --git a/config/externalname.go b/config/externalname.go index 87ffe7bf0d..7418fae4dd 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -71,7 +71,7 @@ var TerraformPluginFrameworkExternalNameConfigs = map[string]config.ExternalName // dynamodb // // DynamoDB table resource policy can be important using the DynamoDB resource identifier - "aws_dynamodb_resource_policy": config.IdentifierFromProvider, + "aws_dynamodb_resource_policy": config.TemplatedStringAsIdentifier("name", "arn:aws:dynamodb:{{ .setup.configuration.region }}:{{ .setup.client_metadata.account_id }}:table/{{ .external_name }}"), // CodeGuru Profiler // Profiling Group can be imported using the the profiling group name diff --git a/internal/controller/dynamodb/resourcepolicy/zz_controller.go b/internal/controller/dynamodb/resourcepolicy/zz_controller.go index 335002b78c..c49f50dd8a 100755 --- a/internal/controller/dynamodb/resourcepolicy/zz_controller.go +++ b/internal/controller/dynamodb/resourcepolicy/zz_controller.go @@ -29,6 +29,7 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1beta1.ResourcePolicy_GroupVersionKind.String()) var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig)))