Skip to content

Commit

Permalink
rename to exclude_import
Browse files Browse the repository at this point in the history
  • Loading branch information
emilymye committed Mar 13, 2019
1 parent d7fca6c commit 5a8f154
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions overrides/terraform/resource_override.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def self.attributes
:autogen_async,

# Flag - if false, resource is not importable
:importable
:exclude_import
]
end

Expand All @@ -60,7 +60,7 @@ def validate
check :docs, type: Provider::Terraform::Docs, default: Provider::Terraform::Docs.new
check :import_format, type: Array, item_type: String, default: []
check :autogen_async, type: :boolean, default: false
check :importable, type: :boolean, default: true
check :exclude_import, type: :boolean, default: false
end

def apply(resource)
Expand Down
4 changes: 2 additions & 2 deletions templates/terraform/resource.erb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func resource<%= resource_name -%>() *schema.Resource {
),
<% end -%>

<% if object.importable -%>
<% unless object.exclude_import -%>
Importer: &schema.ResourceImporter{
State: resource<%= resource_name -%>Import,
},
Expand Down Expand Up @@ -563,7 +563,7 @@ func resource<%= resource_name -%>Delete(d *schema.ResourceData, meta interface{
return nil
}

<% if object.importable -%>
<% unless object.exclude_import -%>
func resource<%= resource_name -%>Import(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
<% if object.custom_code.custom_import -%>
<%= lines(compile(object.custom_code.custom_import)) -%>
Expand Down

0 comments on commit 5a8f154

Please sign in to comment.