random_shuffle (Resource)

The resource random_shuffle generates a random permutation of a list of strings given as an argument.

Example Usage

// DO NOT EDIT. Code generated by 'cdktf convert' - Please report bugs at https://cdk.tf/bug
import { Construct } from "constructs";
import { Token, TerraformStack } from "cdktf";
/*
 * Provider bindings are generated by running `cdktf get`.
 * See https://cdk.tf/provider-generation for more details.
 */
import { Elb } from "./.gen/providers/aws/elb";
import { Shuffle } from "./.gen/providers/random/shuffle";
interface MyConfig {
  listener: any;
}
class MyConvertedCode extends TerraformStack {
  constructor(scope: Construct, name: string, config: MyConfig) {
    super(scope, name);
    const az = new Shuffle(this, "az", {
      input: ["us-west-1a", "us-west-1c", "us-west-1d", "us-west-1e"],
      resultCount: 2,
    });
    new Elb(this, "example", {
      availabilityZones: Token.asList(az.result),
      listener: config.listener,
    });
  }
}

Schema

Required

Optional

Important: Even with an identical seed, it is not guaranteed that the same permutation will be produced across different versions of Terraform. This argument causes the result to be less volatile, but not fixed for all time.

Read-Only