Git Product home page Git Product logo

terraform-random-separator's Introduction

terraform-random-separator

Create a random separator string in HashiCorp Terraform.

This configuration uses the terraform_remote_state datasource and native functions in Terraform to output a randomized string value name, of a length determined by a separate Terraform Cloud workspace configured to use https://github.com/vaficionado/terraform-random-integer as its source.

To adjust the length of the integer, adjust the min and max values in https://github.com/vaficionado/terraform-random-integer/blob/master/main.tf

To adjust the separator configuration (length, character types, etc) adjust the special, upper, lower, and number values in main.tf

The function returns a single string output of separator and requires two workspace variables to be configured as follows:

  • organization : the name of the Terraform Cloud organization where the workspaces are configured
  • length-workspace : the name of the Terraform Cloud workspace where the integer output can be obtained (typically linked to https://github.com/vaficionado/terraform-random-integer)

Note that the string value in outputs.tf is customized using string interpolation to add - characters before and after the randomly generated string. This can be changed by removing the interpolation syntax around random_string.separator.result

For more information on how to link this configuration to a Terraform Cloud workspace, see this blog post: https://www.hashicorp.com/blog/using-terraform-cloud-and-version-control-systems/

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.