Skip to content

Latest commit

 

History

History
 
 

automatic-labelling-from-localhost

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Automatic Labelling from Localhost

This example demonstrates how to use the root module and the event-project-log-entry submodule to configure a system which responds to Compute VM creation events by labelling them with the principal email address of the account responsible for causing the events.

Usage

To provision this example, populate terraform.tfvars with the required variables and run the following commands within this directory:

  • terraform init to initialize the directory
  • terraform plan to generate the execution plan
  • terraform apply to apply the execution plan
  • terraform destroy to destroy the infrastructure

Inputs

Name Description Type Default Required
project_id The ID of the project to which resources will be applied. string n/a yes
region The region in which resources will be applied. string n/a yes
subnetwork The name or self_link of the subnetwork to create compute instance in. string "default" no
zone The zone in which resources will be applied. string n/a yes

Outputs

Name Description
compute_instance_name The name of the unlabelled Compute instance.

Requirements

The following sections describe the requirements which must be met in order to invoke this module. The requirements of the root module and the event-project-log-entry submodule must also be met.

Software Dependencies

The following software dependencies must be installed on the system from which this module will be invoked:

IAM Roles

The Service Account which will be used to invoke this module must have the following IAM roles:

  • Compute Instance Admin (v1): roles/compute.instanceAdmin.v1

APIs

The project against which this module will be invoked must have the following APIs enabled:

  • Compute Engine API: compute.googleapis.com