random_id

    0

    0

    lucycodes42

    Terraform snippets

    random_id is a resource that holds a unique id for each instance of a given resource.

    Shortcut: tf_random_id

    resource "random_id" "${myResourceName}" {
       name = "my-${myResourceName}"
       keepers = {
           # Generate a new id each time we switch to a new AMI id
           ami_id = "${var.ami_id}"
       }
       byte_length = 8
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.