From 28abc875b3872c6c21a8208b8a8346c51a496c68 Mon Sep 17 00:00:00 2001 From: Zhenhua Li Date: Tue, 2 Jan 2024 16:05:16 -0800 Subject: [PATCH] Remove resource_definition (#9736) --- mmv1/provider/terraform/custom_code.rb | 8 +------- mmv1/templates/terraform/resource.erb | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/mmv1/provider/terraform/custom_code.rb b/mmv1/provider/terraform/custom_code.rb index a51fb29d72da..f2281aacf9b1 100644 --- a/mmv1/provider/terraform/custom_code.rb +++ b/mmv1/provider/terraform/custom_code.rb @@ -34,12 +34,7 @@ class CustomCode < Api::Object # resource's Resource.Schema map. They should be formatted as # entries in the map, e.g. `"foo": &schema.Schema{ ... },`. attr_reader :extra_schema_entry - # Resource definition code is inserted below everything else - # in the resource's Resource {...} definition. This may be useful - # for things like a MigrateState / SchemaVersion pair. - # This is likely to be used rarely and may be removed if all its - # use cases are covered in other ways. - attr_reader :resource_definition + # ==================== # Encoders & Decoders # ==================== @@ -132,7 +127,6 @@ def validate super check :extra_schema_entry, type: String - check :resource_definition, type: String check :encoder, type: String check :update_encoder, type: String check :decoder, type: String diff --git a/mmv1/templates/terraform/resource.erb b/mmv1/templates/terraform/resource.erb index 853378f2825c..8e5b6b4c2b50 100644 --- a/mmv1/templates/terraform/resource.erb +++ b/mmv1/templates/terraform/resource.erb @@ -144,8 +144,6 @@ func Resource<%= resource_name -%>() *schema.Resource { DeprecationMessage: "<%= object.deprecation_message -%>", <% end -%> -<%= lines(compile(pwd + '/' + object.custom_code.resource_definition)) if object.custom_code.resource_definition -%> - Schema: map[string]*schema.Schema{ <% order_properties(properties).each do |prop| -%> <%= lines(build_schema_property(prop, object, pwd)) -%>