Git Product home page Git Product logo

gcp-auto-tag's Introduction

gcp-auto-tag

This repository contains code to autotag instances in GCP with a contact label, which can be useful for establishing who is responsiblef or a resource in GCP.

These instructions were adapted from https://blog.doit-intl.com/automatically-label-google-cloud-compute-engine-instances-and-disks-upon-creation-5d1245f361c1

  1. Go to Cloud Functions and click on CREATE FUNCTION.

    a. Give the function a name (such as autotagger), and change the trigger to Cloud Pub/Sub.

    b. Click CREATE TOPIC and give a title such as label-instance-on-creation. c. Click SAVE.

    d. Click NEXT to advance from Configuration to Code.

    e. Select Python 3.8.

    f. Click on SOURCE CODE and change it to ZIP Upload. You can download this repository as a zip file.

    g. Click DEPLOY.

  2. Go to Cloud Logging

    a. Add the following into QUERY and click RUN QUERY.

    resource.type="gce_instance"
    protoPayload.methodName="beta.compute.instances.insert"
    operation.first="true"
    

    b. Under ACTIONS select CREATE SINK. Name the sink autotagger-sink and set the destination to the Pub/Sub topic you created.

gcp-auto-tag's People

Contributors

schmmd avatar dplessas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.