taskcat icon indicating copy to clipboard operation
taskcat copied to clipboard

How to pass random values for certain parameter in taskcat file

Open nitinitare opened this issue 2 years ago • 1 comments

When I am creating multiple resources through AWS codepipeline, all the builds will trigger at same time and only one build succeeds and other fails with error the resource already exist. I have only one .taskcat.yml file which is in the same folder as cloudformation template. And I have multiple .json parameters file in a different folder to create multiple resource.

Is there any way to pass random values for a parameter like resourcename(can be a s3 bucket, dynamodb table, rds, iam role etc)?

Let me know if there is a workaround.

nitinitare avatar May 10 '23 15:05 nitinitare

In infrastructure as code (IaC), naming is best implemented through tags/metadata rather than resource names to avoid situations like that, but there are ways to accomplish what you want, such as using taskcat pseudo parameters like $[taskcat_random-string] and/or appending either all or part of the stack ID (using CloudFormation intrinsic functions like sub, split, join, et cetera).

tlindsay42 avatar May 10 '23 15:05 tlindsay42