Skip to content

Commit

Permalink
Remove resource_definition (#9736)
Browse files Browse the repository at this point in the history
  • Loading branch information
zli82016 authored Jan 3, 2024
1 parent 36215cc commit 28abc87
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 1 addition & 7 deletions mmv1/provider/terraform/custom_code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ====================
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions mmv1/templates/terraform/resource.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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)) -%>
Expand Down

0 comments on commit 28abc87

Please sign in to comment.