salt.modules.gcp_addon

A route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with virtual machine instances by tag, and the set of routes for a particular VM is called its routing table. For each packet leaving a virtual machine, the system searches that machine's routing table for a single best matching route.

New in version 2018.3.0.

This module will create a route to send traffic destined to the Internet through your gateway instance.

codeauthor

Pratik Bandarkar <[email protected]>

maturity

new

depends

google-api-python-client

platform

Linux

salt.modules.gcp_addon.route_create(credential_file=None, project_id=None, name=None, dest_range=None, next_hop_instance=None, instance_zone=None, tags=None, network=None, priority=None)

Create a route to send traffic destined to the Internet through your gateway instance

credential_filestring

File location of application default credential. For more information, refer: https://developers.google.com/identity/protocols/application-default-credentials

project_idstring

Project ID where instance and network resides.

namestring

name of the route to create

next_hop_instancestring

the name of an instance that should handle traffic matching this route.

instance_zonestring

zone where instance("next_hop_instance") resides

networkstring

Specifies the network to which the route will be applied.

dest_rangestring

The destination range of outgoing packets that the route will apply to.

tagslist

(optional) Identifies the set of instances that this route will apply to.

priorityint

(optional) Specifies the priority of this route relative to other routes. default=1000

CLI Example:

salt 'salt-master.novalocal' gcp.route_create
    credential_file=/root/secret_key.json
    project_id=cp100-170315
    name=derby-db-route1
    next_hop_instance=instance-1
    instance_zone=us-central1-a
    network=default
    dest_range=0.0.0.0/0
    tags=['no-ip']
    priority=700

In above example, the instances which are having tag "no-ip" will route the packet to instance "instance-1"(if packet is intended to other network)

© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.gcp_addon.html