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

Add IAM resources to google_compute_instance_template #11932

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
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
30 changes: 30 additions & 0 deletions mmv1/products/compute/InstanceTemplate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: 'InstanceTemplate'
karolgorc marked this conversation as resolved.
Show resolved Hide resolved
kind: 'compute#instanceTemplate'
description: |
Resource that enables a convenient way to save a virtual machine (VM) instance's configuration
that includes all of its properties and allows you to create a new instance from it.
base_url: 'projects/{{project}}/global/instanceTemplates'
has_self_link: true
exclude_resource: true
properties:
- name: 'name'
type: String
description: |
Name of the resource.
required: true
immutable: true
iam_policy:
parent_resource_attribute: 'name'
base_url: 'projects/{{project}}/global/instanceTemplates/{{name}}'
example_config_body: 'templates/terraform/iam/iam_attributes.go.tmpl'
karolgorc marked this conversation as resolved.
Show resolved Hide resolved
import_format:
- 'projects/{{project}}/global/instanceTemplates/{{name}}'
- '{{name}}'
custom_code:
examples:
- name: 'instance_template_basic'
primary_resource_id: 'default'
primary_resource_name: 'fmt.Sprintf("tf-test-my-instance-template%s", context["random_suffix"])'
vars:
instance_name: 'my-instance-template'
12 changes: 12 additions & 0 deletions mmv1/templates/terraform/examples/instance_template_basic.tf.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "google_compute_instance_template" "{{$.PrimaryResourceId}}" {
name = "{{index $.Vars "instance_name"}}"
machine_type = "e2-medium"

disk {
source_image = "debian-cloud/debian-11"
}

network_interface {
network = "default"
}
}