diff --git a/templates/terraform/resource.erb b/templates/terraform/resource.erb index c39576cb384b..e4d4143a045e 100644 --- a/templates/terraform/resource.erb +++ b/templates/terraform/resource.erb @@ -28,7 +28,6 @@ package google api_name_lower[0] = api_name_lower[0].downcase api_client_name = api_name_lower.downcase has_project = object.base_url.include?("{{project}}") - has_self_link = object.self_link timeouts = object.async.nil? ? Api::Timeouts.new : object.async.operation.timeouts -%> @@ -78,7 +77,7 @@ func resource<%= resource_name -%>() *schema.Resource { ForceNew: true, }, <% end -%> -<% if has_self_link -%> +<% if object.has_self_link -%> "self_link": { Type: schema.TypeString, Computed: true, @@ -229,7 +228,7 @@ func resource<%= resource_name -%>Read(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error reading <%= object.name -%>: %s", err) } <% end -%> -<% if has_self_link -%> +<% if object.has_self_link -%> if err := d.Set("self_link", ConvertSelfLinkToV1(res["selfLink"].(string))); err != nil { return fmt.Errorf("Error reading <%= object.name -%>: %s", err) } diff --git a/templates/terraform/resource.html.markdown.erb b/templates/terraform/resource.html.markdown.erb index f2fb20ac2a5b..4c8cb5b8e36f 100644 --- a/templates/terraform/resource.html.markdown.erb +++ b/templates/terraform/resource.html.markdown.erb @@ -135,7 +135,7 @@ In addition to the arguments listed above, the following computed attributes are <% properties.select(&:output).each do |prop| -%> <%= lines(build_property_documentation(prop)) -%> <% end -%> -<% if object.self_link -%> +<% if object.has_self_link -%> * `self_link` - The URI of the created resource. <% end -%>