Skip to content

Commit

Permalink
Fix cloudrun iam import format in docs (#2789)
Browse files Browse the repository at this point in the history
Merged PR #2789.
  • Loading branch information
slevenick authored and modular-magician committed Dec 5, 2019
1 parent 541765f commit abb754d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/terraform
2 changes: 1 addition & 1 deletion build/terraform-beta
7 changes: 4 additions & 3 deletions templates/terraform/resource_iam.html.markdown.erb
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@ exported:

For all import syntaxes, the "resource in question" can take any of the following forms:
<% import_format = object.iam_policy.import_format || object.import_format -%>
<% all_formats = import_id_formats(import_format, object.identity, object.base_url) -%>

<% import_id_formats(import_format, object.identity, object.base_url).each do |id_format| -%>
<% all_formats.each do |id_format| -%>
* <%= id_format %>
<% end -%>

Expand All @@ -265,12 +266,12 @@ $ terraform import <% if object.min_version.name == 'beta' %>-provider=google-be

IAM binding imports use space-delimited identifiers: the resource in question and the role, e.g.
```
$ terraform import <%= resource_ns_iam -%>_binding.editor "<%= id_format(object).gsub('{{name}}', "{{#{object.name.underscore}}}") -%> <%= object.iam_policy.allowed_iam_role -%>"
$ terraform import <%= resource_ns_iam -%>_binding.editor "<%= all_formats.first.gsub('{{name}}', "{{#{object.name.underscore}}}") -%> <%= object.iam_policy.allowed_iam_role -%>"
```

IAM policy imports use the identifier of the resource in question, e.g.
```
$ terraform import <% if object.min_version.name == 'beta' %>-provider=google-beta <% end -%><%= resource_ns_iam -%>_policy.editor <%= id_format(object).gsub('{{name}}', "{{#{object.name.underscore}}}") %>
$ terraform import <% if object.min_version.name == 'beta' %>-provider=google-beta <% end -%><%= resource_ns_iam -%>_policy.editor <%= all_formats.first.gsub('{{name}}', "{{#{object.name.underscore}}}") %>
```

-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
Expand Down
11 changes: 9 additions & 2 deletions third_party/terraform/website-compiled/google.erb
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@
</ul>
</li>

<% unless version == 'ga' %>
<li<%%= sidebar_current("docs-google-cloud-run") %>>
<a href="#">Google Cloud Run Resources</a>
<ul class="nav nav-visible">
Expand All @@ -469,9 +468,17 @@
<li<%%= sidebar_current("docs-google-cloud-run-service") %>>
<a href="/docs/providers/google/r/cloud_run_service.html">google_cloud_run_service</a>
</li>
<li<%%= sidebar_current("docs-google-cloud-run-service-iam") %>>
<a href="/docs/providers/google/r/cloud_run_service_iam.html">google_cloud_run_service_iam_binding</a>
</li>
<li<%%= sidebar_current("docs-google-cloud-run-service-iam") %>>
<a href="/docs/providers/google/r/cloud_run_service_iam.html">google_cloud_run_service_iam_member</a>
</li>
<li<%%= sidebar_current("docs-google-cloud-run-service-iam") %>>
<a href="/docs/providers/google/r/cloud_run_service_iam.html">google_cloud_run_service_iam_policy</a>
</li>
</ul>
</li>
<% end -%>

<% unless version == 'ga' %>
<li<%%= sidebar_current("docs-google-cloud-scheduler") %>>
Expand Down

0 comments on commit abb754d

Please sign in to comment.