forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate compute instance and subnetwork iam (GoogleCloudPlatform#2647)
Merged PR GoogleCloudPlatform#2647.
- Loading branch information
1 parent
614f406
commit bf5e882
Showing
14 changed files
with
74 additions
and
887 deletions.
There are no files selected for viewing
Submodule terraform
updated
from b61e5e to 1aaf57
Submodule terraform-beta
updated
from b2e9b4 to 858167
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
resource "google_compute_instance" "<%= ctx[:primary_resource_id] %>" { | ||
name = "<%= ctx[:vars]['instance_name'] %>" | ||
zone = "<%= ctx[:vars]['zone_name'] %>" | ||
machine_type = "n1-standard-1" | ||
|
||
boot_disk { | ||
initialize_params { | ||
image = "debian-cloud/debian-9" | ||
} | ||
} | ||
|
||
network_interface { | ||
network = "default" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,7 +188,11 @@ The following arguments are supported: | |
|
||
<% url_properties.each do |param| -%> | ||
<% if param.name == "name" -%> | ||
* `<%= object.name.underscore -%>` - (Required) Used to find the parent resource to bind the IAM policy to | ||
* `<%= object.iam_policy.parent_resource_attribute || object.name.underscore -%>` - (Required) Used to find the parent resource to bind the IAM policy to | ||
<% elsif ["region", "zone"].include?(param.name.underscore) -%> | ||
* `<%= param.name.underscore -%>` - (Optional) <%= param.description -%> Used to find the parent resource to bind the IAM policy to. If not specified, | ||
the value will be parsed from the identifier of the parent resource. If no <%= param.name.underscore -%> is provided in the parent identifier and no | ||
<%= param.name.underscore -%> is specified, it is taken from the provider configuration. | ||
<% else -%> | ||
* `<%= param.name.underscore -%>` - (Required) <%= param.description -%> Used to find the parent resource to bind the IAM policy to | ||
<% end -%> | ||
|
@@ -243,14 +247,29 @@ exported: | |
|
||
## Import | ||
|
||
<%= product_ns -%> <%= object.name.downcase -%> IAM resources can be imported using the project, resource identifiers, role and member. | ||
For all import syntaxes, the "resource in question" can take any of the following forms: | ||
|
||
<% import_id_formats(object).each do |id_format| -%> | ||
* <%= id_format %> | ||
<% end -%> | ||
|
||
Any variables not passed in the import command will be taken from the provider configuration. | ||
|
||
<%= product_ns -%> <%= object.name.downcase -%> IAM resources can be imported using the resource identifiers, role, and member. | ||
|
||
IAM member imports use space-delimited identifiers: the resource in question, the role, and the member identity, e.g. | ||
``` | ||
$ terraform import <% if object.min_version.name == 'beta' %>-provider=google-beta <% end -%><%= resource_ns_iam -%>_member.editor "<%= object.id_format.gsub('{{name}}', "{{#{object.name.underscore}}}") -%> <%= object.iam_policy.allowed_iam_role -%> [email protected]" | ||
``` | ||
$ terraform import <%= resource_ns_iam -%>_policy.editor <%= object.id_format.gsub('{{name}}', "{{#{object.name.underscore}}}") %> | ||
|
||
IAM binding imports use space-delimited identifiers: the resource in question and the role, e.g. | ||
``` | ||
$ terraform import <%= resource_ns_iam -%>_binding.editor "<%= object.id_format.gsub('{{name}}', "{{#{object.name.underscore}}}") -%> <%= object.iam_policy.allowed_iam_role -%>" | ||
``` | ||
|
||
$ terraform import <%= resource_ns_iam -%>_member.editor "<%= object.id_format.gsub('{{name}}', "{{#{object.name.underscore}}}") -%> <%= object.iam_policy.allowed_iam_role -%> [email protected]" | ||
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 <%= object.id_format.gsub('{{name}}', "{{#{object.name.underscore}}}") %> | ||
``` | ||
|
||
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta` | ||
|
147 changes: 0 additions & 147 deletions
147
third_party/terraform/resources/iam_compute_instance.go
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.