Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cloudrun iam import format in docs #2789

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/google_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/google_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/google_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