• Create a comma separated list of quoted strings on terraform

    2 min read

    terraform jsonencode comma separated

    Some times we need to generate a quoted comma separated list of strings out of a variable that is list of strings, for example, to generate an IAM policy like this one:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "secretsmanager:GetResourcePolicy",
            "secretsmanager:GetSecretValue",
            "secretsmanager:DescribeSecret",
            "secretsmanager:ListSecretVersionIds"
          ],
          "Resource": [ "arn:aws:secretsmanager:...", "arn:aws:secretsmanager:.." ]
        }
      ]
    }
    

    03/11/2021

    Read more...

From pet to cattle
Treat your kubernetes clusters like cattle, not pets