Skip to main content

Route table updater for Oracle Cloud Infrastructure

Project description

Simple utility to insert route rule to OCI Route table

tests

The reason behind this utility is described here: 1251

This simple utility is intended to update the routing table during the terraform run. It inserts the routing rule in an idempotent way (so, it checks first if exact rule is present in routing table).

Examples

The example usage is inside null_resource terraform resource after VCN peering establishment:

resource "null_resource" "right_route_table_update" {
  triggers = {
    right_lpg = oci_core_local_peering_gateway.right_lpg.id
  }

  provisioner "local-exec" {
    command = "ortu --rt-ocid ${data.oci_core_route_tables.right_route_table.route_tables[0].id} --cidr ${data.oci_core_vcn.left_vcn.cidr_block} --ne-ocid ${oci_core_local_peering_gateway.right_lpg.id}"
  }
  provisioner "local-exec" {
    when    = destroy
    command = "ortu delete --rt-ocid ${data.oci_core_route_tables.right_route_table.route_tables[0].id} --cidr ${data.oci_core_vcn.left_vcn.cidr_block} --ne-ocid ${oci_core_local_peering_gateway.right_lpg.id}"
  }
}

resource "null_resource" "left_route_table_update" {
  triggers = {
    left_lpg = oci_core_local_peering_gateway.left_lpg.id
  }

  provisioner "local-exec" {
    command = "ortu --rt-ocid ${data.oci_core_route_tables.left_route_table.route_tables[0].id} --cidr ${data.oci_core_vcn.right_vcn.cidr_block} --ne-ocid ${oci_core_local_peering_gateway.left_lpg.id}"
  }
  provisioner "local-exec" {
    when    = destroy
    command = "ortu delete --rt-ocid ${data.oci_core_route_tables.left_route_table.route_tables[0].id} --cidr ${data.oci_core_vcn.right_vcn.cidr_block} --ne-ocid ${oci_core_local_peering_gateway.left_lpg.id}"
  }
}

Authentication

I'm using Ansible in my projects, so, this tool relies on ~/.oci/config and OCI_CONFIG_PROFILE environment variable.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ortu-0.3.0.tar.gz (6.1 kB view details)

Uploaded Source

File details

Details for the file ortu-0.3.0.tar.gz.

File metadata

  • Download URL: ortu-0.3.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

File hashes

Hashes for ortu-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ad6124543e8d4ca884479dc97aedeaa1233c32e4bc25e530a827a4afec5c92b9
MD5 eca79cf088f3132c25815cca60154788
BLAKE2b-256 feaa795637e9bc8df845bba306108d0d2d5890d08e38cf5724ae604ce54eafff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page