0

I have a Boolean called "loose", based on it's value I want to use an existing resource or create one, let say a security group. I would like to avoid using terragrunt.

1 Answer 1

0

Yes, Terraform allows you to conditionally create a resource or use a data source based on the value of a variable. You can use the count parameter along with the count function to achieve this.

1
  • Maybe I wasn't clear. The simple case with count = 0 is not what I am asking. For example if a dns zone exists I dont want to attempt to create one, but if it doesn't I want my resource to be created. Commented Aug 16, 2023 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .